PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 26, 2022

[FIXED] How to deal with the "platform specific dynamic library" problem with uploading to PyPI?

 September 26, 2022     binaries, dynamic-library, language-interoperability, pypi, python     No comments   

Issue

I have a Python package that depends on binaries. I've build the linux version and it is available on PyPI. The key was setting the package_data argument to ensure the *.so files were also uploaded to PyPI.

Now I want to do the same thing with Windows, which obviously require *.dll dependencies, rather than *.so. When uploading my package to PyPI, is it possible to upload *.so files for when a user downloads my package on a linux platform and *.dll files for when a user is on windows. The issue I'm foreseeing is that if I have to upload all binaries for all platforms, my package will quickly exceed the size limit for PyPI.


Solution

This is what compatibility tags for built distributions are for.

For example, consider https://pypi.org/project/numpy/#files. It publishes the following wheels:

  • numpy-1.18.5-cp38-cp38-macosx_10_9_x86_64.whl
  • numpy-1.18.5-cp38-cp38-manylinux1_i686.whl
  • numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl
  • numpy-1.18.5-cp38-cp38-win32.whl
  • numpy-1.18.5-cp38-cp38-win_amd64.whl

Each of these contain the platform-specific dependencies for the given platform.



Answered By - Dustin Ingram
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing