diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c8fa08..d3330d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: push: pull_request: schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" jobs: test-linux-macos: @@ -25,10 +25,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . + pip install ".[testing]" : # pip install pytest nbmake - pip install pytest - - name: Run test + - name: Run test run: | : # we were also testing the jupyter notebooks with the command below : # but some recent update broke this and we get "No such file or directory: 'latex'" @@ -36,7 +35,6 @@ jobs: : # original command "pytest --nbmake ." pytest . - test-windows: runs-on: windows-latest strategy: @@ -54,10 +52,9 @@ jobs: shell: bash -l {0} run: | python -m pip install --upgrade pip - pip install . + pip install ".[testing]" : # pip install pytest nbmake - pip install pytest - - name: Run test + - name: Run test shell: bash -l {0} run: | : # we were also testing the jupyter notebooks with the command below @@ -81,8 +78,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pytest pytest-cov + pip install ".[testing]" - name: Tests run: | export NUMBA_DISABLE_JIT=1 diff --git a/.readthedocs.yml b/.readthedocs.yml index 6d20541..f0fedb5 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,7 +14,7 @@ sphinx: python: install: - - requirements: ./requirements.txt + - requirements: docs/requirements.txt - method: pip path: . extra_requirements: diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..8aa2e07 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +sphinx +sphinx_rtd_theme +numpydoc +ipython +nbsphinx diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..af5e276 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[build-system] +requires = ["setuptools >= 61.0", "build", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "dreimac" +dynamic = ["version"] +description = "DREiMac: Dimensionality reduction with Eilenberg-MacLane coordinates" +readme = "README.md" +authors = [ + { name = "Jose A. Perea", email = "joperea@gmail.com" }, + { name = "Luis Scoccola", email = "luis.scoccola@gmail.com" }, + { name = "Chris Tralie", email = "chris.tralie@gmail.com" }, +] +maintainers = [ + { name = "Jose A. Perea", email = "joperea@gmail.com" }, + { name = "Luis Scoccola", email = "luis.scoccola@gmail.com" }, + { name = "Chris Tralie", email = "chris.tralie@gmail.com" }, +] + +requires-python = ">=3.8, <3.12" + +dependencies = [ + "matplotlib >= 3.6", + "numba >= 0.56", + "numpy >= 1.23", + "persim >=0.3", + "ripser >= 0.6", + "scipy >=1.10", +] + +classifiers = [ + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "Intended Audience :: Financial and Insurance Industry", + "Intended Audience :: Healthcare Industry", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Mathematics", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "License :: OSI Approved :: Apache Software License", +] + +keywords = ["dimensionality reduction", "topological data analysis"] + +[project.optional-dependencies] +testing = ["pytest", "pytest-cov"] + +docs = ["sphinx", "sphinx_rtd_theme", "numpydoc", "ipykernel", "nbsphinx"] + +[project.urls] +Homepage = "https://dreimac.scikit-tda.org" +Documentation = "https://dreimac.scikit-tda.org" +Repository = "https://github.com/scikit-tda/DREiMac" +Issues = "https://github.com/scikit-tda/DREiMac/issues" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 40f8f65..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -matplotlib>=3.6 -numba>=0.56 -numpy>=1.23 -persim>=0.3 -ripser>=0.6 -scipy>=1.10 diff --git a/setup.py b/setup.py index 54046ac..6589668 100644 --- a/setup.py +++ b/setup.py @@ -1,55 +1,18 @@ from setuptools import setup - -## Get version information from _version.py import re -VERSIONFILE = "dreimac/_version.py" -verstrline = open(VERSIONFILE, "rt").read() -VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" -mo = re.search(VSRE, verstrline, re.M) -if mo: - verstr = mo.group(1) -else: - raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) - -# Use README.md as the package long description -with open("README.md") as f: - long_description = f.read() - -# get requirements -def requirements(): - with open("requirements.txt") as f: - return [line.strip() for line in f if line.strip()] +def get_version(): + VERSIONFILE = "dreimac/_version.py" + verstrline = open(VERSIONFILE, "rt").read() + VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" + mo = re.search(VSRE, verstrline, re.M) + if mo: + return mo.group(1) + else: + raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) setup( - name="dreimac", - version=verstr, - description="DREiMac: Dimensionality reduction with Eilenberg-MacLane coordinates", - long_description=long_description, - long_description_content_type="text/markdown", - author="Jose A. Perea, Luis Scoccola, Chris Tralie", - author_email="ctralie@alumni.princeton.edu", - license="Apache2", - packages=["dreimac"], - install_requires=requirements(), - extras_require={ - "testing": ["pytest"], - "docs": ["sphinx", "sphinx_rtd_theme", "numpydoc", "ipykernel", "nbsphinx"], - }, - python_requires=">=3.8,<3.12", - classifiers=[ - "Intended Audience :: Science/Research", - "Intended Audience :: Education", - "Intended Audience :: Financial and Insurance Industry", - "Intended Audience :: Healthcare Industry", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Scientific/Engineering :: Mathematics", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - keywords="topological data analysis, dimensionality reduction", + version=get_version(), )