From 5b576c948262f97344bc5c74b2f8ace24e9ba42b Mon Sep 17 00:00:00 2001 From: zhengp Date: Mon, 24 Jul 2023 14:48:19 +0800 Subject: [PATCH] update the installation process --- .github/workflows/python-build.yml | 2 +- LICENSE | 2 +- pyproject.toml | 28 +++++++++++++++++ setup.py | 48 ------------------------------ src/xspline/__about__.py | 16 ---------- 5 files changed, 30 insertions(+), 66 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py delete mode 100644 src/xspline/__about__.py diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index 2f0b2df..4950c65 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -12,7 +12,7 @@ jobs: with: python-version: "3.10" - name: Install dependencies - run: python -m pip install .[dev] --upgrade pip + run: python -m pip install .[test] --upgrade pip - name: Test with pytest run: pytest - name: Build package distribution diff --git a/LICENSE b/LICENSE index 931f1bf..ba43158 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2020, Peng Zheng +Copyright (c) 2023, IHME Math Sciences All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..38d686b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "xspline" +version = "1.0.0" +description = "Advanced spline package that provides b-spline bases, their derivatives and integrals" +readme = "REDME.rst" +requires-python = ">=3.10" +license = { file = "LICENSE" } +authors = [ + { name = "IHME Math Sciences", email = "ihme.math.sciences@gmail.com" }, +] +dependencies = ["numpy"] + +[project.optional-dependencies] +test = ["pytest"] +docs = ["sphinx", "sphinx-autodoc-typehints", "furo"] + +[project.urls] +github = "https://github.com/zhengp0/xspline" + +[tool.sphinx] +project = "xspline" +author = "IHME Math Sciences" +copyright = "2023, IHME Math Sciences" +version = "1.0.0" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index d0a81ca..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -from pathlib import Path - -from setuptools import find_packages, setup - -if __name__ == "__main__": - base_dir = Path(__file__).parent - src_dir = base_dir/"src"/"xspline" - - about = {} - with (src_dir / "__about__.py").open() as f: - exec(f.read(), about) - - with (base_dir / "README.rst").open() as f: - long_description = f.read() - - install_requirements = [ - "numpy", - ] - - test_requirements = [ - "pytest", - "pytest-mock", - ] - - doc_requirements = [] - - setup( - name=about["__title__"], - version=about["__version__"], - description=about["__summary__"], - long_description=long_description, - long_description_content_type="text/x-rst", - license=about["__license__"], - url=about["__uri__"], - author=about["__author__"], - author_email=about["__email__"], - package_dir={"": "src"}, - packages=find_packages(where="src"), - include_package_data=True, - install_requires=install_requirements, - tests_require=test_requirements, - extras_require={ - "docs": doc_requirements, - "test": test_requirements, - "dev": doc_requirements + test_requirements - }, - zip_safe=False, - ) diff --git a/src/xspline/__about__.py b/src/xspline/__about__.py deleted file mode 100644 index 6b8dac6..0000000 --- a/src/xspline/__about__.py +++ /dev/null @@ -1,16 +0,0 @@ -__all__ = [ - "__title__", "__summary__", "__uri__", "__version__", "__author__", - "__email__", "__license__", "__copyright__", -] - -__title__ = "xspline" -__summary__ = "xspline: Advanced spline tools" -__uri__ = "https://github.com/zhengp0/xspline" - -__version__ = "0.0.7" - -__author__ = "Peng Zheng" -__email__ = "zhengp@uw.edu" - -__license__ = "BSD 2-Clause License" -__copyright__ = f"Copyright 2020 {__author__}"