|
1 | 1 | import os |
2 | 2 | import sys |
| 3 | + |
3 | 4 | try: |
4 | 5 | from setuptools import setup, find_packages |
5 | 6 | except ImportError: |
6 | 7 | from distutils.core import setup, find_packages |
7 | 8 |
|
8 | 9 | packages = find_packages() |
9 | 10 |
|
| 11 | +package_data = { |
| 12 | + package: [ |
| 13 | + f |
| 14 | + for f in os.listdir(package.replace(".", os.path.sep)) |
| 15 | + if os.path.splitext(f)[1] in (".so", ".pyd") |
| 16 | + ] |
| 17 | + for package in packages |
| 18 | +} |
| 19 | + |
| 20 | +dependencies = ["gtsam", "Cython>=0.25.2", "backports_abc>=0.5", "numpy>=1.12.0"] |
| 21 | + |
10 | 22 | setup( |
11 | | - name='example', |
12 | | - description='Simple example of wrapping projects with Python and GTSAM', |
13 | | - url='https://gtsam.org/', |
14 | | - version='1.0.0', |
15 | | - author='Varun Agrawal', |
16 | | - |
17 | | - license='Simplified BSD license', |
18 | | - keywords='wrapper tutorial example', |
| 23 | + name="gtsam_example", |
| 24 | + description="Simple example of wrapping projects with GTSAM", |
| 25 | + url="https://github.com/borglab/gtsam-project-python/", |
| 26 | + version="1.0.0", |
| 27 | + author="Varun Agrawal", |
| 28 | + |
| 29 | + license="Simplified BSD license", |
| 30 | + keywords="gtsam wrapper tutorial example", |
19 | 31 | long_description="", |
20 | | - long_description_content_type='text/markdown', |
21 | | - python_requires='>=3.6', |
| 32 | + long_description_content_type="text/markdown", |
| 33 | + python_requires=">=3.6", |
22 | 34 | # https://pypi.org/pypi?%3Aaction=list_classifiers |
23 | 35 | classifiers=[ |
24 | | - 'Development Status :: 5 - Production/Stable', |
25 | | - 'Intended Audience :: Education', |
26 | | - 'Intended Audience :: Developers', |
27 | | - 'Intended Audience :: Science/Research', |
28 | | - 'Operating System :: MacOS', |
29 | | - 'Operating System :: Microsoft :: Windows', |
30 | | - 'Operating System :: POSIX', |
31 | | - 'License :: OSI Approved :: BSD License', |
32 | | - 'Programming Language :: Python :: 2', |
33 | | - 'Programming Language :: Python :: 3', |
| 36 | + "Development Status :: 5 - Production/Stable", |
| 37 | + "Intended Audience :: Education", |
| 38 | + "Intended Audience :: Developers", |
| 39 | + "Intended Audience :: Science/Research", |
| 40 | + "Operating System :: MacOS", |
| 41 | + "Operating System :: Microsoft :: Windows", |
| 42 | + "Operating System :: POSIX", |
| 43 | + "License :: OSI Approved :: BSD License", |
| 44 | + "Programming Language :: Python :: 2", |
| 45 | + "Programming Language :: Python :: 3", |
34 | 46 | ], |
35 | | - |
36 | 47 | packages=packages, |
37 | 48 | # Load the built shared object files |
38 | | - package_data={package: |
39 | | - [f for f in os.listdir(package.replace('.', os.path.sep)) if os.path.splitext(f)[1] in ('.so', '.pyd')] |
40 | | - for package in packages |
41 | | - }, |
42 | | - install_requires=[line.strip() for line in ''' |
43 | | - Cython>=0.25.2 |
44 | | - backports_abc>=0.5 |
45 | | - numpy>=1.12.0 |
46 | | -'''.splitlines() if len(line.strip()) > 0 and not line.strip().startswith('#')] |
| 49 | + package_data=package_data, |
| 50 | + include_package_data=True, |
| 51 | + # Ensure that the compiled .so file is properly packaged |
| 52 | + zip_safe=False, |
| 53 | + platforms="any", |
| 54 | + install_requires=dependencies, |
47 | 55 | ) |
0 commit comments