Repository: pdm-project/pdm
Pull request #2546 (2024-01-10 03:58:51)

Dev
## Pull Request Checklist

- [ ] A news fragment is added in `news/` describing what is new.
- [ ] Test cases added for changed code.

## Describe what you have changed in this PR.


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/pdm-project/pdm/pull/2546?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`1294189`)](https://app.codecov.io/gh/pdm-project/pdm/commit/12941894d3ce5008a5661b7cd7207234129393c1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project) 84.62% compared to head [(`66feeb8`)](https://app.codecov.io/gh/pdm-project/pdm/pull/2546?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project) 84.65%.
> Report is 23 commits behind head on main.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #2546      +/-   ##
==========================================
+ Coverage   84.62%   84.65%   +0.03%     
==========================================
  Files         104      104              
  Lines       10335    10338       +3     
  Branches     2258     2259       +1     
==========================================
+ Hits         8746     8752       +6     
+ Misses       1116     1114       -2     
+ Partials      473      472       -1     
```

| [Flag](https://app.codecov.io/gh/pdm-project/pdm/pull/2546/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/pdm-project/pdm/pull/2546/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project) | `84.44% <100.00%> (+0.03%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project#carryforward-flags-in-the-pull-request-comment) to find out more.


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/pdm-project/pdm/pull/2546?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pdm-project).


Patch:
diff --git a/news/2496.feature.md b/news/2496.feature.md
new file mode 100644
index 00000000..fbe0d25b
--- /dev/null
+++ b/news/2496.feature.md
@@ -0,0 +1,1 @@
+Rename `--no-lock` option to `--frozen-lockfile`.
diff --git a/news/2497.feature.1.md b/news/2497.feature.1.md
new file mode 100644
index 00000000..3c8811f2
--- /dev/null
+++ b/news/2497.feature.1.md
@@ -0,0 +1,1 @@
+Add `--no-hashes` as the recommended option name in favor of `--without-hashes` for `pdm export` command.
diff --git a/news/2497.feature.2.md b/news/2497.feature.2.md
new file mode 100644
index 00000000..a558e63d
--- /dev/null
+++ b/news/2497.feature.2.md
@@ -0,0 +1,1 @@
+Add `--no-markers` to `export` command to exclude markers from the output.
diff --git a/src/pdm/cli/commands/add.py b/src/pdm/cli/commands/add.py
index 8780ed32..0eb44b22 100644
--- a/src/pdm/cli/commands/add.py
+++ b/src/pdm/cli/commands/add.py
@@ -8,9 +8,9 @@ from pdm.cli.filters import GroupSelection
 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,
@@ -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,
diff --git a/src/pdm/cli/commands/export.py b/src/pdm/cli/commands/export.py
index 134d0d8c..c2c96e79 100644
--- a/src/pdm/cli/commands/export.py
+++ b/src/pdm/cli/commands/export.py
@@ -29,12 +29,16 @@ class Command(BaseCommand):
         )
         groups_group.add_to_parser(parser)
         parser.add_argument(
+            "--no-hashes",
             "--without-hashes",
             dest="hashes",
             action="store_false",
             default=True,
             help="Don't include artifact hashes",
         )
+        parser.add_argument(
+            "--no-markers", action="store_false", default=True, dest="markers", help="Don't include platform markers"
+        )
         parser.add_argument(
             "-o",
             "--output",
@@ -67,7 +71,7 @@ class Command(BaseCommand):
                 raise PdmUsageError("No lockfile found, please run `pdm lock` first.")
 
             candidates = resolve_candidates_from_lockfile(
-                project, requirements.values(), groups=set(selection), cross_platform=True
+                project, requirements.values(), groups=set(selection), cross_platform=options.markers
             )
             # Remove candidates with [extras] because the bare candidates are already
             # included
diff --git a/src/pdm/cli/commands/install.py b/src/pdm/cli/commands/install.py
index aa1b8d1a..f2f9b6e9 100644
--- a/src/pdm/cli/commands/install.py
+++ b/src/pdm/cli/commands/install.py
@@ -8,10 +8,10 @@ from pdm.cli.filters import GroupSelection
 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,
 )
@@ -27,7 +27,7 @@ class Command(BaseCommand):
         install_group,
         dry_run_option,
         lockfile_option,
-        no_lock_option,
+        frozen_lockfile_option,
         skip_option,
         venv_option,
     )
diff --git a/src/pdm/cli/commands/remove.py b/src/pdm/cli/commands/remove.py
index 46364658..0cc09764 100644
--- a/src/pdm/cli/commands/remove.py
+++ b/src/pdm/cli/commands/remove.py
@@ -6,7 +6,14 @@ from typing import TYPE_CHECKING, cast
 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:
@@ -23,7 +30,7 @@ class Command(BaseCommand):
         install_group,
         dry_run_option,
         lockfile_option,
-        no_lock_option,
+        frozen_lockfile_option,
         skip_option,
         venv_option,
     )
diff --git a/src/pdm/cli/commands/update.py b/src/pdm/cli/commands/update.py
index 2e70f1de..2b1bb44c 100644
--- a/src/pdm/cli/commands/update.py
+++ b/src/pdm/cli/commands/update.py
@@ -8,10 +8,10 @@ from pdm.cli.commands.base import BaseCommand
 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,
@@ -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,
diff --git a/src/pdm/cli/completions/pdm.bash b/src/pdm/cli/completions/pdm.bash
index 71b03a55..2e9f47fd 100644
--- a/src/pdm/cli/completions/pdm.bash
+++ b/src/pdm/cli/completions/pdm.bash
@@ -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)
@@ -49,7 +49,7 @@ _pdm_a919b69078acdf0a_complete()
             ;;
 
             (export)
-            opts="--dev --editable-self --expandvars --format --global --group --help --lockfile --no-default --output --production --project --pyproject --quiet --self --verbose --without-hashes"
+            opts="--dev --editable-self --expandvars --format --global --group --help --lockfile --no-default --no-markers --output --production --project --pyproject --quiet --self --verbose --without-hashes"
             ;;
 
             (fix)
@@ -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)
@@ -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)
@@ -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)
diff --git a/src/pdm/cli/completions/pdm.fish b/src/pdm/cli/completions/pdm.fish
index d72f2d36..a1b44bc8 100644
--- a/src/pdm/cli/completions/pdm.fish
+++ b/src/pdm/cli/completions/pdm.fish
@@ -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'
@@ -122,6 +122,7 @@ complete -c pdm -A -n '__fish_seen_subcommand_from export' -l group -d 'Select g
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l help -d 'Show this help message and exit.'
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l lockfile -d 'Specify another lockfile path. Default: pdm.lock. [env var: PDM_LOCKFILE]'
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l no-default -d 'Don\'t include dependencies from the default group'
+complete -c pdm -A -n '__fish_seen_subcommand_from export' -l no-markers -d 'Don\'t include platform markers'
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l output -d 'Write output to the given file, or print to stdout if not given'
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l production -d 'Unselect dev dependencies'
 complete -c pdm -A -n '__fish_seen_subcommand_from export' -l project -d 'Specify another path as the project root, which changes the base of pyproject.toml and __pypackages__ [env var: PDM_PROJECT]'
@@ -187,6 +188,7 @@ 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.'
@@ -194,7 +196,6 @@ complete -c pdm -A -n '__fish_seen_subcommand_from install' -l lockfile -d 'Spec
 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'
@@ -308,13 +309,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]'
@@ -422,6 +423,7 @@ 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.'
@@ -429,7 +431,6 @@ complete -c pdm -A -n '__fish_seen_subcommand_from update' -l lockfile -d 'Speci
 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'
diff --git a/src/pdm/cli/completions/pdm.ps1 b/src/pdm/cli/completions/pdm.ps1
index d10e8479..038f0e27 100644
--- a/src/pdm/cli/completions/pdm.ps1
+++ b/src/pdm/cli/completions/pdm.ps1
@@ -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,
@@ -249,7 +249,7 @@ function TabExpansion($line, $lastWord) {
                 $completer.AddOpts(@(
                         [Option]::new(@(
                             "--dev", "--output", "--global", "--no-default", "--expandvars", "--prod", "--production", "-g", "-d", "-o",
-                            "--without-hashes", "-L", "--lockfile", "--self", "--editable-self"
+                            "--no-hashes", "--no-markers", "-L", "--lockfile", "--self", "--editable-self"
                         )),
                         $formatOption,
                         $sectionOption,
@@ -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"
                         )),
@@ -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,
@@ -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,
diff --git a/src/pdm/cli/completions/pdm.zsh b/src/pdm/cli/completions/pdm.zsh
index aceb3cff..b80658eb 100644
--- a/src/pdm/cli/completions/pdm.zsh
+++ b/src/pdm/cli/completions/pdm.zsh
@@ -43,7 +43,7 @@ _pdm() {
 
   _arguments -s -C -A '-*' \
     $arguments \
-    {-c,--config}'[Specify another config file path(env var: PDM_CONFIG_FILE)]' \
+    {-c,--config}'[Specify another config file path\[env var: PDM_CONFIG_FILE\]]' \
     {-V,--version}'[Show the version and exit]' \
     {-I,--ignore-python}'[Ignore the Python path saved in .pdm-python]' \
     '--pep582:Print the command line to be eval by the shell:shell:(zsh bash fish tcsh csh)' \
@@ -75,8 +75,8 @@ _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\]]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        "--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]'
         {--pre,--prerelease}'[Allow prereleases to be pinned]'
@@ -148,7 +148,8 @@ _pdm() {
       arguments+=(
         {-g,--global}'[Use the global project, supply the project root with `-p` option]'
         {-f+,--format+}"[Specify the export file format]:format:(pipfile poetry flit requirements setuppy)"
-        "--without-hashes[Don't include artifact hashes]"
+        "--no-hashes[Don't include artifact hashes]"
+        "--no-markers[Don't include platform markers]"
         "--expandvars[Expand environment variables in requirements]"
         "--self[Include the project itself]"
         "--editable-self[Include the project itself as an editable dependency]"
@@ -182,7 +183,7 @@ _pdm() {
         '--env[Show PEP 508 environment markers]'
         '--packages[Show the packages root]'
         '--json[Dump the information in JSON]'
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
       )
       ;;
     init)
@@ -207,7 +208,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]"
@@ -216,7 +217,7 @@ _pdm() {
         "--dry-run[Show the difference only without modifying the lock file content]"
         "--check[Check if the lock file is up to date and fail otherwise]"
         "--plugins[Install the plugins specified in pyproject.toml]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
       )
       ;;
     list)
@@ -233,7 +234,7 @@ _pdm() {
         "--include[Dependency groups to include in the output. By default all are included]:include:"
         "--exclude[Dependency groups to exclude from the output]:exclude:"
         "--resolve[Resolve all requirements to output licenses (instead of just showing those currently installed)]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
         '*:patterns:'
       )
       ;;
@@ -331,11 +332,11 @@ _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]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
         "*:packages:_pdm_packages"
       )
       ;;
@@ -346,7 +347,7 @@ _pdm() {
         '--json[Output all scripts infos in JSON]' \
         {-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]' \
         {-s,--site-packages}'[Load site-packages from the selected interpreter]' \
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:' \
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:' \
         '(-)1:command:->command' \
         '*:arguments: _normal ' && return 0
       if [[ $state == command ]]; then
@@ -370,7 +371,7 @@ _pdm() {
         '--license[Show license]'
         '--platform[Show platform]'
         '--keywords[Show keywords]'
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
         '1:package:'
       )
       ;;
@@ -391,7 +392,7 @@ _pdm() {
         '--no-editable[Install non-editable versions for all packages]'
         "--no-self[Don't install the project itself]"
         "--no-isolation[do not isolate the build in a clean environment]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
       )
       ;;
     update)
@@ -410,7 +411,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]'
@@ -422,7 +423,7 @@ _pdm() {
         "--outdated[Show the difference only without modifying the lockfile content]"
         {-x,--fail-fast}'[Abort on first installation error]'
         "--no-isolation[do not isolate the build in a clean environment]"
-        '--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
+        '--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
         "*:packages:_pdm_packages"
       )
       ;;
diff --git a/src/pdm/cli/options.py b/src/pdm/cli/options.py
index 2444d5bd..c6f518a6 100644
--- a/src/pdm/cli/options.py
+++ b/src/pdm/cli/options.py
@@ -12,7 +12,13 @@ if TYPE_CHECKING:
     from pdm.project import Project
 
     class ActionCallback(Protocol):
-        def __call__(self, project: Project, namespace: argparse.Namespace, values: str | Sequence[Any] | None) -> None:
+        def __call__(
+            self,
+            project: Project,
+            namespace: argparse.Namespace,
+            values: str | Sequence[Any] | None,
+            option_string: str | None = None,
+        ) -> None:
             ...
 
 
@@ -50,7 +56,7 @@ class CallbackAction(argparse.Action):
     ) -> None:
         if not hasattr(namespace, "callbacks"):
             namespace.callbacks = []
-        callback = partial(self.callback, values=values)
+        callback = partial(self.callback, values=values, option_string=option_string)
         namespace.callbacks.append(callback)
 
 
@@ -144,13 +150,30 @@ lockfile_option = Option(
 )
 
 
-@Option("--no-lock", nargs=0, help="Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]")
-def no_lock_option(project: Project, namespace: argparse.Namespace, values: str | Sequence[Any] | None) -> None:
+@Option(
+    "--frozen-lockfile",
+    "--no-lock",
+    nargs=0,
+    help="Don't try to create or update the lockfile. [env var: PDM_FROZEN_LOCKFILE]",
+)
+def frozen_lockfile_option(
+    project: Project,
+    namespace: argparse.Namespace,
+    values: str | Sequence[Any] | None,
+    option_string: str | None = None,
+) -> None:
+    if option_string == "--no-lock":
+        project.core.ui.warn("--no-lock is deprecated, use --frozen-lockfile instead.")
     project.enable_write_lockfile = False
 
 
 @Option("--pep582", const="AUTO", metavar="SHELL", nargs="?", help="Print the command line to be eval'd by the shell")
-def pep582_option(project: Project, namespace: argparse.Namespace, values: str | Sequence[Any] | None) -> None:
+def pep582_option(
+    project: Project,
+    namespace: argparse.Namespace,
+    values: str | Sequence[Any] | None,
+    option_string: str | None = None,
+) -> None:
     from pdm.cli.actions import print_pep582_command
 
     print_pep582_command(project, cast(str, values))
@@ -181,7 +204,12 @@ install_group.add_argument("--fail-fast", "-x", action="store_true", help="Abort
     help="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.",
 )
-def no_isolation_option(project: Project, namespace: argparse.Namespace, values: str | Sequence[Any] | None) -> None:
+def no_isolation_option(
+    project: Project,
+    namespace: argparse.Namespace,
+    values: str | Sequence[Any] | None,
+    option_string: str | None = None,
+) -> None:
     os.environ["PDM_BUILD_ISOLATION"] = "no"
 
 
@@ -341,7 +369,12 @@ packages_group.add_argument("packages", nargs="*", help="Specify packages")
     nargs=0,
     help="Ignore the Python path saved in .pdm-python. [env var: PDM_IGNORE_SAVED_PYTHON]",
 )
-def ignore_python_option(project: Project, namespace: argparse.Namespace, values: str | Sequence[Any] | None) -> None:
+def ignore_python_option(
+    project: Project,
+    namespace: argparse.Namespace,
+    values: str | Sequence[Any] | None,
+    option_string: str | None = None,
+) -> None:
     os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"})
 
 
diff --git a/src/pdm/project/core.py b/src/pdm/project/core.py
index ebb5a858..7e2e5222 100644
--- a/src/pdm/project/core.py
+++ b/src/pdm/project/core.py
@@ -99,7 +99,10 @@ class Project:
 
         self.root: Path = Path(root_path or "").absolute()
         self.is_global = is_global
-        self.enable_write_lockfile = os.getenv("PDM_NO_LOCK", "0").lower() not in ("1", "true")
+        self.enable_write_lockfile = os.getenv("PDM_FROZEN_LOCKFILE", os.getenv("PDM_NO_LOCK", "0")).lower() not in (
+            "1",
+            "true",
+        )
         self.init_global_project()
 
     def __repr__(self) -> str:


Test patch:
diff --git a/tests/cli/test_add.py b/tests/cli/test_add.py
index 8af7db55..0b2c0c4f 100644
--- a/tests/cli/test_add.py
+++ b/tests/cli/test_add.py
@@ -26,7 +26,7 @@ def test_add_package(project, working_set, dev_option, pdm):
 
 
 def test_add_package_no_lock(project, working_set, dev_option, pdm):
-    pdm(["add", *dev_option, "--no-lock", "-v", "requests"], obj=project, strict=True)
+    pdm(["add", *dev_option, "--frozen-lockfile", "-v", "requests"], obj=project, strict=True)
     group = (
         project.pyproject.settings["dev-dependencies"]["dev"]
         if dev_option
diff --git a/tests/cli/test_install.py b/tests/cli/test_install.py
index 7fc0751e..b1b50c6f 100644
--- a/tests/cli/test_install.py
+++ b/tests/cli/test_install.py
@@ -168,13 +168,23 @@ def test_install_with_dry_run(project, pdm, repository):
     assert "pytz 2019.3" in result.output
 
 
-def test_install_no_lock(project, pdm, working_set):
+def test_install_frozen_lockfile(project, pdm, working_set):
+    project.add_dependencies({"requests": parse_requirement("requests")}, "default")
+    result = pdm(["install", "--frozen-lockfile"], obj=project)
+    assert result.exit_code == 0
+    assert not project.lockfile.exists()
+    assert "urllib3" in working_set
+    assert "requests" in working_set
+
+
+def test_install_no_lock_deprecated(project, pdm, working_set):
     project.add_dependencies({"requests": parse_requirement("requests")}, "default")
     result = pdm(["install", "--no-lock"], obj=project)
     assert result.exit_code == 0
     assert not project.lockfile.exists()
     assert "urllib3" in working_set
     assert "requests" in working_set
+    assert "WARNING: --no-lock is deprecated" in result.stderr
 
 
 def test_install_check(pdm, project, repository):
diff --git a/tests/cli/test_others.py b/tests/cli/test_others.py
index 5593c71d..90541ce0 100644
--- a/tests/cli/test_others.py
+++ b/tests/cli/test_others.py
@@ -183,7 +183,7 @@ def test_export_to_requirements_txt(pdm, fixture_project):
     assert result.exit_code == 0
     assert "-e .  # this package\n" in result.output.strip()
 
-    result = pdm(["export", "--without-hashes"], obj=project)
+    result = pdm(["export", "--no-hashes"], obj=project)
     assert result.exit_code == 0
     assert result.output.strip() == requirements_no_hashes.read_text().strip()
 
@@ -222,3 +222,13 @@ def test_show_update_hint(pdm, project, monkeypatch):
         project.core.version = prev_version
     assert "to upgrade." in r.stderr
     assert "Run `pdm config check_update false` to disable the check." in r.stderr
+
+
+@pytest.mark.usefixtures("repository")
+def test_export_with_platform_markers(pdm, project):
+    pdm(["add", "--no-sync", 'urllib3; sys_platform == "fake"'], obj=project, strict=True)
+    result = pdm(["export"], obj=project, strict=True)
+    assert 'urllib3==1.22; sys_platform == "fake"' in result.output.splitlines()
+
+    result = pdm(["export", "--no-markers"], obj=project, strict=True)
+    assert not any("urllib3" in line for line in result.output.splitlines())
diff --git a/tests/cli/test_remove.py b/tests/cli/test_remove.py
index d34190e0..99ca22d4 100644
--- a/tests/cli/test_remove.py
+++ b/tests/cli/test_remove.py
@@ -34,7 +34,7 @@ def test_remove_package(project, working_set, dev_option, pdm):
 
 def test_remove_package_no_lock(project, working_set, dev_option, pdm):
     pdm(["add", *dev_option, "requests", "pytz"], obj=project, strict=True)
-    pdm(["remove", *dev_option, "--no-lock", "pytz"], obj=project, strict=True)
+    pdm(["remove", *dev_option, "--frozen-lockfile", "pytz"], obj=project, strict=True)
     assert "pytz" not in working_set
     project.lockfile.reload()
     locked_candidates = project.locked_repository.all_candidates
diff --git a/tests/cli/test_update.py b/tests/cli/test_update.py
index 892916ae..e2ae72d7 100644
--- a/tests/cli/test_update.py
+++ b/tests/cli/test_update.py
@@ -64,7 +64,7 @@ def test_update_all_packages(project, repository, pdm, strategy):
 def test_update_no_lock(project, working_set, repository, pdm):
     pdm(["add", "pytz"], obj=project, strict=True)
     repository.add_candidate("pytz", "2019.6")
-    pdm(["update", "--no-lock"], obj=project, strict=True)
+    pdm(["update", "--frozen-lockfile"], obj=project, strict=True)
     assert working_set["pytz"].version == "2019.6"
     project.lockfile.reload()
     assert project.locked_repository.all_candidates["pytz"].version == "2019.3"