Skip to content
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

Handle cases with pyproject.toml but no setup.py #279

Open
jfhbrook opened this issue Dec 28, 2021 · 8 comments
Open

Handle cases with pyproject.toml but no setup.py #279

jfhbrook opened this issue Dec 28, 2021 · 8 comments

Comments

@jfhbrook
Copy link

I've been kicking the tires on COPR's automatic pypi feature, which uses this project to generate spec files. When trying it out with mdformat I get this error:

Running: which pyp2rpm

cmd: ['which', 'pyp2rpm']
cwd: .
rc: 0
stdout: /usr/bin/pyp2rpm
stderr: 

Running: pyp2rpm mdformat -t fedora --srpm -d /var/lib/copr-rpmbuild/results -b 3

cmd: ['pyp2rpm', 'mdformat', '-t', 'fedora', '--srpm', '-d', '/var/lib/copr-rpmbuild/results', '-b', '3']
cwd: .
rc: 3
stdout: INFO  Pyp2rpm initialized.
INFO  Using /var/lib/copr-rpmbuild/results as directory to save source.
INFO  Downloaded package from PyPI: /var/lib/copr-rpmbuild/results/mdformat-0.7.11.tar.gz.
INFO  Getting metadata from setup.py using SetupPyMetadataExtractor.
stderr: setup.py not found, maybe /var/lib/copr-rpmbuild/results/mdformat-0.7.11.tar.gz is not proper source archive.

Copr build error: setup.py not found, maybe /var/lib/copr-rpmbuild/results/mdformat-0.7.11.tar.gz is not proper source archive.

I believe the issue is that somewhere around PEP 621 it became plausible for a package to have a pyproject.toml but not a setup.py. This is certainly the case with mdformat.

This may be a bigger issue - support pyproject.toml at all - but sticking to the scope of the bug report for now.

@hroncok
Copy link
Member

hroncok commented Dec 28, 2021

Actually, PEP 517.

@gordonmessmer
Copy link
Member

This might also be a case where work is needed outside of pyp2rpm... If I manually create a modern fedora spec for the mdformat module and try to build it, the process fails while getting buildrequires:

Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.bcI8X8
...
/usr/bin/python3 -m tox --print-deps-to /tmp/tmpv0w1mh8n --print-extras-to /tmp/tmplkq6mdp0 --no-provision /tmp/tmpe027hh6m -qre py310
...
tox.exception.ConfigError: ConfigError: Either whitelist_externals or allowlist_externals might be specified, not both

I'm not sure at the moment if that's a bug in tox, or a bug in mdformat's pyproject.toml file.

@jfhbrook
Copy link
Author

jfhbrook commented Jan 7, 2022

Oh my! my guess is that they're synonyms and that tox started validating it better more recently. At a minimum it sounds like there's a simple to reproduce and simple to fix bug with the pyproject.toml file. I can probably take and run with that in the next few days if mdformat is on github. Maybe I can get a patch in-flight

I think there may be a misunderstanding on my part, given the copr output. Are we triggering the same code path and the copr log is just obscuring that? Or perhaps copr is running an old version of pyp2rpm? If the latter, I can follow up with the copr project on pagure.

I've been distracted but I've also been meaning to reproduce this locally - I just haven't gotten to it, and if this thing I'm running into is someone else's problem I feel bad for knocking!

@hroncok
Copy link
Member

hroncok commented Jan 7, 2022

This sounds like fedora-python/tox-current-env#45 -- I'll make sure it's fixed soon.

@gordonmessmer
Copy link
Member

I think there may be a misunderstanding on my part, given the copr output. Are we triggering the same code path and the copr log is just obscuring that?

No, we're not. The error you're reporting is a feature that pyp2rpm needs, and any module that has only pyproject.toml in the fashion that you reported. I'm noting that mdformat might not be an ideal example of such a module because once pyp2rpm produces a spec in the modern format, the resulting build will still fail, so we can't do an end-to-end test using that module.

@gordonmessmer
Copy link
Member

This sounds like fedora-python/tox-current-env...

I'll follow that bug, as well. Thanks, @hroncok

@papoteur-mga
Copy link

Hello,
I have this example which doesn't provide setup.py:

pyp2rpm pyproject-metadata
setup.py not found, maybe /home/yves/rpmbuild/SOURCES/pyproject-metadata-0.5.0.tar.gz is not proper source archive.

@ralequi
Copy link

ralequi commented Nov 3, 2023

Any news on this? setup.py is deprecated and new support for pyproject.toml is a must to keep this project alive.
Or is this project already dead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants