Created
June 8, 2019 15:42
-
-
Save kujyp/6b811d755d4cb05ad80d6006447d3dcb to your computer and use it in GitHub Desktop.
setup.py checking prerequisite example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from setuptools import setup, find_packages | |
from mtml.about import __version__, __description__ | |
try: | |
import CPLEX | |
except ImportError as e: | |
raise EnvironmentError("""You must install CPLEX manually first. | |
https://www.google.com/aclk?sa=l&ai=DChcSEwiW64S6nNriAhUStpYKHWwyCUAYABAAGgJ0bA&sig=AOD64_3Omi880wx8P-AGPbCVFVAHi2GIcg&q=&ved=2ahUKEwi-qf25nNriAhWIw4sBHaJPCtMQ0Qx6BAgXEAE&adurl= | |
""") | |
def requirements(): | |
reqfile = 'requirements.txt' | |
with open(os.path.join(os.path.dirname(__file__), reqfile)) as f: | |
return f.read().splitlines() | |
setup(name='mtml', | |
version=__version__, | |
description=__description__, | |
packages=find_packages(exclude=[]), | |
entry_points=''' | |
[console_scripts] | |
mtml = mtml.cli:main | |
''', | |
include_package_data=True, | |
install_requires=requirements()) |
Author
kujyp
commented
Jun 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment