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

Equivalent of Make.user for git-ignored local dependencies #1374

Open
MilesCranmer opened this issue Sep 8, 2024 · 3 comments
Open

Equivalent of Make.user for git-ignored local dependencies #1374

MilesCranmer opened this issue Sep 8, 2024 · 3 comments

Comments

@MilesCranmer
Copy link
Contributor

It seems there is no way to add a development dependency to a virtual environment without modifying pyproject.toml. The issue with this approach is that pyproject.toml is often tracked by git, so if I want to add personal development dependencies to a python project, I either need to:

  1. Work with a dirty git state, or
  2. Stash and unstash the changes repeatedly, or
  3. Use git update-index to ignore the pyproject.

While it is useful to have the [tool.rye] for global settings across multiple users, I think it would also be good to have a separate per-project file so I can set local settings. .rye.toml might make the most sense – this would basically allow a user to set all of the settings in [tool.rye], but locally, without changing the tracked pyproject settings.

@lorenzogatti
Copy link

You'd need to merge conflicting directives from two files, consistently for each command, and pyproject.toml would become unreliable.
What "personal development dependencies" are you unable to configure and share normally? Should they be managed by Rye in the first place?

@MilesCranmer
Copy link
Contributor Author

MilesCranmer commented Oct 1, 2024

.rye.toml would override pyproject.toml in the case of conflicts. You can think of it like a Make.user file for a Makefile based build, if that’s familiar at all.

Personal development dependencies are things like IPython. I want them in the virtualenv because a global IPython (as its warning message states) can fail to load the correct versions of libraries from a virtual environment. So I always want to put it in the local environment too.

But if I’m using rye, this means I perpetually have a pyproject.toml that is showing up in the unstaged changes for my git repo. If I had a separate .rye.toml or whatever, I could put it in the gitignore and not have this issue. It’s similar to why Make.user exists and why you don’t just have people editing a Makefile directly - because then git would always be asking if you want to commit those changes. A separate file = I can put it in the gitignore.

@MilesCranmer MilesCranmer changed the title Allow for .rye.toml to configure pyproject.toml locally Equivalent of Make.user for git-ignored local dependencies Oct 1, 2024
@MilesCranmer
Copy link
Contributor Author

@charliermarsh what do you think?

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