rackspace / runway

Simplify infrastructure/app deployment.

Home Page:https://runway.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Install via poetry fails for recent Runway releases

jake-skipper opened this issue · comments

Bug Description

Setting up a simple poetry config to install Runway no longer works using default python pinning that poetry generates. For instance, running poetry init in a clean directory:

vscode ➜ /workspaces/test (master) $ poetry init

This command will guide you through creating your pyproject.toml config.

Package name [test]:  
Version [0.1.0]:  
Description []:  
Author [Jake Skipper <jake.skipper@rackspace.com>, n to skip]:  n
License []:  
Compatible Python versions [^3.10]:  

Would you like to define your main dependencies interactively? (yes/no) [yes] 
You can specify a package in the following forms:
  - A single name (requests): this will search for matches on PyPI
  - A name and a constraint (requests@^2.23.0)
  - A git url (git+https://github.com/python-poetry/poetry.git)
  - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)
  - A file path (../my-package/my-package.whl)
  - A directory (../my-package/)
  - A url (https://example.com/packages/my-package-0.1.0.tar.gz)

Package to add or search for (leave blank to skip): runway
Found 18 packages matching runway
Showing the first 10 matches

Enter package # to add, or the complete package name if it is not listed []:
 [ 0] runway
 [ 1] runway-python
 [ 2] metar-taf-parser-mivek
 [ 3] walkway
 [ 4] python-metar
 [ 5] metar
 [ 6] WarThunder
 [ 7] HaversineAPI
 [ 8] xplane-airports
 [ 9] voiceAtis
 [ 10] 
 > 0
Enter the version constraint to require (or leave blank to use the latest version): 
Using version ^2.6.6 for runway

Add a package (leave blank to skip): 

Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
runway = "^2.6.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


Do you confirm generation? (yes/no) [yes] 

As stated in the above output, the pyproject.toml generated is:

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
runway = "^2.6.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

When running poetry install after, you will receive the following error:

vscode ➜ /workspaces/test (master ✗) $ poetry install
Creating virtualenv test-dXw9hffu-py3.10 in /home/vscode/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.1s)

The current project's Python requirement (>=3.10,<4.0) is not compatible with some of the required packages Python requirement:
  - runway requires Python >=3.8,<3.12, so it will not be satisfied for Python >=3.12,<4.0

Because no versions of runway match >2.6.6,<3.0.0
 and runway (2.6.6) requires Python >=3.8,<3.12, runway is forbidden.
So, because test depends on runway (^2.6.6), version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For runway, a possible solution would be to set the `python` property to ">=3.10,<3.12"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

The work around provided in the error of using python = ">=3.10,<3.12" does work; however, this is a bit of a hassle and may cause issues when Poetry needs to provide constraints for other installed packages as well.

Do we want to limit Runway to running on 3.12 and below?

Expected Behavior

Ideally the steps taken in poetry init should quickly generate a working poetry install.

Steps To Reproduce

Defined in the bug description.

Runway version

2.6.6

Installation Type

pypi (pip, pipenv, poetry, etc)

OS / Environment

Ubuntu 22.04 ARM via VSCode Dev Container

Anything else?

No response