-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to pyproject.toml specification, update workflows (#76)
* Add pyproject.toml * Remove old specs from setup.py * Add dependabot * Update build and deploy github workflow * Add ripser.py as an optional dependency * Update testing workflow, rename to test * Remove dist specification from action * Allow for python 3.7 * Remove python requirement; remove build, wheel, and toml setuptool requires * Bump version * Add Abe as maintainer
- Loading branch information
1 parent
a44f6eb
commit 39ec0bf
Showing
9 changed files
with
189 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Build and Upload Python Package | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheel_and_sdist: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build SDist and wheel | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist/* | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
upload_pypi: | ||
name: Upload release to PyPI | ||
needs: [build_wheel_and_sdist] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/persim | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python application | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
pip install -e ".[testing]" | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest --cov persim | ||
- name: Upload coverage results | ||
run: | | ||
bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.5" | ||
__version__ = "0.3.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "persim" | ||
dynamic = ["version"] | ||
description = "Distances and representations of persistence diagrams" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Nathaniel Saul", email = "[email protected]" }, | ||
{ name = "Chris Tralie", email = "[email protected]" }, | ||
{ name = "Francis Motta", email = "[email protected]" }, | ||
{ name = "Michael Catanzaro", email = "[email protected]" }, | ||
{ name = "Gabrielle Angeloro", email = "[email protected]" }, | ||
{ name = "Calder Sheagren", email = "[email protected]" }, | ||
] | ||
maintainers = [ | ||
{ name = "Nathaniel Saul", email = "[email protected]" }, | ||
{ name = "Chris Tralie", email = "[email protected]" }, | ||
{ name = "Michael Catanzaro", email = "[email protected]" }, | ||
{ name = "Abraham Smith", email = "[email protected]" }, | ||
] | ||
|
||
dependencies = [ | ||
"deprecated", | ||
"hopcroftkarp", | ||
"joblib", | ||
"matplotlib", | ||
"numpy", | ||
"scikit-learn", | ||
] | ||
|
||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"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", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
] | ||
|
||
|
||
keywords = [ | ||
"persistent homology", | ||
"persistence images", | ||
"persistence diagrams", | ||
"topological data analysis", | ||
"algebraic topology", | ||
"unsupervised learning", | ||
"supervised learning", | ||
"machine learning", | ||
"sliced wasserstein distance", | ||
"bottleneck distance", | ||
] | ||
[project.optional-dependencies] | ||
testing = ["pytest", "pytest-cov"] | ||
|
||
docs = ["ripser", "sktda_docs_config"] | ||
|
||
[project.urls] | ||
Homepage = "https://persim.scikit-tda.org" | ||
Documentation = "https://persim.scikit-tda.org" | ||
Repository = "https://github.com/scikit-tda/persim" | ||
Issues = "https://github.com/scikit-tda/persim/issues" | ||
Changelog = "https://github.com/scikit-tda/persim/blob/master/RELEASE.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,18 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup | ||
|
||
|
||
import setuptools | ||
import re | ||
|
||
VERSIONFILE = "persim/_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,)) | ||
|
||
with open("README.md") as f: | ||
long_description = f.read() | ||
def get_version(): | ||
VERSIONFILE = "persim/_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="persim", | ||
version=verstr, | ||
description="Distances and representations of persistence diagrams", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author="Nathaniel Saul, Chris Tralie, Francis Motta, Michael Catanzaro, Gabrielle Angeloro, Calder Sheagren", | ||
author_email="[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]", | ||
url="https://persim.scikit-tda.org", | ||
license="MIT", | ||
packages=["persim"], | ||
include_package_data=True, | ||
install_requires=[ | ||
"scikit-learn", | ||
"numpy", | ||
"matplotlib", | ||
"scipy", | ||
"hopcroftkarp", | ||
"deprecated", | ||
"joblib", | ||
], | ||
extras_require={ # use `pip install -e ".[testing]"`` | ||
"testing": ["pytest", "pytest-cov"], | ||
"docs": [ # `pip install -e ".[docs]"`` | ||
"sktda_docs_config" | ||
], | ||
}, | ||
python_requires=">=3.6", | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"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", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
], | ||
keywords="persistent homology, persistence images, persistence diagrams, topological data analysis, algebraic topology, unsupervised learning, supervised learning, machine learning, sliced wasserstein distance, bottleneck distance", | ||
setuptools.setup( | ||
version=get_version(), | ||
) |