Allow use of unsupported python version for testing
Is your feature request related to a problem? Please describe.
In preparation for the Python 3.11 release, I would like to test my Python packages against the pre-release version of Python 3.11, to help identify any forward compat issues before we start to officially support it. To do this, I created a job in CI that's allowed to fail that tries running tests against Python 3.11
To do so, my CI runs in a python3.11-rc container, and I set up a .venv using Python 3.11, and run pdm sync to install packages to test. However, PDM checks the supported Python version range, and decides to delete and re-create the venv using Python 3.9 (which is also installed on the system) because of the lack of compatibility.
$ if [ -f pdm.lock ]; then pdm sync --no-editable -v; else pip install .; fi
python.use_venv is on, creating a virtualenv for this project...
Cleaning existing target directory /tmp/builds/5LUxAmoA/0/software/beta-sensors/.venv
Run command: ['/usr/local/bin/python', '-m', 'virtualenv', '--no-pip', '--no-setuptools', '--no-wheel', '/tmp/builds/5LUxAmoA/0/software/beta-sensors/.venv', '-p', '/usr/bin/python3.9']
created virtual environment CPython3.9.2.final.0-64 in 153ms
creator CPython3Posix(dest=/tmp/builds/5LUxAmoA/0/software/beta-sensors/.venv, clear=False, no_vcs_ignore=False, global=False)
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Virtualenv is created successfully at /tmp/builds/5LUxAmoA/0/software/beta-sensors/.venv
Describe the solution you'd like
I would like to have a way for PDM commands like pdm sync or pdm use to have an option to ignore the Python version range, so I can start testing against new versions before they are officially released, and before I have updated all of the dependencies to include Python 3.11 in the supported version range. For instance, pdm use --ignore-requires-python or pdm config ignore_requires_python true.
why not updating the requires-python range, what is the value by the way?
why not updating the requires-python range, what is the value by the way?
Because I'm running this in CI against dozens of packages maintained by different people at my company, in order to learn about what compatibility issues might exist. Adding a flag or pdm config call to the CI script would be simpler than adding a script to update the pyproject.toml.
Because I'm running this in CI against dozens of packages maintained by different people at my company, in order to learn about what compatibility issues might exist
I can't get the point, you can also modify the pyproject.toml in a temporary branch, add Python 3.11 to the matrix and run CI against it. What prevents you from doing this? When all tests pass you merge the branch so the python constraint for the whole project can be loosen to allow python 3.11.