astral-sh / rye

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

Clarify how `rye lock` and `rye sync` work with already existing lock files #1371

Open jeertmans opened 2 months ago

jeertmans commented 2 months ago

Hello,

First, thank you for this great project!

I think the way lock files and synchronization are performed could be clarified, especially regarding the existence of previous lock files.

Indeed, I recently discovered the hard way that rync sync would actually use the option from a previous lock, if a lock file exists of course.

That means that:

rye sync --all-features
rye sync

Is the same as:

rye sync --all-features
rye sync --all-features

While this can be convenient, this does not seem to be documented neither in the help command nor in the online guide.

At first, coming from the Rust language, I was expecting that rye sync would always only select the default features. But here, it looks like rye sync --reset is needed here to achieve the desired outcome.

So I think it would be great to add some documentation about that specific behavior of Rye.