astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Allow for `.rye.toml` to configure `pyproject.toml` locally #1374

Open MilesCranmer opened 2 weeks ago

MilesCranmer commented 2 weeks ago

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.