Exclude external library with setuptools

Viewed 42

I'm trying to exclude a specific library from being installed whenever users install my package via pip while not on macOS

Here's my logic:

if platform.system() == "Darwin":
    install_packages = setuptools.find_packages()
else:
    install_packages = setuptools.find_packages(exclude=["appscript==1.2.0"])

Then in setuptools.setup I use: packages=install_packages

This doesn't seem to work..

Building wheels for collected packages: appscript
  Building wheel for appscript (setup.py) ... error

How do I exclude this package from my setup? I'm new to this, so I'm sure I missed something.

Thanks!

1 Answers

If anyone else stumbles upon this looking for an easy fix, here's what I did

from pip._internal import main as pip

if platform.system() == "Darwin":
    pip(['install', '--user', 'appscript==1.2.0'])

Windows still throws an error when doing a pip install, but if I run it a second time it installed it just fine without any issues.

Related