-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 a migration guide from pip to uv projects #12382
base: main
Are you sure you want to change the base?
Conversation
4eb8dd6
to
1c68c8e
Compare
When using pip, requirements files specify both the dependencies for your project and lock | ||
dependencies to a specific version. For example, if you require `fastapi` and `pydantic`, you'd | ||
specify these in a `requirements.in` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using pip, requirements files specify both the dependencies for your project and lock | |
dependencies to a specific version. For example, if you require `fastapi` and `pydantic`, you'd | |
specify these in a `requirements.in` file: | |
When using `pip` with `pip-tools`, requirements files specify both the dependencies for your project and lock | |
dependencies to a specific version. For example, if you require `fastapi` and `pydantic`, you'd | |
specify these in a `requirements.in` file: |
|
||
### Development dependencies | ||
|
||
The requirements file format can only a single set of dependencies at once. This means if you have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirements file format can only a single set of dependencies at once. This means if you have | |
The requirements file format can only describe a single set of dependencies at once. This means if you have |
pytest | ||
``` | ||
|
||
Notice the base requirements are included with `-r requirements.in`. This is common, as it ensures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the base requirements are included with `-r requirements.in`. This is common, as it ensures | |
Notice the base requirements are included with `-r requirements.in` with version constraints specified by `-c requirements.txt`. This is common, as it ensures |
$ pip freeze > requirements.txt | ||
``` | ||
|
||
```text tite="requirements.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```text tite="requirements.txt" | |
```text title="requirements.txt" |
|
||
Here, all the versions constraints are _exact_. Only a single version of each package can be used. | ||
The above example was generated with `uv pip compile`, but could also be generated with | ||
`pip-compile` from `pip-tools`. The `requirements.txt` can also be generated using `pip freeze`, by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`pip-compile` from `pip-tools`. The `requirements.txt` can also be generated using `pip freeze`, by | |
`pip-compile` from `pip-tools`. The `requirements.txt` can also be generated using `pip freeze` on a pristine environment, by |
This is incomplete, but I wanted to post it to share progress. I've finished the "how" of importing from
requirements.txt
topyproject.toml
. The next step is to work on the narrative and explanation of other changes.Rendered