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

Install pip-tools in each venv #2106

Merged
merged 1 commit into from Sep 7, 2020
Merged

Install pip-tools in each venv #2106

merged 1 commit into from Sep 7, 2020

Conversation

seanh
Copy link
Collaborator

@seanh seanh commented Sep 7, 2020

Remove the separate pipcompile virtualenv and install pip-tools in
each individual venv separately instead. The pip-tools docs say:

pip-compile should be run from the same virtual environment as your project so conditional
dependencies that require a specific Python version, or other environment markers, resolve
relative to your project's environment.

So get tox to add pip-tools to every env after installing the env's
requirements file.

This means that the commands to manage Python dependencies are now:

To add a new dependency or to remove a dependency add the package name
to or remove the package name from the appropriate
requirements/<ENV>.in then run:

tox -e <ENV> --run-command 'pip-compile requirements/<ENV>.in'

This will modify the corresponding requirements/<ENV>.txt file. Commit
these changes to git and send a pull request.

To upgrade a single package to the latest version run:

tox -e <ENV> --run-command 'pip-compile --upgrade-package <PACKAGE> requirements/<ENV>.in'

To upgrade or downgrade a single package to a specific version run:

tox -e <ENV> --run-command 'pip-compile --upgrade-package "<PACKAGE>==<VERSION>" requirements/<ENV>.in'

Remove the separate `pipcompile` virtualenv and install pip-tools in
each individual venv separately instead. The pip-tools docs say:

> `pip-compile` should be run from the same virtual environment as your project so conditional
> dependencies that require a specific Python version, or other environment markers, resolve
> relative to your project's environment.

So get tox to add `pip-tools` to every env after installing the env's
requirements file.

This means that the commands to manage Python dependencies are now:

To add a new dependency or to remove a dependency add the package name
to or remove the package name from the appropriate
`requirements/<ENV>.in` then run:

    tox -e <ENV> --run-command 'pip-compile requirements/<ENV>.in'

This will modify the corresponding `requirements/<ENV>.txt` file. Commit
these changes to git and send a pull request.

To upgrade a single package to the latest version run:

    tox -e <ENV> --run-command 'pip-compile --upgrade-package <PACKAGE> requirements/<ENV>.in'

To upgrade or downgrade a single package to a specific version run:

    tox -e <ENV> --run-command 'pip-compile --upgrade-package "<PACKAGE>==<VERSION>" requirements/<ENV>.in'
Copy link
Contributor

@jon-betts jon-betts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much to say, pip-compile is gone

@seanh seanh merged commit 8edcbfd into master Sep 7, 2020
@seanh seanh deleted the fix-pip-compile-commands branch September 7, 2020 17:28
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.

None yet

2 participants