How to pass arbritary options in SPEC file for python build

2024-11-04 Thread Gerald B. Cox via python-devel
Posted originally here:
https://discussion.fedoraproject.org/t/how-to-pass-arbritary-options-in-spec-file-for-python-build/135434/

I’m currently refactoring the picard spec file to conform to the new python 
build guidelines (used pyprojectize, thanks!), 
everything fine there so I thought I’d add --disable-autoupdate so as to remove 
the new update 
option at runtime. Picard allows for this by using --disable-update. When I try:

%pyproject_wheel -C–disable-autoupdate=None

It build fine, but doesn’t work. I’ve asked the good folks at the Picard forum 
and here is the response:

I tried getting options to pass with python -m build, but without success.
Picard is using the setuptools backend, and it looks like passing arbitrary 
options is currently not working there. See the discussion at Setuptools 
does not pass config_settings through backend · Issue #2491 · 
pypa/setuptools · GitHub .

I would have expected something like python -m build --wheel 
-C--disable-autoupdate 
or maybe python -m build --wheel -C--disable-autoupdate=True should work, 
but it doesn’t for now, as the parameters are not passed on.

One workaround seems to be to add a custom build backend that overrides the 
relevant 
parts to handle the customer build parameters as it was done for example in 
Add custom 
build backend to supportbuild args by tobiasah · Pull Request #328 · 
capnproto/pycapnp · GitHub

We could also maybe check for specific environment variables or such. But 
ideally the issue gets solved in setuptools itself.

Am I missing some functionality in the Fedora buildtools or is this just not 
possible. Thanks for any insights.
-- 
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: How to pass arbritary options in SPEC file for python build

2024-11-05 Thread Gerald B. Cox via python-devel
Thanks, I tried your suggestion and it builds fine, but it doesn't disable the 
autoupdate.
-- 
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: How to pass arbritary options in SPEC file for python build

2024-11-05 Thread Gerald B. Cox via python-devel
Hi Miro
Thanks for the reply.  Picard ships with the ability for the user to check to 
see if there is a later update than what is packaged
and then tries to apply it.  Since this is a RPM package, that's not 
appropriate, so upstream created the option to disable
the update dialog via the --disable-autoupdate option.  If this isn't possible, 
I found a workaround by manually patching the setup.py file.  

I receive the following error:
 Running command Preparing metadata (pyproject.toml)
  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 --disable-autoupdate not recognized
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem 
with pip.
  full command: /usr/bin/python3 
/usr/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py
 prepare_metadata_for_build_wheel 
/home/gbcox/fedpkg/picard/picard-2.12.3-build/picard-2c1c30e6ccba886270cb49aed6d0329e114763da/.pyproject-builddir/tmp9ycqtxyw
  cwd: 
/home/gbcox/fedpkg/picard/picard-2.12.3-build/picard-2c1c30e6ccba886270cb49aed6d0329e114763da
  Preparing metadata (pyproject.toml): finished with status 'error'
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
error: Bad exit status from /var/tmp/rpm-tmp.zYPqTD (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.zYPqTD (%build)
-- 
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: How to pass arbritary options in SPEC file for python build

2024-11-05 Thread Gerald B. Cox via python-devel
Hi Miro, Thanks for taking the time to respond.  I'm probably not doing a very 
good job explaining this.  Perhaps it would help you
understand better if you went directly to the ticket where the option was 
created:
https://tickets.metabrainz.org/browse/PICARD-1325

Hope that helps.
-- 
___
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue