New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add a version tag build when building with "build" #4129
Comments
Hi @smartYSC, thank you very much for reporting this. By all means please do consider support for This is a complicated topic and I feel that we are kind of steering in circles: every time that we try to improve something that is suggested by someone we change something else that breaks things for other users... Would something like the following work for you? echo -e "[egg_info]\ntag_build=.dev+foo\n" > /tmp/build_opts.cfg
export DIST_EXTRA_CONFIG=/tmp/build_opts.cfg
python -m build To me, the proper fix is to move #4083 ahead, but I have not got much feedback on that, nor people willing to champion the implementation. |
Thank you for the immediate response! I shortened this to: echo -e "[egg_info]\ntag_build=.dev+foo\n" > /tmp/build_opts.cfg
DIST_EXTRA_CONFIG=/tmp/build_opts.cfg python -m build And it works fine! I will change our build process accordingly. Actually I cannot really help with the underlying problem you pointed out as I do not know (that) much about Python packaging. Is your solution just a workaround that may break again in the (forseeable) future once #4083 is resolved? Or is this the "proper" way to provide build options? Keep up the good work, I really appreciate that you are trying to solve the many issues outdated/deprecated Python packaging has! |
I believe that right now the solution I pointed out is the most stable way of achieving the task you proposed. It will stop working once we remove |
Let's rename this topic and change categories so more people can find help in the future. |
I also met this problem. For now, I plan to work around that by pinning |
Hi @junshi356, please see my previous comment about the most stable solution we have right now. Note that the suggestion uses a throw-away file not included in the dist. |
setuptools version
setuptools===69.0.0
Python version
Python 3.8.10
OS
Ubuntu 20.04 in WSL
Additional environment information
No response
Description
We are building test packages for branches and tag them as described here.
The build is executed with
build===1.0.3
like this:The equivalent command for
setup.py
would be something like this:Building with
setup.py
works correctly insetuptools===68.2.2
AND69.0.0
. Building withbuild
works in68.2.2
but fails in69.0.0
. This is like due to the change of--build-option
introduced in #4079.However, I cannot find a way to pass the
egg_info --tag-build=.dev+foo
intosetuptools===69.0.0
viabuild
.I am not totally sure if this is a bug (because the change is documented) or if this is even an issue with
setuptools
orbuild
. However, the interaction between both tools broke for us :-(Is there a way to still tag a build through
build
when I cannot provide this as abuild-option
anymore?Expected behavior
Building with
setuptools
viabuild
should allow to tag builds.How to Reproduce
Inside some project buildable with
build
(pyproject.toml
andsetup.py
both work)python -m venv venv
source venv/bin/activate
pip install build setuptools==68.2.2 wheel
python -m build -C--build-option=egg_info -C--tag-build=.dev+foo -n
-> WORKSpip install setuptools=69.0.0
python -m build -C--build-option=egg_info -C--tag-build=.dev+foo -n
-> FAILSNote that the example runs
build
with option-n
to be able to change the version ofsetuptools
by using a non-isolated build. Running without-n
will always fail as it installssetuptools==69.0.0
in its own temporary virtual environment.Output
The error message printed is also somewhat misleading...
The text was updated successfully, but these errors were encountered: