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

Can't compile pyproject.toml to requirements.txt #1619

Closed
Pixel-Minions opened this issue Feb 18, 2024 · 6 comments
Closed

Can't compile pyproject.toml to requirements.txt #1619

Pixel-Minions opened this issue Feb 18, 2024 · 6 comments
Labels
question Asking for clarification or support

Comments

@Pixel-Minions
Copy link

Pixel-Minions commented Feb 18, 2024

Hi,

I am running issues with the compilation of pyproject.toml to requirements.txt, I am using:
`uv pip compile pyproject.toml -o requirements.txt.

image

This is the content of the toml:

[tool.poetry]
name = "test package"
version = "1.0.0"
description = "test team"
authors = ["test <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.7"
boto3 = "^1.29"
QtPy = "^2.4"
Fileseq = "^1.15"
sentry-sdk = "^1.35"
qtmodern = "^0.2"
pystray = "^0.19"
rpyc = "^5.3"
@kpeez
Copy link

kpeez commented Feb 18, 2024

Your pyproject.toml is set up for poetry. You need to modify it to something like the following:

[project]
name = "test package"
version = "1.0.0"
description = "test team"
authors = [{name = "test", email="[email protected]"}]
dependencies = [
    "boto3", 
    "QtPy", 
    "Fileseq",
    "sentry-sdk",
    "qtmodern",
    "pystray", 
    "rpyc",
]

then running uv pip compile -o requirements.txt pyproject.toml should work as expected.

If you have additional optional dependencies those are specified in a different section:

[project.optional-dependencies]
dev = [
    "ruff",
    "mypy",
    "pytest",
]

and can be generated by running uv pip compile -o requirements-dev.txt --extra=dev pyproject.toml

If you want to specify specific package versions you can see here for more info.

@AlexWaygood AlexWaygood changed the title Can't compile pyproject.toml to requirements.py Can't compile pyproject.toml to requirements.txt Feb 18, 2024
@Pixel-Minions
Copy link
Author

Pixel-Minions commented Feb 18, 2024

Amazing @AlexWaygood , it works! Thank you. I would have loved to have the conversion from poetry to standard pyproject just because I have some many more. Can I briefly ask @AlexWaygood if does it support virtual environments from embedded versions of python? I tried a moment ago but it seems it doesn't. I can create an issue about it.

@charliermarsh charliermarsh added the question Asking for clarification or support label Feb 18, 2024
@charliermarsh
Copy link
Member

Ah yeah, unfortunately we don't support Poetry's metadata format, which is custom to Poetry. Perhaps we should add a custom error message here.

@zanieb
Copy link
Member

zanieb commented Feb 18, 2024

Also reported in #1597

@zanieb
Copy link
Member

zanieb commented Feb 18, 2024

Closing in favor of #1630. Thanks for reporting!

@zanieb
Copy link
Member

zanieb commented Mar 25, 2024

As of #2633 we support reading this directly.

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

No branches or pull requests

4 participants