Setuptools platform specific dependencies

前端 未结 4 1113
悲哀的现实
悲哀的现实 2021-02-08 03:40

Is there any way to tell setuptools or distribute to require a package on a specific platform?

In my specific case, I\'m using readline, which comes as par

4条回答
  •  [愿得一人]
    2021-02-08 04:09

    from setuptools import setup
    
    
    setup(
        install_requires=(['pymsgbox', 'PyTweening>=1.0.1', 'Pillow', 'pyscreeze']
                        + ["python3-xlib; sys_platform == linux"]
                        + ["python-xlib; sys_platform == linux2"]
                        + ["pyobjc-core; sys_platform == darwin"]
                        + ["pyobjc; sys_platform == darwing"]
                        ),
    )
    

    This will install speicific versions of libraries depending on whether its linux2 (for a linux system using python2), linux (for a linux system using python3), darwin (for a MacOS system)

提交回复
热议问题