diff --git a/pyproject.toml b/pyproject.toml index 731bd1e..eb08235 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,23 @@ +[project] +name = "py-allspice" +authors = [{ name = "AllSpice, Inc.", email = "maintainers@allspice.io" }] +description = "A python wrapper for the AllSpice Hub API" +readme = "README.md" +license = { text = "MIT" } +keywords = ["AllSpice", "AllSpice Hub", "api", "wrapper"] +urls = { Homepage = "https://github.com/AllSpiceIO/py-allspice" } +dynamic = ["dependencies", "optional-dependencies", "version"] +requires-python = ">=3.10" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +dependencies = { file = ["requirements.txt"] } +optional-dependencies = { test = { file = ["requirements-test.txt"] } } +version = { attr = "allspice.__version__" } + [tool.ruff] lint.ignore = [ "E501", # Line length. diff --git a/setup.py b/setup.py deleted file mode 100644 index 21f87ad..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -import codecs -import os - -from setuptools import find_packages, setup - - -# Taken from pip's setup.py -def read(rel_path): - here = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(here, rel_path), "r") as fp: - return fp.read() - - -def get_version(rel_path): - for line in read(rel_path).splitlines(): - if line.startswith("__version__"): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - else: - raise RuntimeError("Unable to find version string.") - - -with open("README.md") as readme_file: - README = readme_file.read() - -setup_args = dict( - name="py-allspice", - version=get_version("allspice/__init__.py"), - description="A python wrapper for the AllSpice Hub API", - long_description_content_type="text/markdown", - long_description=README, - license="MIT", - packages=find_packages(), - author="AllSpice, Inc.", - author_email="maintainers@allspice.io", - keywords=["AllSpice", "AllSpice Hub", "api", "wrapper"], - url="https://github.com/AllSpiceIO/py-allspice", - download_url="https://github.com/AllSpiceIO/py-allspice", -) - -install_requires = [ - "requests", - "frozendict", -] - -extras_require = {"test": ["pytest"]} - -if __name__ == "__main__": - setup(**setup_args, install_requires=install_requires, extras_require=extras_require)