|
8 | 8 |
|
9 | 9 | import builtins |
10 | 10 | import os |
11 | | -import sys |
12 | 11 | import subprocess |
13 | | -import re |
14 | | -import platform |
15 | 12 |
|
16 | 13 | try: |
17 | 14 | from skbuild import setup |
|
24 | 21 | except ImportError: |
25 | 22 | raise ImportError('setuptools_scm must be installed before running setup.py') |
26 | 23 |
|
27 | | -DOCLINES = __doc__.split("\n") |
28 | | - |
29 | | -CLASSIFIERS = """\ |
30 | | -Development Status :: 4 - Beta |
31 | | -Intended Audience :: Science/Research |
32 | | -Intended Audience :: Developers |
33 | | -License :: OSI Approved |
34 | | -License :: OSI Approved :: GNU General Public License v2 (GPLv2) |
35 | | -Programming Language :: C |
36 | | -Programming Language :: Fortran |
37 | | -Programming Language :: Python |
38 | | -Programming Language :: Python :: 3.7 |
39 | | -Programming Language :: Python :: 3.8 |
40 | | -Programming Language :: Python :: 3.9 |
41 | | -Programming Language :: Python :: 3.10 |
42 | | -Topic :: Software Development |
43 | | -Topic :: Scientific/Engineering |
44 | | -Operating System :: Microsoft :: Windows |
45 | | -Operating System :: POSIX |
46 | | -Operating System :: Unix |
47 | | -Operating System :: MacOS |
48 | | -""" |
49 | | - |
50 | 24 | # This is a bit hackish: we are setting a global variable so that the main |
51 | 25 | # slycot __init__ can detect if it is being loaded by the setup routine, to |
52 | 26 | # avoid attempting to load components that aren't built yet. While ugly, it's |
@@ -82,36 +56,11 @@ def run(self): |
82 | 56 | check_submodules() |
83 | 57 | sdist.run(self) |
84 | 58 |
|
85 | | -def setup_package(): |
86 | | - src_path = os.path.dirname(os.path.abspath(__file__)) |
87 | | - sys.path.insert(0, src_path) |
88 | | - |
89 | | - |
90 | | - metadata = dict( |
91 | | - name='slycot', |
92 | | - packages=['slycot', 'slycot.tests'], |
93 | | - cmake_languages=('C', 'Fortran'), |
94 | | - use_scm_version=True, |
95 | | - maintainer="Slycot developers", |
96 | | - maintainer_email="[email protected]", |
97 | | - description=DOCLINES[0], |
98 | | - long_description=open('README.rst').read(), |
99 | | - url='https://github.com/python-control/Slycot', |
100 | | - author='Enrico Avventi et al.', |
101 | | - license='GPL-2.0', |
102 | | - classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f], |
103 | | - platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], |
104 | | - cmdclass={"sdist": sdist_checked}, |
105 | | - zip_safe=False, |
106 | | - install_requires=["numpy"], |
107 | | - python_requires=">=3.7" |
108 | | - ) |
109 | | - |
110 | | - try: |
111 | | - setup(**metadata) |
112 | | - finally: |
113 | | - del sys.path[0] |
114 | | - |
115 | | - |
116 | | -if __name__ == '__main__': |
117 | | - setup_package() |
| 59 | +# These need to stay in setup.py |
| 60 | +# https://scikit-build.readthedocs.io/en/latest/usage.html#setuptools-options |
| 61 | +setup( |
| 62 | + packages=['slycot', 'slycot.tests'], |
| 63 | + cmdclass={'sdist': sdist_checked}, |
| 64 | + cmake_languages=('C', 'Fortran'), |
| 65 | + use_scm_version = True, |
| 66 | +) |
0 commit comments