Skip to content

Commit 54dccd3

Browse files
committed
REL: Prepare for v1.3.6 release.
`actions/checkout` introduced a breaking change where the github action does no longer fetches tags by default. We add extra parameters to the action to ensure tags are fetched so that the correct version number of the package can be inferred by `setuptools-scm`.
1 parent b69baa8 commit 54dccd3

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v3
25+
with:
26+
fetch-tags: 'true'
27+
fetch-depth: 0
2528

2629
- name: Set up QEMU
2730
if: runner.os == 'Linux'

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
clean:
44
rm -Rf build/* dist/* polyagamma/*.c polyagamma/*.so polyagamma/*.html \
55
./**/polyagamma.egg-info **/*__pycache__ __pycache__ .coverage* \
6+
polyagamma/_version.py \
67

78
cythonize:
89
cythonize polyagamma/*.pyx

polyagamma/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
from ._polyagamma import (
22
polyagamma as random_polyagamma, polyagamma_pdf, polyagamma_cdf
33
)
4-
from ._version import version as __version__, version_tuple as __version_info__
4+
try:
5+
from ._version import __version__, __version_tuple__
6+
except ImportError: # pragma: no cover
7+
raise RuntimeError(
8+
"Unable to find the version number that is generated when either building or "
9+
"installing from source. Please make sure that `polyagamma` has been properly "
10+
"installed, e.g. with\n\n pip install -e .\n"
11+
)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ packages = ["polyagamma"]
5555
polyagamma = ["*.pyx"]
5656

5757
[tool.setuptools_scm]
58-
write_to = "polyagamma/_version.py"
58+
version_file = "polyagamma/_version.py"
5959

6060
[tool.coverage.run]
6161
plugins = ["Cython.Coverage"]
@@ -73,6 +73,7 @@ before-test = "pip install numpy --pre"
7373
test-command = [
7474
"python -c 'from polyagamma import random_polyagamma;print(random_polyagamma());'"
7575
]
76+
environment = { SETUPTOOLS_SCM_DEBUG = 1 }
7677

7778
[tool.cibuildwheel.linux]
7879
archs = ["x86_64", "aarch64"]

0 commit comments

Comments
 (0)