pdm-project / pdm

A modern Python package and dependency manager supporting the latest PEP standards
https://pdm-project.org
MIT License
7.92k stars 398 forks source link

install-pdm.py doesn't install post-release version if version isn't specified #3246

Open mee7ya opened 5 hours ago

mee7ya commented 5 hours ago

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

Run the installation script as in README without specifying version curl -sSL https://pdm-project.org/install-pdm.py | python3 -

Actual behavior

Installs 2.19.3

Expected behavior

Installs 2.20.0.post1

Environment Information

PDM version:
  2.19.3
Python Interpreter:
  /home/meetya/python-projects/apache-airflow-providers-mattermost/.venv/bin/python (3.12)
Project Root:
  /home/meetya/python-projects/apache-airflow-providers-mattermost
Local Packages:

INFO: PDM 2.19.3 is installed, while 2.20.0 is available.
Please run `pdm self update` to upgrade.
Run `pdm config check_update false` to disable the check.
mee7ya commented 5 hours ago

This is due to version_okay() unable to handle any non-digit characters in version literal

Also, probably shouldn't offer 2.20.0 in pdm info since it has been yanked

mee7ya commented 4 hours ago

I've made a small fix for version_okay() to include post-releases with regex. If you're okay with it, I can submit PR

20048e1ad780ea503763884bd2ff7ed00ed1c109