-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] --tag-date and --tag-build have no effect when building in PEP 517 mode #2955
Comments
Thanks for the report. This is essentially a dupe of #2491. |
The option is called
|
Thanks, I wasn't sure about that. #2491 is about passing options to the underlying build command, but the two specific options I have problems with seem like they need to be used before that, and not sent to the build command (see below).
Thanks, using the singular option works... but also doesn't work. It causes a failure in the "Building sdist" step. Using either (myvenv) PS > py -m build -C--global-option=--tag-date mypackage
[Redacted for brievity]
* Building sdist...
Traceback (most recent call last):
File "[...]\myvenv\lib\site-packages\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "[...]\myvenv\lib\site-packages\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "[...]\myvenv\lib\site-packages\pep517\in_process\_in_process.py", line 314, in build_sdist
return backend.build_sdist(sdist_directory, config_settings)
File "[...]\Temp\build-env-xarzif_6\lib\site-packages\setuptools\build_meta.py", line 234, in build_sdist
return self._build_with_temp_dir(['sdist', '--formats', 'gztar'],
File "[...]\Temp\build-env-xarzif_6\lib\site-packages\setuptools\build_meta.py", line 211, in _build_with_temp_dir
sys.argv = (sys.argv[:1] + setup_command +
TypeError: can only concatenate list (not "str") to list
ERROR Backend subproccess exited when trying to invoke build_sdist Using one of them with a second global option results in an unrecognized argument error: (myvenv) PS > py -m build -C--global-option=--tag-build -C--global-option=testbuild mypackage
[Redacted for brievity]
* Building sdist...
usage: _in_process.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: _in_process.py --help [cmd1 cmd2 ...]
or: _in_process.py --help-commands
or: _in_process.py cmd --help
error: option --tag-build not recognized
ERROR Backend subproccess exited when trying to invoke build_sdist |
What is the original command you are attempting to translate? Is |
I tried using this page of the documentation: https://setuptools.pypa.io/en/latest/userguide/distribution.html#tagging-and-daily-build-or-snapshot-releases (which I linked in the opening post). It seems these two parameters are valid for |
There is a proposal at the bottom of #2491 about namespacing the config settings. |
setuptools version
60.0.3
Python version
3.9.0
OS
Windows 10
Additional environment information
Other possibly relevant packages:
Description
According to the Setuptools documentation, it is possible to specify a version tag from the command line. The typical usecase is a project with automated builds, in ordere to avoid modifying the setup files everytime to change the version (this is my usecase).
When building a PEP 518 project that has no
setup.py
, it is impossible to use--tag-build
and--tag-date
to add a version suffix from the command line.All of the following commands will produce a distribution with no version tag:
(I have tried the latter 4 after reading issue #2491)
The following command simply fails (which is normal):
python -m build --tag-date myproject
Expected behavior
The source and wheel distribution are produced with the version number from
setup.cfg
suffixed by the build tag or date tag (depending to the option used).For instance, if the version number in
setup.cfg
is0.0.0
andtag-build=nightly
is used, the expected output is a source and wheel distribution with version0.0.0.nightly
.How to Reproduce
setuptools.build_meta
as the build backendsetup.cfg
file but nosetup.py
Output
Assuming the version number in
setup.cfg
is0.0.0
:The source dist and wheel in the
dist
directory both have the version number0.0.0
.Code of Conduct
The text was updated successfully, but these errors were encountered: