diff --git a/news/3182.bugfix.md b/news/3182.bugfix.md new file mode 100644 index 0000000000..284582bfd8 --- /dev/null +++ b/news/3182.bugfix.md @@ -0,0 +1 @@ +Fix a bug that overrides provided by environment variables do not work. diff --git a/src/pdm/cli/options.py b/src/pdm/cli/options.py index 56a8bee74e..87c137d8d3 100644 --- a/src/pdm/cli/options.py +++ b/src/pdm/cli/options.py @@ -513,7 +513,7 @@ def non_interactive_option( override_option = Option( "--override", - default=os.getenv("PDM_OVERRIDE"), + default=[env] if (env := os.getenv("PDM_OVERRIDE")) else None, action="append", help="Use the constraint file in pip-requirements format for overriding. [env var: PDM_OVERRIDE] " "This option can be used multiple times. "