Installing package from different sources depending on sys_platform
See original GitHub issueI am trying to achieve the following in a Pipefile. Notice the double bsddb3:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
bsddb3 = {version = "==6.2.6", sys_platform = "!= 'win32'"}
bsddb3 = {file = "https://download.lfd.uci.edu/pythonlibs/l8ulg3xw/bsddb3-6.2.6-cp36-cp36m-win_amd64.whl", sys_platform = "== 'win32'", platform_machine = "== 'AMD64'"}
[requires]
python_version = "3.6"
The problem with this is that I get an exception saying Duplicate keys found
bsddb3 requires installation like the above for the Windows platform. But for my Linux users they should still just install the normal bsddb3. How would I achieve this, as the above clearly does not work?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Picking wrong platform installing a dependency with multiple ...
I am encountering the same behavior using multiple constraints for a package using git and path dependencies based on platform. The poetry ...
Read more >Is it possible to express a platform-specific dependency in ...
This will allow a project to work on multiple different platforms without installing dependencies that are not required for a platform that ...
Read more >Can `extras_require` values be OS dependant?
Building a wheel is done by compiling from source. If you mean installing from source, then yes, setup.py install is separate from setup.py ......
Read more >Install and manage packages in Visual Studio using the ...
Prerequisites; Find and install a package; Uninstall a package; Update a package; Manage packages for the solution; Package sources ...
Read more >Packaging Guide — Spack 0.20.0.dev0 documentation
depends_on tells Spack that other packages need to be built and installed before this one. See Dependencies. Get the installation working. Your new...
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 FreeTop 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
Top GitHub Comments
Duplicate of #2171 for anyone who is still looking
It is not likely to be supported as-is, since TOML (Pipfile’s format) does not allow duplicated key entries. It is doable with a spec change in Pipfile, but you’ll need to go through the PEEP process for that.
The most difficult part (IMO) would be to come up with a reasonable syntax to describe this in both Pipfile and Pipfile.lock. Secondly, downloading from different sources based on platform is not really supported in Python in general, so you’d need to jump through quite some hoops to implement it.
Reading again what you want to achieve, however, I think this might actually be the wrong solution to it. The better approach is to run a private package index server to serve this package, instead of using PyPI. There are a few tools (e.g. devpi, pypiserver) allowing you to do this. You can serve bsddb3 on it, and specify this in Pipfile:
This would allow the package to be installed using your index server instead, and you can provide suitable wheels for platforms you want to support.