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

[internal] Rename generate-lockfiles to gen-lockfiles #12680

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build-support/bin/_generate_all_lockfiles_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def main() -> None:
# and egg problem from https://github.com/pantsbuild/pants/issues/12457. We must
# restore it here so that the lockfile gets generated properly.
"--python-setup-experimental-lockfile=3rdparty/python/lockfiles/user_reqs.txt",
"generate-lockfiles",
"generate-user-lockfile",
"gen-lockfiles",
"gen-user-lockfile",
"::",
],
check=True,
Expand Down Expand Up @@ -129,7 +129,7 @@ def main() -> None:
f"--coverage-py-interpreter-constraints={repr(CoverageSubsystem.default_interpreter_constraints)}",
f"--coverage-py-experimental-lockfile={CoverageSubsystem.default_lockfile_path}",
# Run the goal.
"generate-lockfiles",
"gen-lockfiles",
],
check=True,
)
Expand Down
10 changes: 5 additions & 5 deletions src/python/pants/backend/experimental/python/user_lockfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
logger = logging.getLogger(__name__)


# TODO(#12314): Unify with the `generate-lockfiles` goal. Stop looking at specs and instead have
# an option like `--lock-resolves` with a list of named resolves (including tools).
# TODO(#12314): Unify with the `gen-lockfiles` goal by using its `--resolves` option for named
# resolves, rather than taking CLI specs.
class GenerateUserLockfileSubsystem(GoalSubsystem):
name = "generate-user-lockfile"
name = "gen-user-lockfile"
help = "Generate a lockfile for Python user requirements (experimental)."


Expand All @@ -39,7 +39,7 @@ async def generate_user_lockfile_goal(
) -> GenerateUserLockfileGoal:
if python_setup.lockfile is None:
logger.warning(
"You ran `./pants generate-user-lockfile`, but `[python-setup].experimental_lockfile` "
"You ran `./pants gen-user-lockfile`, but `[python-setup].experimental_lockfile` "
"is not set. Please set this option to the path where you'd like the lockfile for "
"your code's dependencies to live."
)
Expand Down Expand Up @@ -74,7 +74,7 @@ async def generate_user_lockfile_goal(
),
# TODO(12382): Make this command actually accurate once we figure out the semantics
# for user lockfiles. This is currently misleading.
regenerate_command="./pants generate-user-lockfile ::",
regenerate_command="./pants gen-user-lockfile ::",
),
)
workspace.write_digest(result.digest)
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/goals/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def from_tool(
),
dest=subsystem.lockfile,
description=f"Generate lockfile for {subsystem.options_scope}",
regenerate_command="./pants generate-lockfiles",
regenerate_command="./pants gen-lockfiles",
)

@property
Expand Down Expand Up @@ -167,7 +167,7 @@ class PythonToolLockfileSentinel:


class GenerateLockfilesSubsystem(GoalSubsystem):
name = "generate-lockfiles"
name = "gen-lockfiles"
help = "Generate lockfiles for Python third-party dependencies."
required_union_implementations = (PythonToolLockfileSentinel,)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def register_options(cls, register):
"recommend this, as lockfiles are essential for reproducible builds.\n\n"
"To use a custom lockfile, set this option to a file path relative to the "
"build root, then activate the backend_package "
"`pants.backend.experimental.python` and run `./pants generate-lockfiles`.\n\n"
"`pants.backend.experimental.python` and run `./pants gen-lockfiles`.\n\n"
"This option is experimental and will likely change. It does not follow the "
"normal deprecation cycle."
),
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/python/python_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def register_options(cls, register):
"multiple lockfiles. This option's behavior may change without the normal "
"deprecation cycle.\n\n"
"To generate a lockfile, activate the backend `pants.backend.experimental.python`"
"and run `./pants generate-user-lockfile ::`.\n\n"
"and run `./pants gen-user-lockfile ::`.\n\n"
"Mutually exclusive with `[python-setup].requirement_constraints`."
),
)
Expand All @@ -138,7 +138,7 @@ def register_options(cls, register):
default=None,
help=(
"If set, Pants will instruct your users to run a custom command to regenerate "
"lockfiles, rather than running `./pants generate-lockfiles` like normal."
"lockfiles, rather than running `./pants gen-lockfiles` like normal."
"\n\nThis option is experimental and it may change at any time without the normal "
"deprecation cycle."
),
Expand Down