Skip to content

Commit

Permalink
feat: Rename --no-lock option to --frozen-lockfile
Browse files Browse the repository at this point in the history
Close #2493

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Dec 15, 2023
1 parent 515a845 commit 81f4c18
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 36 deletions.
1 change: 1 addition & 0 deletions news/2496.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename `--no-lock` option to `--frozen-lockfile`.
4 changes: 2 additions & 2 deletions src/pdm/cli/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from pdm.cli.hooks import HookManager
from pdm.cli.options import (
dry_run_option,
frozen_lockfile_option,
install_group,
lockfile_option,
no_lock_option,
packages_group,
prerelease_option,
save_strategy_group,
Expand All @@ -34,7 +34,7 @@ class Command(BaseCommand):
arguments = (
*BaseCommand.arguments,
lockfile_option,
no_lock_option,
frozen_lockfile_option,
save_strategy_group,
update_strategy_group,
prerelease_option,
Expand Down
4 changes: 2 additions & 2 deletions src/pdm/cli/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from pdm.cli.hooks import HookManager
from pdm.cli.options import (
dry_run_option,
frozen_lockfile_option,
groups_group,
install_group,
lockfile_option,
no_lock_option,
skip_option,
venv_option,
)
Expand All @@ -27,7 +27,7 @@ class Command(BaseCommand):
install_group,
dry_run_option,
lockfile_option,
no_lock_option,
frozen_lockfile_option,
skip_option,
venv_option,
)
Expand Down
11 changes: 9 additions & 2 deletions src/pdm/cli/commands/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
from pdm.cli.commands.base import BaseCommand
from pdm.cli.filters import GroupSelection
from pdm.cli.hooks import HookManager
from pdm.cli.options import dry_run_option, install_group, lockfile_option, no_lock_option, skip_option, venv_option
from pdm.cli.options import (
dry_run_option,
frozen_lockfile_option,
install_group,
lockfile_option,
skip_option,
venv_option,
)
from pdm.exceptions import PdmUsageError, ProjectError

if TYPE_CHECKING:
Expand All @@ -23,7 +30,7 @@ class Command(BaseCommand):
install_group,
dry_run_option,
lockfile_option,
no_lock_option,
frozen_lockfile_option,
skip_option,
venv_option,
)
Expand Down
4 changes: 2 additions & 2 deletions src/pdm/cli/commands/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from pdm.cli.filters import GroupSelection
from pdm.cli.hooks import HookManager
from pdm.cli.options import (
frozen_lockfile_option,
groups_group,
install_group,
lockfile_option,
no_lock_option,
prerelease_option,
save_strategy_group,
skip_option,
Expand All @@ -36,7 +36,7 @@ class Command(BaseCommand):
groups_group,
install_group,
lockfile_option,
no_lock_option,
frozen_lockfile_option,
save_strategy_group,
update_strategy_group,
prerelease_option,
Expand Down
8 changes: 4 additions & 4 deletions src/pdm/cli/completions/pdm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _pdm_a919b69078acdf0a_complete()
case "$com" in

(add)
opts="--dev --dry-run --editable --fail-fast --global --group --help --lockfile --no-editable --no-isolation --no-lock --no-self --no-sync --prerelease --project --quiet --save-compatible --save-exact --save-minimum --save-wildcard --skip --unconstrained --update-all --update-eager --update-reuse --update-reuse-installed --venv --verbose"
opts="--dev --dry-run --editable --fail-fast --frozen-lockfile --global --group --help --lockfile --no-editable --no-isolation --no-self --no-sync --prerelease --project --quiet --save-compatible --save-exact --save-minimum --save-wildcard --skip --unconstrained --update-all --update-eager --update-reuse --update-reuse-installed --venv --verbose"
;;

(build)
Expand Down Expand Up @@ -69,7 +69,7 @@ _pdm_a919b69078acdf0a_complete()
;;

(install)
opts="--check --dev --dry-run --fail-fast --global --group --help --lockfile --no-default --no-editable --no-isolation --no-lock --no-self --plugins --production --project --quiet --skip --venv --verbose"
opts="--check --dev --dry-run --fail-fast --frozen-lockfile --global --group --help --lockfile --no-default --no-editable --no-isolation --no-self --plugins --production --project --quiet --skip --venv --verbose"
;;

(list)
Expand All @@ -89,7 +89,7 @@ _pdm_a919b69078acdf0a_complete()
;;

(remove)
opts="--dev --dry-run --fail-fast --global --group --help --lockfile --no-editable --no-isolation --no-lock --no-self --no-sync --project --quiet --skip --venv --verbose"
opts="--dev --dry-run --fail-fast --frozen-lockfile --global --group --help --lockfile --no-editable --no-isolation --no-self --no-sync --project --quiet --skip --venv --verbose"
;;

(run)
Expand All @@ -113,7 +113,7 @@ _pdm_a919b69078acdf0a_complete()
;;

(update)
opts="--dev --fail-fast --global --group --help --lockfile --no-default --no-editable --no-isolation --no-lock --no-self --no-sync --outdated --prerelease --production --project --quiet --save-compatible --save-exact --save-minimum --save-wildcard --skip --top --unconstrained --update-all --update-eager --update-reuse --update-reuse-installed --venv --verbose"
opts="--dev --fail-fast --frozen-lockfile --global --group --help --lockfile --no-default --no-editable --no-isolation --no-self --no-sync --outdated --prerelease --production --project --quiet --save-compatible --save-exact --save-minimum --save-wildcard --skip --top --unconstrained --update-all --update-eager --update-reuse --update-reuse-installed --venv --verbose"
;;

(use)
Expand Down
8 changes: 4 additions & 4 deletions src/pdm/cli/completions/pdm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ complete -c pdm -A -n '__fish_seen_subcommand_from add' -l dev -d 'Add packages
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l dry-run -d 'Show the difference only and don\'t perform any action'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l editable -d 'Specify editable packages'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l fail-fast -d 'Abort on first installation error'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l frozen-lockfile -d 'Don\'t try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l global -d 'Use the global project, supply the project root with `-p` option'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l group -d 'Specify the target dependency group to add into'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l help -d 'Show this help message and exit.'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l lockfile -d 'Specify another lockfile path. Default: pdm.lock. [env var: PDM_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l no-editable -d 'Install non-editable versions for all packages'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l no-isolation -d 'Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l no-lock -d 'Don\'t try to create or update the lockfile. [env var: PDM_NO_LOCK]'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l no-self -d 'Don\'t install the project itself. [env var: PDM_NO_SELF]'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l no-sync -d 'Only write pyproject.toml and do not sync the working set'
complete -c pdm -A -n '__fish_seen_subcommand_from add' -l prerelease -d 'Allow prereleases to be pinned'
Expand Down Expand Up @@ -187,14 +187,14 @@ complete -c pdm -A -n '__fish_seen_subcommand_from install' -l check -d 'Check i
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l dev -d 'Select dev dependencies'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l dry-run -d 'Show the difference only and don\'t perform any action'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l fail-fast -d 'Abort on first installation error'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l frozen-lockfile -d 'Don\'t try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l global -d 'Use the global project, supply the project root with `-p` option'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l group -d 'Select group of optional-dependencies separated by comma or dev-dependencies (with `-d`). Can be supplied multiple times, use ":all" to include all groups under the same species.'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l help -d 'Show this help message and exit.'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l lockfile -d 'Specify another lockfile path. Default: pdm.lock. [env var: PDM_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l no-default -d 'Don\'t include dependencies from the default group'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l no-editable -d 'Install non-editable versions for all packages'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l no-isolation -d 'Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l no-lock -d 'Don\'t try to create or update the lockfile. [env var: PDM_NO_LOCK]'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l no-self -d 'Don\'t install the project itself. [env var: PDM_NO_SELF]'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l plugins -d 'Install the plugins specified in pyproject.toml'
complete -c pdm -A -n '__fish_seen_subcommand_from install' -l production -d 'Unselect dev dependencies'
Expand Down Expand Up @@ -308,13 +308,13 @@ complete -c pdm -f -n '__fish_pdm_a919b69078acdf0a_complete_no_subcommand' -a re
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l dev -d 'Remove packages from dev dependencies'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l dry-run -d 'Show the difference only and don\'t perform any action'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l fail-fast -d 'Abort on first installation error'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l frozen-lockfile -d 'Don\'t try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l global -d 'Use the global project, supply the project root with `-p` option'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l group -d 'Specify the target dependency group to remove from'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l help -d 'Show this help message and exit.'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l lockfile -d 'Specify another lockfile path. Default: pdm.lock. [env var: PDM_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l no-editable -d 'Install non-editable versions for all packages'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l no-isolation -d 'Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l no-lock -d 'Don\'t try to create or update the lockfile. [env var: PDM_NO_LOCK]'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l no-self -d 'Don\'t install the project itself. [env var: PDM_NO_SELF]'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l no-sync -d 'Only write pyproject.toml and do not uninstall packages'
complete -c pdm -A -n '__fish_seen_subcommand_from remove' -l project -d 'Specify another path as the project root, which changes the base of pyproject.toml and __pypackages__ [env var: PDM_PROJECT]'
Expand Down Expand Up @@ -422,14 +422,14 @@ complete -c pdm -A -n '__fish_seen_subcommand_from sync' -l verbose -d 'Use `-v`
complete -c pdm -f -n '__fish_pdm_a919b69078acdf0a_complete_no_subcommand' -a update -d 'Update package(s) in pyproject.toml'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l dev -d 'Select dev dependencies'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l fail-fast -d 'Abort on first installation error'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l frozen-lockfile -d 'Don\'t try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l global -d 'Use the global project, supply the project root with `-p` option'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l group -d 'Select group of optional-dependencies separated by comma or dev-dependencies (with `-d`). Can be supplied multiple times, use ":all" to include all groups under the same species.'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l help -d 'Show this help message and exit.'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l lockfile -d 'Specify another lockfile path. Default: pdm.lock. [env var: PDM_LOCKFILE]'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-default -d 'Don\'t include dependencies from the default group'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-editable -d 'Install non-editable versions for all packages'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-isolation -d 'Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-lock -d 'Don\'t try to create or update the lockfile. [env var: PDM_NO_LOCK]'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-self -d 'Don\'t install the project itself. [env var: PDM_NO_SELF]'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l no-sync -d 'Only update lock file but do not sync packages'
complete -c pdm -A -n '__fish_seen_subcommand_from update' -l outdated -d 'Show the difference only without modifying the lockfile content'
Expand Down
8 changes: 4 additions & 4 deletions src/pdm/cli/completions/pdm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function TabExpansion($line, $lastWord) {
"-d", "--dev", "--save-compatible", "--save-wildcard", "--dry-run", "--save-exact",
"--save-minimum", "--update-eager", "--update-reuse", "--update-all", "-g", "--global",
"--no-sync", "--no-editable", "--no-self", "-u", "--unconstrained", "--no-isolation",
"--pre", "--prerelease", "-L", "--lockfile", "--fail-fast", "-x", "--no-lock", "--update-reuse-installed"
"--pre", "--prerelease", "-L", "--lockfile", "--fail-fast", "-x", "--frozen-lockfile", "--update-reuse-installed"
)),
$sectionOption,
$projectOption,
Expand Down Expand Up @@ -298,7 +298,7 @@ function TabExpansion($line, $lastWord) {
"install" {
$completer.AddOpts(@(
[Option]::new((
"-d", "--dev", "-g", "--global", "--dry-run", "--no-default", "--no-lock", "--prod",
"-d", "--dev", "-g", "--global", "--dry-run", "--no-default", "--frozen-lockfile", "--prod",
"--production", "--no-editable", "--no-self", "--no-isolation", "--check", "-L",
"--lockfile", "--fail-fast", "-x", "--plugins"
)),
Expand Down Expand Up @@ -378,7 +378,7 @@ function TabExpansion($line, $lastWord) {
@(
[Option]::new(@(
"--global", "-g", "--dev", "-d", "--dry-run", "--no-sync", "--no-editable", "--no-self",
"--no-isolation", "-L", "--lockfile", "--fail-fast", "-x", "--no-lock"
"--no-isolation", "-L", "--lockfile", "--fail-fast", "-x", "--frozen-lockfile"
)),
$projectOption,
$skipOption,
Expand Down Expand Up @@ -429,7 +429,7 @@ function TabExpansion($line, $lastWord) {
"-d", "--dev", "--save-compatible", "--prod", "--production", "--save-wildcard", "--save-exact",
"--save-minimum", "--update-eager", "--update-reuse", "--update-all", "-g", "--global", "--dry-run",
"--outdated", "--top", "-u", "--unconstrained", "--no-editable", "--no-self", "--no-isolation",
"--no-sync", "--pre", "--prerelease", "-L", "--lockfile", "--fail-fast", "-x", "--no-lock",
"--no-sync", "--pre", "--prerelease", "-L", "--lockfile", "--fail-fast", "-x", "--frozen-lockfile",
"--update-reuse-installed"
)),
$sectionOption,
Expand Down
8 changes: 4 additions & 4 deletions src/pdm/cli/completions/pdm.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ _pdm() {
'--update-all[Update all dependencies and sub-dependencies]'
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
"--frozen-lockfile[Don't try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]]"
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]'
Expand Down Expand Up @@ -207,7 +207,7 @@ _pdm() {
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
{--prod,--production}"[Unselect dev dependencies]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
"--frozen-lockfile[Don't try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]]"
"--no-default[Don\'t include dependencies from the default group]"
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
Expand Down Expand Up @@ -331,7 +331,7 @@ _pdm() {
"--no-sync[Only write pyproject.toml and do not uninstall packages]"
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
"--frozen-lockfile[Don't try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]]"
{-x,--fail-fast}'[Abort on first installation error]'
"--no-isolation[do not isolate the build in a clean environment]"
"--dry-run[Show the difference only without modifying the lockfile content]"
Expand Down Expand Up @@ -410,7 +410,7 @@ _pdm() {
'--no-editable[Install non-editable versions for all packages]'
"--no-self[Don't install the project itself]"
"--no-sync[Only update lock file but do not sync packages]"
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
"--frozen-lockfile[Don't try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]]"
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
{-u,--unconstrained}'[Ignore the version constraint of packages]'
{--pre,--prerelease}'[Allow prereleases to be pinned]'
Expand Down
Loading

0 comments on commit 81f4c18

Please sign in to comment.