python-poetry/poetry

Can no longer install poetry 1.5.1 with python 3.9.X

ffineis opened this issue · 3 comments

Description

We can no longer install poetry version 1.5.1 while using python 3.9.X. Was Python 3.9 support dropped from a prior version?

I have a github action that installs python, uses abatilo/actions-poetry to fetch poetry, and then runs poetry install.

    - name: Install Python
      uses: actions/setup-python@v4
      with:
        python-version: ${{ inputs.python_version }}
    - name: Install Poetry
      uses: abatilo/actions-poetry@v2.1.3
      with:
        poetry-version: 1.5.1
    - name: Poetry Install
      shell: bash
      run: |
        export GHA_PATH="${{ github.action_path }}"
        echo "GHA_PATH: $GHA_PATH"
        poetry config virtualenvs.create false
        echo "Installed poetry version $(poetry --version)... python version $(python --version)"
        poetry -vvv install --directory $GHA_PATH 
        export PATH="/root/.local/bin:$PATH"

As of 11/4/24 this was working fine; poetry 1.5.1 seemed to support python 3.9.20 just fine. As of 11/5, I'm now getting

The currently activated Python version 3.9.19 is not supported by the project (^3.10).
Trying to find and use a compatible version. 
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

Any idea what happened? 3.9 should still be supported - it's not EOL afaik.

Workarounds

Not yet

Poetry Installation Method

other

Operating System

linux/amd64

Poetry Version

1.5.1

Poetry Configuration

poetry config --list: cache-dir = "/home/runner/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
virtualenvs.create = false
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/runner/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

export GHA_PATH="${{ github.action_path }}"
echo "GHA_PATH: $GHA_PATH"
poetry config virtualenvs.create false
poetry -vvv install --directory $GHA_PATH
GHA_PATH: /runner/_work/cc-python/cc-python/./.github/actions/prefect2-deployment
Loading configuration file /home/runner/.config/pypoetry/config.toml
The currently activated Python version 3.9.20 is not supported by the project (^3.10).
Trying to find and use a compatible version. 
Trying python3
Trying python3.11
Trying python3.10

  Stack trace:

  8  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/application.py:327 in run
      325│ 
      326│             try:
    → 327│                 exit_code = self._run(io)
      328│             except BrokenPipeError:
      329│                 # If we are piped to another process, it may close early and send a

  7  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/poetry/console/application.py:190 in _run
      188│         self._load_plugins(io)
      189│ 
    → 190│         exit_code: int = super()._run(io)
      191│         return exit_code
      192│ 

  6  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/application.py:431 in _run
      429│             io.input.interactive(interactive)
      430│ 
    → 431│         exit_code = self._run_command(command, io)
      432│         self._running_command = None
      433│ 

  5  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/application.py:473 in _run_command
      471│ 
      472│         if error is not None:
    → 473│             raise error
      474│ 
      475│         return terminate_event.exit_code

  4  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/application.py:454 in _run_command
      452│ 
      453│         try:
    → 454│             self._event_dispatcher.dispatch(command_event, COMMAND)
      455│ 
      456│             if command_event.command_should_run():

  3  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/events/event_dispatcher.py:26 in dispatch
       24│ 
       25│         if listeners:
    →  26│             self._do_dispatch(listeners, event_name, event)
       27│ 
       28│         return event

  2  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/cleo/events/event_dispatcher.py:85 in _do_dispatch
       83│                 break
       84│ 
    →  85│             listener(event, event_name, self)
       86│ 
       87│     def _sort_listeners(self, event_name: str) -> None:

  1  /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/poetry/console/application.py:299 in configure_env
      297│ 
      298│         env_manager = EnvManager(poetry, io=io)
    → 299│         env = env_manager.create_venv()
      300│ 
      301│         if env.is_venv() and io.is_verbose():

  NoCompatiblePythonVersionFound

  Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

  at /opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/poetry/utils/env.py:981 in create_venv
       977│                     python_minor = ".".join(python_patch.split(".")[:2])
       978│                     break
       979│ 
       980│             if not executable:
    →  981│                 raise NoCompatiblePythonVersionFound(
       982│                     self._poetry.package.python_versions
       983│                 )
       984│ 
       985│         if in_project_venv:

poetry has installed just fine, it is your own project that has dropped support for python 3.9 by providing the ^3.10 requirement

😞 - wow, thank you @dimbleby, totally right. My bad! thanks for the insight

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.