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

Explore pip-tools for dependency management #1081

Closed
wants to merge 15 commits into from

Conversation

caleb-johnson
Copy link
Collaborator

@caleb-johnson caleb-johnson commented Nov 7, 2023

Fixes #901

I opened this PR to play around with pip-tools and continue the discussion in #901.

With this tool, instead of only specifying our top-most dependencies, we allow pip-tools to create our requirements.txt from a requirements.in. The requirements.in is very similar to our current requirements.txt, but it generally has its version restrictions relaxed to the maximum extent. This allows pip-tools to do much of the dependency management for us. The requirements.txt generated includes a fully resolved dependency tree, reducing the chances of conflicts during installation.

  • Convert requirements.txt files to .in files
  • Create .txt files from the .in files using pip-compile from pip-tools
  • Create a CI job for updating the requirements.txt files
    • Weekly during a time when packages aren't being actively released (if a package is released between creation of our requirements files, there could be discrepancies)
    • Any time a requirements.in file changes
    • Automatically creates a PR
  • Update documentation to reflect new way to install

@@ -0,0 +1,16 @@
ray[default,data]>2.6<3
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was getting errors when this was unpinned. One requirements file would install ray 2.3 and one would install ray 2.6, which led to conflicts between the dev and production envs.

@Tansito
Copy link
Member

Tansito commented Nov 13, 2023

Thanks @caleb-johnson ! I will start taking a look into this too. Thank you to start with! ❤️

@psschwei
Copy link
Collaborator

I'm assuming the answer to this is yes, but we should confirm that dependabot will handle updates on requirements.in files

@Tansito
Copy link
Member

Tansito commented Nov 14, 2023

I'm assuming the answer to this is yes, but we should confirm that dependabot will handle updates on requirements.in files

Well, I would not assume it to be honest. Definitely one of the things that we will need to see 😂

@@ -6,7 +6,6 @@


class Migration(migrations.Migration):

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Kind of annoying to have to update these files (migrations 0011, 0012) in this PR, but the black version being resolved for the gateway wants this fixed :)

commands =
pip-sync requirements-dev.txt
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This may be totally redundant. Need to double check

@IceKhan13
Copy link
Member

@caleb-johnson @Tansito any updates on this? should we close it?

@caleb-johnson
Copy link
Collaborator Author

@caleb-johnson @Tansito any updates on this? should we close it?

I think it is OK to close for now, and if @Tansito or anyone decides they would like to migrate to pip-tool, this PR can be revived or used as reference.

@psschwei psschwei closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve dependencies management
5 participants