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

[ttx_diff] Use pip-compile and requirements.in #1090

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Nov 4, 2024

This is a more consistent way of ensuring we have pinned our python dependencies.

This is a more consistent way of ensuring we have pinned our python
dependencies.
- `pip install -r resources/scripts/requirements.txt`
- `pip freeze > resources/scripts/constraints.txt`
- install pip-tools with `python -m pip install pip-tools`
- delete `resources/scripts/requirements.txt`
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need to delete it as it will be overwritten, but it's ok

python pacakges we are comparing against; to ensure this we use `pip-compile`
(part of [`pip-tools`]) to generate a pinned `requirements.txt` from a
`requirements.in` file in the root `resources/scripts` directory. To update the
set of python packages in use, you need to update this file:

- `rm -rf` your existing venv
- create a new venv and activate it
Copy link
Member

Choose a reason for hiding this comment

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

one doesn't need to delete and create a new venv when using pip-compile, it may well run from a global site-packages (e.g. I install it globally with pipx install pip-tools) as pip-compile does not modify its environment.

Copy link
Member

Choose a reason for hiding this comment

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

installing something in a venv is generally good practice especially when developing onto something, in this case we are simply using a development tool and it's not a requirement that it runs within a venv, so I don't think you should mention this here

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.

3 participants