-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
introduce sync
command
#9801
base: main
Are you sure you want to change the base?
introduce sync
command
#9801
Conversation
969c737
to
df241e7
Compare
Deploy preview for website ready! ✅ Preview Built with commit 2812a1a. |
is it possible adding this to v1, too? |
No, I do not think so. We will probably only do another 1.x release if there is a critical issue and we will not include new features in that case. |
@radoering a point of note here; we have until now avoided or tried to avoid cases where we have 2 ways to do the same thing via the CLI. This definitely breaks that model (we actually might have already broken it). I do not have a strong opinion on this as long as the underlying code is clearly an alias and documented as such. Wanted to note this here and want to make sure this is intentional. |
df241e7
to
575ffb8
Compare
Agreed.
It stems from the wish of some users that I added a note with some additional information to the docs. |
I have to disagree. If this is to be just an alias, I don't see a reason to make this change. Splitting the behavior makes more sense to me. |
@Secrus I do not disagree. My point, to be clearer is, if we are duplicating functionality I am not (personally) strongly opposed to a clearly documented alias. If we were splitting functionality, that is perfectly fine too, as long as we deprecate/remove the original. Whatever we choose, we just need to be clear on what and why.
@radoering If it were up-to me, I would just enforce virtual environments and be done with it. But I am sure some containers-don't-need-venv-footgun-warriors will be up in arms. I am surprised the system-site-packages case is impacted, as we should not be touching those packages at all. But then again, I guess detection is not always the easiest. As I write this, I am weirdly becoming more opposed to the "sync" as a new command idea. I much rather have All that said, I am open to see what the consensus between the rest of the maintainers is and go with it. |
575ffb8
to
d6b43ff
Compare
d6b43ff
to
60d4c4b
Compare
60d4c4b
to
e9673f0
Compare
description = "Update the project's environment according to the lockfile." | ||
|
||
options: ClassVar[list[Option]] = [ | ||
opt for opt in InstallCommand.options if opt.name != "sync" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are introducing it as a command, maybe we could remove the --sync
option from install
? I don't see why we would keep a duplicate (especially with the major version bump).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to avoid this breaking change because it would break a lot of CI scripts. (Most of our other breaking changes are not really relevant for most users or at least not relevant for CI.) But we can deprecate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's deprecate it, but with a set date (June 2025 sounds reasonable). I'd like us to avoid a long-living deprecation we are stuck with forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, there is also poetry self install --sync
.
Option a) Do not deprecate --sync
for poetry self install
(only for poetry install
).
Option b) Introduce poetry self sync
for the symmetry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have chosen option b).
docs/cli.md
Outdated
The `sync` command makes sure that the project's environment is in sync with the `poetry.lock` file. | ||
It is equivalent to running `poetry install --sync` and provides the same options | ||
(except for `--sync`) as [install]({{< relref "#install" >}}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid the direct reference to poetry install
here. Explanation and an options list like for other commands, would be more open-ended and wouldn't be considered "breaking" if we decide to split install
and sync
even more in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I thought that too. I have just been too lazy so far, but I will make up for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should look better now.
|
||
# import all tests from the install command | ||
# and run them for sync by overriding the command fixture | ||
from tests.console.commands.test_install import * # noqa: F403 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick to satisfy the mind goblins: I hate that we have to do that like this, but I don't see any better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito.
Pull Request Check List
As suggested in #9136 (comment). Still not sure about it and how much duplication in the docs would be needed.
Closes #9855