poetry: `requires-plugins` breaks poetry installation on Windows
Description
I have a poetry project, which I install and test on Windows machine in GitHub Actions.
Recently, I tried using the new requires-plugins feature for poethepoet and poetry-plugin-export plugins installation.
The pyproject.toml file looks somewhat like this:
...
[tool.poetry.requires-plugins]
poethepoet = "^0.32.1"
poetry-plugin-export = "^1.9.0"
...
However, instead of expected installation, what I receive is an error:
Ensuring that the Poetry plugins required by the project are available...
The following Poetry plugins are required by the project but are not installed in Poetry's environment:
- poethepoet (>=0.32.1,<0.33.0)
- poetry-plugin-export (>=1.9.0,<2.0.0)
Installing Poetry plugins only for the current project...
Updating dependencies
Resolving dependencies...
Package operations: 4 installs, 0 updates, 0 removals
- Installing pastel (0.2.1)
- Installing pyyaml (6.0.2)
- Installing poethepoet (0.32.1)
- Installing poetry-plugin-export (1.9.0)
ValueError
path is on mount 'C:', start on mount 'D:'
at C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\ntpath.py:747 in relpath
743| path_abs = abspath(normpath(path))
744| start_drive, start_rest = splitdrive(start_abs)
745| path_drive, path_rest = splitdrive(path_abs)
746| if normcase(start_drive) != normcase(path_drive):
> 747| raise ValueError("path is on mount %r, start on mount %r" % (
748| path_drive, start_drive))
749|
750| start_list = [x for x in start_rest.split(sep) if x]
751| path_list = [x for x in path_rest.split(sep) if x]
Cannot install poethepoet.
Failed to install required Poetry plugins
Workarounds
The plugins still can be installed traditionally, using poetry self add ....
However, I still would like to try the new feature… it works on Linux so nice!
Poetry Installation Method
pip
Operating System
windiws-latest (that is Windows Server 2022 OS Version: 10.0.20348 Build 2966)
Poetry Version
Poetry (version 2.0.1)
Poetry Configuration
cache-dir = "C:\\Users\\runneradmin\\AppData\\Local\\pypoetry\\Cache"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}\\virtualenvs" # C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false
Python Sysconfig
sysconfig.log
Platform: “win-amd64” Python version: “3.10” Current installation scheme: “nt” Paths: data = “C:\hostedtoolcache\windows\Python\3.10.11\x64” include = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Include” platinclude = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Include” platlib = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib\site-packages” platstdlib = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib” purelib = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib\site-packages” scripts = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Scripts” stdlib = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib” Variables: BINDIR = “C:\hostedtoolcache\windows\Python\3.10.11\x64” BINLIBDEST = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib” EXE = “.exe” EXT_SUFFIX = “.cp310-win_amd64.pyd” INCLUDEPY = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Include” LIBDEST = “C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib” SO = “.cp310-win_amd64.pyd” TZPATH = “” VERSION = “310” abiflags = “” base = “C:\hostedtoolcache\windows\Python\3.10.11\x64” exec_prefix = “C:\hostedtoolcache\windows\Python\3.10.11\x64” installed_base = “C:\hostedtoolcache\windows\Python\3.10.11\x64” installed_platbase = “C:\hostedtoolcache\windows\Python\3.10.11\x64” platbase = “C:\hostedtoolcache\windows\Python\3.10.11\x64” platlibdir = “lib” prefix = “C:\hostedtoolcache\windows\Python\3.10.11\x64” projectbase = “C:\hostedtoolcache\windows\Python\3.10.11\x64” py_version = “3.10.11” py_version_nodot = “310” py_version_nodot_plat = “310” py_version_short = “3.10” srcdir = “C:\hostedtoolcache\windows\Python\3.10.11\x64” userbase = “C:\Users\runneradmin\AppData\Roaming\Python”
Paste the output of 'python -m sysconfig', over this line.
Example pyproject.toml
[tool.poetry.requires-plugins]
poethepoet = "^0.32.1"
poetry-plugin-export = "^1.9.0"
Poetry Runtime Logs
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 9
- Comments: 18 (6 by maintainers)
Commits related to this issue
- workaround: try adding poetry-dynamic-versioning as dev dependency https://github.com/python-poetry/poetry/issues/10028 — committed to intercreate/smpmgr by JPHutchins 2 years ago
- workaround: try installing poetry-dynamic-version globally https://github.com/python-poetry/poetry/issues/10028 — committed to intercreate/smpmgr by JPHutchins 2 years ago
- workaround: try installing poetry-dynamic-version globally https://github.com/python-poetry/poetry/issues/10028 — committed to intercreate/smpmgr by JPHutchins 2 years ago
- workaround: try installing poetry-dynamic-version globally https://github.com/python-poetry/poetry/issues/10028 — committed to intercreate/smpmgr by JPHutchins 2 years ago
- Workaround issue with poetry.requires-plugin https://github.com/python-poetry/poetry/issues/10028 — committed to RumovZ/usdb_syncer by RumovZ 2 years ago
- Workaround issue with poetry.requires-plugin https://github.com/python-poetry/poetry/issues/10028 — committed to RumovZ/usdb_syncer by RumovZ 2 years ago
- Add workarouund for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Add workarouund for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Add workarouund for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Add workarouund for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Add workaround for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Add workaround for https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Workaround for poetry issue https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
- Workaround for poetry issue https://github.com/python-poetry/poetry/issues/10028 — committed to fcole90/python-poetry-starter by fcole90 2 years ago
Well that worked. Thank you! But it makes me kind of sad, because proper management of plugin dependencies is one of the improvements in Poetry 2.x that I was excited about.
I hope that the poetry team is able to prioritize a fix for this.
Thanks again for your help, Aaron
We are having the same problem with our Windows runners on Github Actions while attempting to upgrade to Poetry 2.x.
The plugin we are trying to use is poetry-dynamic-versioning. We’re using the latest version of poetry (2.1.1) and poetry-dynamic-versioning (1.7.1). We have two different configurations, running python 3.9 and 3.12 respectively. Same error in each case.
Same error message that others have reported:
Please advise - what is the officially suggested solution / workaround? It is not clear to me from the thread on this ticket. This is blocking our migration to Poetry 2.x.
Thank you! Aaron
In the past several other projects hit the issue as well, which was solved, e.g. here https://github.com/Lightning-AI/pytorch-lightning/pull/16164/files, by special-casing os.relpath on windows.
Here’s a full stack trace from a recent GA run on windows:
I face the same problems on GitHub Actions workflow (where I don’t fully control the environment).
I tried to add
poetry-dynamic-versioningplugin:My error is basically the same:
Workflow definition: https://github.com/scikit-fingerprints/scikit-fingerprints/blob/eaa1499a12db49e128808f920df61d8004ef396e/.github/workflows/python-publish.yml.
Full stacktrace with
-vvvoption: https://github.com/scikit-fingerprints/scikit-fingerprints/actions/runs/12743574960/job/35513793864?pr=346