You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can run tox -e build locally and it correctly builds wheels with the correct package version number. However, when I use GitHub actions to build my package, it does not identify the version number, instead resulting in version number such as 0.0.post1.dev1+g0d1df5e, which prevents subsequent publishing to PyPi. See example run
Clearly I have missed an important step when configuring my build environment on GitHub actions, but I can't figure out what it is. Help appreciated!
Contents of release.yml defining the GitHub action
# Tox configuration file
# Read more under https://tox.readthedocs.org/
# THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!
[tox]
minversion = 3.15
envlist = {py38,py39,py310,py11}-{linux,windows,macos}
[testenv]
description = invoke pytest to run automated tests
isolated_build = True
setenv =
TOXINIDIR = {toxinidir}
passenv =
HOME
extras =
testing
commands =
pytest {posargs}
[testenv:{clean,build}]
description =
Build (or clean) the package in isolation according to instructions in:
https://setuptools.readthedocs.io/en/latest/build_meta.html#how-to-use-it
https://github.com/pypa/pep517/issues/91
https://github.com/pypa/build
# NOTE: build is still experimental, please refer to the links for updates/issues
skip_install = True
changedir = {toxinidir}
deps =
build: build[virtualenv]
commands =
clean: python -c 'from shutil import rmtree; rmtree("build", True); rmtree("dist", True)'
build: python -m build .
# By default `build` produces wheels, you can also explicitly use the flags `--sdist` and `--wheel`
# # To run `tox -e lint` you need to make sure you have a
# # `.pre-commit-config.yaml` file. See https://pre-commit.com
[testenv:lint]
description = Perform static analysis and style checks
skip_install = True
deps = pre-commit
passenv =
HOMEPATH
PROGRAMDATA
commands =
pre-commit run --all-files #{posargs:--show-diff-on-failure}
Hi @rkingsbury, I wonder if you need to specify fetch-tags: true of fetch-depth: 0 for the actions/checkout step so that setuptools-scm can use the VCS information to infer the version... Have you tried that?
Hi @rkingsbury, I wonder if you need to specify fetch-tags: true of fetch-depth: 0 for the actions/checkout step so that setuptools-scm can use the VCS information to infer the version... Have you tried that?
Thank you @abravalheri , this seems to have fixed it! Although actually the tag-fetching behavior of actions/checkout is the subject of an active issue: actions/checkout#701 , and setting fetch-tags: true by itself did not work. So in the end, I just set fetch-depth: 0
Description of your problem
I can run
tox -e build
locally and it correctly builds wheels with the correct package version number. However, when I use GitHub actions to build my package, it does not identify the version number, instead resulting in version number such as0.0.post1.dev1+g0d1df5e
, which prevents subsequent publishing to PyPi. See example runClearly I have missed an important step when configuring my build environment on GitHub actions, but I can't figure out what it is. Help appreciated!
Contents of
release.yml
defining the GitHub action**relevant sections of
tox.ini
**Please provide the full traceback using the
--very-verbose
flag.See GitHub action failed run
Versions and main components
The text was updated successfully, but these errors were encountered: