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

pdm lock --check on a lockfile generated with older PDM version has a 0 exit code when there's a change in pyproject.toml #3199

Closed
1 task done
chandrasekharan98 opened this issue Oct 4, 2024 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@chandrasekharan98
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

  1. Generate a lock file with an older version of PDM - it should generate a different lock file version (for eg: 4.4.1 got generated with PDM version 2.12.3)
  2. Now make any change in pyproject.toml
  3. Run this snippet to check if lockfile changes are necessary
if pdm lock --check; then
    echo "No changes required for pdm.lock in $pwd."
else
    echo "Lock file needs to be generated"
fi

Actual behavior

  • Used PDM version 2.12.3 to generate a lock file versioned at 4.4.1
  • Newer PDM versions such as 2.16.1 generate a lock file versioned at 4.4.2
  • In case of running pdm lock --check after making pyproject.toml changes, it only throws the below warning but the exit code is 0
    WARNING: Lockfile is generated on an older version of PDM

image

Expected behavior

  • This is not noticed if the lockfile versions are the same, i.e. if the lock file is generated with PDM version 2.16.1 for a lock_version of 4.4.2 and then we update the pyproject.toml - the exit code is 1 for the above snippet
    image

Environment Information

(unstract-3.9) *[dont-merge/testing-pdm-lock-automation][~/zipstuff/unstract]$ pdm info && pdm info --env                                                                         [11:48:21] 
PDM version:
  3.16.1
Python Interpreter:
  /home/chandru/zipstuff/unstract/.venv/bin/python (3.9)
Project Root:
  /home/chandru/zipstuff/unstract
Local Packages:
  
INFO: PDM 2.16.1 is installed, while 2.19.1 is available.
Please run `pdm self update` to upgrade.
Run `pdm config check_update false` to disable the check.
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.6",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.2.6-76060206-generic",
  "platform_system": "Linux",
  "platform_version": "#202303130630~1689015125~22.04~ab2190e SMP PREEMPT_DYNAMIC Mon J",
  "python_full_version": "3.9.6",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
INFO: PDM 2.16.1 is installed, while 2.19.1 is available.
Please run `pdm self update` to upgrade.
Run `pdm config check_update false` to disable the check.

NOTE: More context can be obtained from this Github action run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant