Skip to content

Commit

Permalink
Change how we retrieve the current version. Add comment to release wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
tomicapretto committed Oct 26, 2023
1 parent 63a4c28 commit 981706e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python3 -m twine upload dist/*
run: python3 -m twine upload dist/*

# See documentation on accesing the tag from the release
# Look for 'github.ref' and 'github.ref_name' in https://docs.github.com/en/actions/learn-github-actions/contexts
# On October, 2023 it says "For workflows triggered by release, this is the release tag created"
# So 'github.ref_name' should be the version number of the release we're making.
4 changes: 2 additions & 2 deletions bambi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from pkg_resources import get_distribution
from importlib.metadata import version

from pymc import math

Expand All @@ -12,7 +12,7 @@
from .priors import Prior
from . import interpret

__version__ = get_distribution("bambi").version
__version__ = version("bambi")

__all__ = [
"Model",
Expand Down
4 changes: 2 additions & 2 deletions bambi/backend/pymc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


from copy import deepcopy
from pkg_resources import get_distribution
from importlib.metadata import version

import numpy as np
import pymc as pm
Expand All @@ -20,7 +20,7 @@
_log = logging.getLogger("bambi")


__version__ = get_distribution("bambi").version
__version__ = version("bambi")


class PyMCModel:
Expand Down
4 changes: 2 additions & 2 deletions bambi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings

from copy import deepcopy
from pkg_resources import get_distribution
from importlib.metadata import version

import formulae as fm
import pymc as pm
Expand Down Expand Up @@ -33,7 +33,7 @@

ORDINAL_FAMILIES = (univariate.Cumulative, univariate.StoppingRatio)

__version__ = get_distribution("bambi").version
__version__ = version("bambi")


class Model:
Expand Down

0 comments on commit 981706e

Please sign in to comment.