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

Is there a command that allows me to list all installed packages from my existing project into the dependencies section of pyproject.toml? #9265

Closed
nonesubham opened this issue Nov 20, 2024 · 3 comments
Labels
great writeup A wonderful example of a quality contribution 💜

Comments

@nonesubham
Copy link

No description provided.

@FishAlchemist
Copy link
Contributor

If I understand correctly, you want to import all Python dependencies in the current environment into pyproject.toml?
I don't think there's a single command to do that. While I wouldn't recommend importing all environment dependencies into pyproject.toml, as some dependencies might become redundant after changing the version of a package. However, if you want to do so, you can use uv pip freeze to output a requirements.txt , then use uv add to add the requirements.txt to pyproject.toml. However, you might need to set the environment, as the lock file will look for other platforms, but the current environment might not be cross-platform compatible.

@MrMegaMango
Copy link

Is it preferred to move all packages from requirements.txt to pyproject.toml?

@charliermarsh
Copy link
Member

Yeah.

@charliermarsh charliermarsh added the great writeup A wonderful example of a quality contribution 💜 label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
great writeup A wonderful example of a quality contribution 💜
Projects
None yet
Development

No branches or pull requests

4 participants