Poetry ignores platform constraint when using local path
See original GitHub issue- 18.04.2 Ubuntu 5.0.0-32-generic:
- Poetry version 1.0.10:
- **Link to toml https://gist.github.com/M-J-Murray/7c3d538db07413614d9ff6f04ce28b57**:
Issue
Hello, I’m attempting to setup poetry such that a couple of local libraries are only installed when using windows. However, the platform argument is failing in two ways. When I use platform and path arguments on ubuntu, like so:
gdal = {platform = "windows", path = "thirdparty/GDAL-3.1.2-cp37-cp37m-win32.whl"}
Even though I am not on windows, poetry keeps trying to install the library and failing because the install will only work on windows. As a workarounds I have tried:
gdal = {markers = "sys_platform == 'windows'", path = "thirdparty/GDAL-3.1.2-cp37-cp37m-win32.whl"}
gdal = {markers = "sys_platform != 'windows'", path = "thirdparty/GDAL-3.1.2-cp37-cp37m-win32.whl"}
gdal = {markers = "sys_platform == 'windows' and sys_platform != 'linux'", path = "thirdparty/GDAL-3.1.2-cp37-cp37m-win32.whl"}
But it keeps ignoring my platform requirement. I have a feeling the problem comes from the combination of path and platform markers.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Defining metadata (meta.yaml) - Conda
Instead, Windows follows DLL search path rules or more natively supports relocatability using relative paths. Because of this, conda ignores most prefixes.
Read more >Configuration Options - Renovate Docs
Older Composer versions will be run with --ignore-platform-reqs , which means that all platform constraints (including the PHP version) will be ignored by ......
Read more >Repositories | Documentation | Poetry - Python dependency ...
Poetry treats repositories to which you publish packages as user specific and not project specific configuration unlike package sources. Poetry, today, only ...
Read more >How can I specify dependencies on operating system in ...
Poetry will then ignore yourpackage when poetry install is used on other platforms, but not give any errors. If it is a hard...
Read more >Ask HN: Why Poetry did not become a mainstream package ...
If I install something with pip, the newly installed package goes into ... keep your venv folder separate from the project, add platform...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@billfreeman44 your issue is different – this issue is specifically for path dependencies, not URL dependencies. That being said, the following works as expected on every platform for me – I suspect your markers are just slightly off:
If you need more help or advice, please start a Discussion, join Discord, or create a detailed issue report if you think there may be a bug.
Thanks for the analysis @dimbleby – we’ve solved the original issue and the issue that I replied to. Your conclusions track for me and answer the version @espdev commented on. Closing as resolved/tracking @espdev’s version in #6710.