From 204520ea24e46ce6592892c894da3d696d7953ed Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Wed, 29 May 2024 16:27:20 -0400 Subject: [PATCH 1/3] consolidate infra --- .coveragerc | 7 ----- fastpair/__init__.py | 6 ++++ pyproject.toml | 72 ++++++++++++++++++++++++++++++++++++++++++++ recommended.txt | 4 --- requirements.txt | 5 --- setup.py | 44 --------------------------- 6 files changed, 78 insertions(+), 60 deletions(-) delete mode 100644 .coveragerc create mode 100644 pyproject.toml delete mode 100644 recommended.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index d6b8b6a..0000000 --- a/.coveragerc +++ /dev/null @@ -1,7 +0,0 @@ -[report] -exclude_lines = - pragma: no cover - def __repr__ - raise AssertionError - raise NotImplementedError - if __name__ == .__main__.: diff --git a/fastpair/__init__.py b/fastpair/__init__.py index fb2ddc3..c40501f 100644 --- a/fastpair/__init__.py +++ b/fastpair/__init__.py @@ -10,4 +10,10 @@ # Copyright (c) 2002-2015, David Eppstein # Licensed under the MIT Licence (http://opensource.org/licenses/MIT). +import contextlib +from importlib.metadata import PackageNotFoundError, version + from .base import FastPair + +with contextlib.suppress(PackageNotFoundError): + __version__ = version("fastpair") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cb1c7a1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,72 @@ +[build-system] +requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] + +[project] +name = "fastpair" +dynamic = ["version"] +authors = [ + { name = "Carson J. Q. Farmer", email = "carsonfarmer@gmail.com" }, +] + +#maintainers = [{ name = "" }] + +license = { text = "MIT" } +description = "FastPair: Data-structure for the dynamic closest-pair problem." +keywords = ["closest-pair points algorithm fastpair"] +readme = "README.md" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: System :: Distributed Computing", +] + +requires-python = ">=3.10" +dependencies = [ + "scipy>=1.10,<1.12", +] + +[project.urls] +Home = "https://github.com/carsonfarmer/fastpair/" +Repository = "https://github.com/carsonfarmer/fastpair" + +[project.optional-dependencies] +tests = [ + "codecov", + "coverage", + "pytest", + "pytest-cov", + "setuptools_scm", +] + +[tool.setuptools.packages.find] +include = ["fastpair", "fastpair.*"] + + +[tool.coverage.run] +source = ["./fastpair"] + +[tool.coverage.report] +exclude_lines = [ + "def __repr__", + "except ModuleNotFoundError:", + "except ImportError", + "if __name__ == .__main__.:", + "if self.debug:", + "pragma: no cover", + "raise AssertionError", + "raise NotImplementedError", +] + +ignore_errors = true +omit = ["fastpair/test/*"] diff --git a/recommended.txt b/recommended.txt deleted file mode 100644 index 3b7f4d8..0000000 --- a/recommended.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Examples and tests -scipy -pytest-cov -coveralls diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d1c1b4a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ ---index-url https://pypi.python.org/simple/ - -# This saves keeping two separate lists: -# https://caremad.io/2013/07/setup-vs-requirement/ --e . \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 02754e2..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -"""FastPair: Data-structure for the dynamic closest-pair problem. - -Installation script for FastPair. -""" - -# Copyright (c) 2016, Carson J. Q. Farmer -# Copyright (c) 2002-2015, David Eppstein -# Licensed under the MIT Licence (http://opensource.org/licenses/MIT). - -import sys -import os -import warnings - -try: - from setuptools import setup, find_packages -except ImportError: - from distutils.core import setup, find_packages - -PACKAGE_NAME = "FastPair" -DESCRIPTION = "FastPair: Data-structure for the dynamic closest-pair problem." -FULLVERSION = "v0.1.0" - -setup(name=PACKAGE_NAME, version=FULLVERSION, description=DESCRIPTION, - license='MIT', author='Carson J. Q. Farmer', - author_email='carsonfarmer@gmail.com', - keywords="closest-pair points algorithm fastpair", - long_description=DESCRIPTION, packages=find_packages("."), - install_requires=["scipy"], zip_safe=True, - setup_requires=["pytest-runner",], tests_require=["pytest",], - classifiers=["Development Status :: 2 - Pre-Alpha", - "Environment :: Console", - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "Intended Audience :: Information Technology", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: System :: Distributed Computing", - ]) From f8e14fd2e8159d094d0fb652bafd4d1c020280cb Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Thu, 30 May 2024 15:10:34 -0400 Subject: [PATCH 2/3] Update pyproject.toml Co-authored-by: Carson Farmer --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cb1c7a1..3013cf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" name = "fastpair" dynamic = ["version"] authors = [ - { name = "Carson J. Q. Farmer", email = "carsonfarmer@gmail.com" }, + { name = "Carson J. Q. Farmer", email = "carson.farmer@gmail.com" }, ] #maintainers = [{ name = "" }] From 8a3840de8c72fdff9141c5be411912bece7134a6 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Thu, 30 May 2024 15:30:22 -0400 Subject: [PATCH 3/3] add me as maintainer --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3013cf9..821cf12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,9 +10,9 @@ dynamic = ["version"] authors = [ { name = "Carson J. Q. Farmer", email = "carson.farmer@gmail.com" }, ] - -#maintainers = [{ name = "" }] - +maintainers = [ + { name = "James D. Gaboardi", email = "jgaboardi@gmail.com" }, +] license = { text = "MIT" } description = "FastPair: Data-structure for the dynamic closest-pair problem." keywords = ["closest-pair points algorithm fastpair"]