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

[TODO] Reduce requirements to bare minimum #3

Open
Theelx opened this issue Mar 2, 2024 · 3 comments
Open

[TODO] Reduce requirements to bare minimum #3

Theelx opened this issue Mar 2, 2024 · 3 comments
Assignees

Comments

@Theelx
Copy link
Collaborator

Theelx commented Mar 2, 2024

In order to be able to test any changes effectively in CI, the time taken to install dependencies needs to be reduced. It took me 2-3 minutes just to install the dependencies, so it could easily take 5+ minutes on a GitHub Actions runner. I'm planning to use pipdeptree and other tools to help reduce the requirements.txt file to a minimum, in order to remove extraneous packages leftover in peoples' environments that get output with freeze. This should also help us remove packages that may pose a security risk, letting us be confident that the app is secure.

@Theelx Theelx self-assigned this Mar 2, 2024
@Theelx
Copy link
Collaborator Author

Theelx commented Mar 2, 2024

Also, pinning the version of every package with pip freeze often means that more secure package versions can't be installed. For example, this project currently has Pillow 10.1.0 pinned but Pillow 10.2.0 fixes an arbitrary code execution bug. When using a simpler requirements.txt with only directly used packages pinned, pip is able to figure out that 10.2.0 can be installed without risking breakage, and installs it.

@karthik18495
Copy link
Member

I do have a question here. Since pip does not check for version mismatches (resolve dependencies conflicts) dont you think, it might be problematic if the requirements.txt has only packages listed? May be in this case we can use something like poetry

@Theelx
Copy link
Collaborator Author

Theelx commented Mar 14, 2024

The latest pip does check for version mismatches, I believe that was added in pip 24. We also don't need to leave the version requirements blank, but it could be useful to set a minimum version so make pip's dependency resolving easier.

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

2 participants