Skip to content

Commit c785268

Browse files
committed
move metadata to pyproject.toml
1 parent 1da4cb8 commit c785268

File tree

2 files changed

+46
-59
lines changed

2 files changed

+46
-59
lines changed

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@ requires = [
88
"numpy!=1.23.0"]
99
build-backend = "setuptools.build_meta"
1010

11+
[project]
12+
name = "slycot"
13+
description = "A wrapper for the SLICOT control and systems library"
14+
readme = "README.rst"
15+
authors = [{ name = "Enrico Avventi et al." }]
16+
maintainers = [{ name = "Slycot developers", email = "[email protected]"}]
17+
license = {text = "GPL-2.0 AND BSD-3-Clause"}
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Intended Audience :: Science/Research",
21+
"Intended Audience :: Developers",
22+
"License :: OSI Approved",
23+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
24+
"License :: OSI Approved :: BSD License",
25+
"Programming Language :: C",
26+
"Programming Language :: Fortran",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Topic :: Software Development",
33+
"Topic :: Scientific/Engineering",
34+
"Operating System :: Microsoft :: Windows",
35+
"Operating System :: POSIX",
36+
"Operating System :: Unix",
37+
"Operating System :: MacOS",
38+
]
39+
requires-python = ">=3.7"
40+
dependencies = [
41+
"numpy",
42+
]
43+
dynamic = ["version"]
44+
45+
[project.urls]
46+
homepage = "https://github.com/python-control/Slycot"
47+
48+
1149
[tool.setuptools_scm]
1250
write_to = "slycot/version.py"
1351

setup.py

Lines changed: 8 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88

99
import builtins
1010
import os
11-
import sys
1211
import subprocess
13-
import re
14-
import platform
1512

1613
try:
1714
from skbuild import setup
@@ -24,29 +21,6 @@
2421
except ImportError:
2522
raise ImportError('setuptools_scm must be installed before running setup.py')
2623

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-
5024
# This is a bit hackish: we are setting a global variable so that the main
5125
# slycot __init__ can detect if it is being loaded by the setup routine, to
5226
# avoid attempting to load components that aren't built yet. While ugly, it's
@@ -82,36 +56,11 @@ def run(self):
8256
check_submodules()
8357
sdist.run(self)
8458

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

Comments
 (0)