tox-dev/platformdirs

platformdirs 3.0.0 pulls virtualenv down to very old version (20.4.7)

Closed this issue · 2 comments

With this Poetry (tested with Poetry 1.3.2 on Python 3.10) project:

[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10, <3.12"

[tool.poetry.group.dev.dependencies]
virtualenv = "*"

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

Running poetry update and pip list shows that the latest virtualenv is installed:

pip list
Package      Version
------------ -------
distlib      0.3.6
filelock     3.9.0
pip          22.3.1
platformdirs 2.6.2
setuptools   65.6.3
virtualenv   20.18.0
wheel        0.38.4

But adding platformdirs pulls virtualenv down to a very old version:

[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10, <3.12"

[tool.poetry.group.dev.dependencies]
virtualenv = "*"
platformdirs = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Package      Version
------------ -------
appdirs      1.4.4
distlib      0.3.6
filelock     3.9.0
pip          22.3.1
platformdirs 3.0.0
setuptools   65.6.3
six          1.16.0
virtualenv   20.4.7
wheel        0.38.4

The release of platformdirs 3.0.0 seems to have broken our environments the next time we tried to bump up our lockfile versions.

virtualenv 20.4.7 is almost two years old and causes issues in our environments such as:

$ python -m virtualenv venv
...
setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
KeyError: 'scripts'

Setting the dependency to platformdirs = "<3" in pyproject.toml is a temporary work around.

Looking at this more closely, this might be due to the fact that virtualenv has a max limit on platformdirs:

I would guess that Poetry tries to update platformdirs and then has to trace backwards to find a virtualenv where there wasn't an upper bound on platformdirs 🤔 .

This looks to be this upstream issue: