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

2024-11-04 Thread Elliott Sales de Andrade via python-devel
On Mon, Nov 4, 2024 at 6:37 PM Gerald B. Cox via python-devel
 wrote:
>
> 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
>

The `-C` flag takes a config setting, not a command-line flag. And
`None` is the default, which is False. This appears to work:

%pyproject_wheel -Cdisable-autoupdate=True

> 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.

-- 
Elliott
-- 
___
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: Help with Python package

2025-06-18 Thread Elliott Sales de Andrade via python-devel
On Wed, Jun 18, 2025 at 4:12 PM W. Michael Petullo via python-devel
 wrote:
>
> I maintain Fedora's academic-admin package, and I found that it will
> not compile on Rawhide. Building in mock/Fedora 42 works fine. On
> Rawhide, I get:
>
> $ mock -r fedora-rawhide-x86_64 --rebuild 
> [...]/academic-admin-0.11.2-1.fc42.src.rpm
> [...]
> LookupError: tox configuration not found. To use tox, please ensure tox 
> configuration is located in current directory (in tox.ini, setup.cfg, 
> pyproject.toml, or tox.toml). See https://tox.wiki/en/latest/config.html for 
> details.
> [...]
>
> I am not sure why the build process is running Tox on mock/Rawhide. I
> tried a few variations, including adding an explicit %check section,
> both one that was empty and one that contained %pytest; and also patching
> out any mention of tox in the source tree.
>

You have passed `-t` to `pyproject_buildrequires`; it was always using
tox, now it's an error to try it if there's no configuration for it
available.

> The version I am trying to build is:
>
> https://src.fedoraproject.org/rpms/academic-admin/tree/ce2905f7c753cad748c339c737bb6eb8c24cce46
>
> Does anyone see what I am missing?
>
> --
> Mike
>
> :wq

-- 
Elliott
-- 
___
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