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

Add ; platform_system tag to requirements.lock where applicable #1166

Closed
hanerlend opened this issue Jun 19, 2024 · 6 comments
Closed

Add ; platform_system tag to requirements.lock where applicable #1166

hanerlend opened this issue Jun 19, 2024 · 6 comments
Assignees

Comments

@hanerlend
Copy link

Some times a requirements-file might include OS-specific requirements. This can be a problem if you develop on Windows, and want to deploy your project with Docker.

Example using Django + Daphne:

rye init newproject --virtual
cd newproject
rye add django daphne
rye sync

When trying to build a Docker image (which is linux, not windows), the build fails. To fix this, edit requirements.lock :

twisted-iocpsupport==1.0.4 ; platform_system == "Windows"

Coming from Poetry, this happened automatically. It would be really nice if this would also be implemented in Rye. 😊

@bluss
Copy link
Contributor

bluss commented Jun 25, 2024

This is possible with uv since yesterday ;) astral-sh/uv#4505

@hanerlend
Copy link
Author

This is possible with uv since yesterday ;) astral-sh/uv#4505

Nice! 🥳👏 Tested in Rye, and I see it's not there yet. Hopefully we won't have to exclude Windows-only deps with ; platform_system == "Windows" much longer. 😊

@charliermarsh
Copy link
Member

I can do a Rye release today, hopefully.

@hanerlend
Copy link
Author

Upgraded to Rye version 0.36.0 today.

requirements.lock still does not include the platform tag;

twisted-iocpsupport==1.0.4

will still fail when building a docker image.

@bluss
Copy link
Contributor

bluss commented Jul 8, 2024

@hanerlend New flag is rye sync --universal or set [tool.rye] universal = true in pyproject.toml. It works for me.

@charliermarsh
Copy link
Member

👍 Yeah it's opt-in for now

@charliermarsh charliermarsh self-assigned this Jul 8, 2024
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

3 participants