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

Update pyproject.toml #160

Closed
wants to merge 1 commit into from
Closed

Update pyproject.toml #160

wants to merge 1 commit into from

Conversation

gantoine
Copy link

@gantoine gantoine commented Jan 6, 2025

Attempting to install this library with poetry fails. I've opened a PR with more information against poetry-core to fix the underlying issue, but I'm betting that a fix here would get released first.

I think this could also be fixed by changing the deprecated tools.poetry.urls to project.urls, though I haven't tested that version. Feel free to close this if another fix is more appropriate.

@siddhantgoel
Copy link
Owner

What's the error you're running into? I just ran poetry add streaming-form-data locally on another project that went through, so I'm curious.

@gantoine
Copy link
Author

gantoine commented Jan 6, 2025

Ah that's my bad, I forgot to link the poetry-core PR: python-poetry/poetry-core#803
Seems the poetry team is having a look, so this PR might not be required in the end?

#49 53.48 PEP517 build of a dependency failed
#49 53.48 
#49 53.48 Backend subprocess exited when trying to invoke build_wheel
#49 53.48 
#49 53.48     | Command '['/tmp/tmpfmm18r98/.venv/bin/python', '/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py', 'build_wheel', '/tmp/tmp_mphur1a']' returned non-zero exit status 1.
#49 53.48     | 
#49 53.48     | Traceback (most recent call last):
#49 53.48     |   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
#49 53.48     |     main()
#49 53.48     |   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
#49 53.48     |     json_out["return_val"] = hook(**hook_input["kwargs"])
#49 53.48     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#49 53.48     |   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
#49 53.48     |     return _build_backend().build_wheel(
#49 53.48     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#49 53.48     |   File "/tmp/tmpfmm18r98/.venv/lib/python3.12/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
#49 53.48     |     return WheelBuilder.make_in(
#49 53.48     |            ^^^^^^^^^^^^^^^^^^^^^
#49 53.48     |   File "/tmp/tmpfmm18r98/.venv/lib/python3.12/site-packages/poetry/core/masonry/builders/wheel.py", line 84, in make_in
#49 53.48     |     wb = WheelBuilder(
#49 53.48     |          ^^^^^^^^^^^^^
#49 53.48     |   File "/tmp/tmpfmm18r98/.venv/lib/python3.12/site-packages/poetry/core/masonry/builders/wheel.py", line 65, in __init__
#49 53.48     |     super().__init__(poetry, executable=executable)
#49 53.48     |   File "/tmp/tmpfmm18r98/.venv/lib/python3.12/site-packages/poetry/core/masonry/builders/builder.py", line 43, in __init__
#49 53.48     |     self._meta = Metadata.from_package(self._package)
#49 53.48     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#49 53.48     |   File "/tmp/tmpfmm18r98/.venv/lib/python3.12/site-packages/poetry/core/masonry/metadata.py", line 112, in from_package
#49 53.48     |     if name == "repository" and url == package.urls["Repository"]:
#49 53.48     |                                        ~~~~~~~~~~~~^^^^^^^^^^^^^^
#49 53.48     | KeyError: 'Repository'
#49 53.48 
#49 53.48 Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with streaming-form-data (1.19.0)
#49 53.48 
#49 53.48   - not supporting PEP 517 builds
#49 53.48   - not specifying PEP 517 build requirements correctly
#49 53.48   - the build requirements are incompatible with your operating system or Python version
#49 53.48   - the build requirements are missing system dependencies (eg: compilers, libraries, headers).
#49 53.48 
#49 53.48 You can verify this by running pip wheel --no-cache-dir --use-pep517 "streaming-form-data (==1.19.0)".
#49 53.48 
#49 ERROR: process "/bin/sh -c poetry install --no-ansi --no-cache" did not complete successfully: exit code: 1

@siddhantgoel
Copy link
Owner

Hmm, my initial inclination is to go with what Poetry's documentation recommends, which at the moment is lowercase keys inside project.urls. It seems like we could move a bunch of other keys in there as well. Would you be up for including those changes in too?

@gantoine
Copy link
Author

gantoine commented Jan 6, 2025

Sure I'll try that change on my fork and see if it runs!

@gantoine
Copy link
Author

gantoine commented Jan 6, 2025

@siddhantgoel Well I've tried a ton of different variations, and none of them work/all throw one poetry error or another. Switching [tool.poetry] to [project.urls] throws RuntimeError: The Poetry configuration is invalid: - project must contain ['name'] properties. Switching [tool.poetry] to [project] throws The Poetry configuration is invalid: - The fields ['authors', 'description', 'name', 'version'] are required in package mode.

I think something is internally wrong with poetry, and the inconsistencies in the docs seem to reflect that. At this point I leave it up to you to decide if you want to merge this or wait for poetry to fix their stuff.

@siddhantgoel
Copy link
Owner

Thanks for trying those variations out! Yes, indeed, seems like the 2.0.0 release is not completely stable. It might be worth waiting for a 2.0.1 to see whether that fixes these bugs.

@hongyiweiwu01
Copy link

@siddhantgoel Any chance we could pin the version of poetry-core in the build-system.requires section to 1.9.1 (I think the last working version)? I'm not sure how to pin it externally outside of the package's spec file.

@siddhantgoel
Copy link
Owner

I just published v1.19.1 which should fix the installation. I had been thinking about using uv for a few weeks now, so took this as a chance to finish the migration!

@gantoine
Copy link
Author

Thanks @siddhantgoel! In that case this issue can be closed? I'll keep my fork around for a while just in case someone pinned their build to it.

@siddhantgoel
Copy link
Owner

Yep! I'll close this PR as the project is now using uv.

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

Successfully merging this pull request may close these issues.

3 participants