Skip to content

Commit

Permalink
REL: move info from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
slivingston committed Oct 3, 2024
1 parent 1c92b8e commit 8c39e6a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 58 deletions.
56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[build-system]
requires = ["setuptools >= 65.5.1"]
build-backend = "setuptools.build_meta"

[project]
name = "polytope"
description = "Polytope Toolbox"
authors = [{name = "Caltech Control and Dynamical Systems", email = "polytope@tulip-control.org"}]
readme = "README.rst"
license = {text = "BSD-3-Clause"}
classifiers = [
"License :: OSI Approved :: BSD License",
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"networkx >= 3.0",
"numpy >= 1.24.1",
"scipy >= 1.10.0",
]

[project.urls]
Homepage = "https://tulip-control.org"
"Source Code" = "https://github.com/tulip-control/polytope"
"Bug Tracker" = "https://github.com/tulip-control/polytope/issues"
Documentation = "https://tulip-control.github.io/polytope/"

[project.optional-dependencies]
extra = [
"cvxopt >= 1.3.2",
]
test = [
"matplotlib >= 3.6.3",
"pytest >= 7.2.1",
]

[tool.setuptools]
packages = [
"polytope",
]

[tool.setuptools.package-data]
"polytope" = ["commit_hash.txt"]
59 changes: 1 addition & 58 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@
import sys


classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
'Topic :: Software Development']


def retrieve_git_info():
"""Return commit hash of HEAD, or "release", or None if failure.
Expand Down Expand Up @@ -84,15 +67,6 @@ def retrieve_git_info():
def run_setup():
"""Get version from git, then install."""
# load long description from README.rst
readme_file = 'README.rst'
if os.path.exists(readme_file):
with open(readme_file) as f:
long_description = f.read()
else:
print(
'Could not find readme file to '
'extract long_description.')
long_description = ''
# If .git directory is present,
# create commit_hash.txt accordingly
# to indicate version information
Expand Down Expand Up @@ -127,38 +101,7 @@ def run_setup():
spec.loader.exec_module(version)
polytope_version = version.version
_stp.setup(
name='polytope',
version=polytope_version,
description='Polytope Toolbox',
long_description=long_description,
author='Caltech Control and Dynamical Systems',
author_email='polytope@tulip-control.org',
url='https://tulip-control.org',
project_urls={
'Bug Tracker':
'https://github.com/tulip-control/polytope/issues',
'Documentation':
'https://tulip-control.github.io/polytope/',
'Source Code':
'https://github.com/tulip-control/polytope'},
license='BSD',
python_requires='>=3.8',
setup_requires=[
'setuptools >= 65.5.1'],
install_requires=[
'networkx >= 3.0',
'numpy >= 1.24.1',
'scipy >= 1.10.0'],
tests_require=[
'matplotlib >= 3.6.3',
'pytest >= 7.2.1'],
packages=[
'polytope'],
package_dir=dict(
polytope='polytope'),
package_data=dict(
polytope=['commit_hash.txt']),
classifiers=classifiers)
version=polytope_version)


if __name__ == '__main__':
Expand Down

0 comments on commit 8c39e6a

Please sign in to comment.