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..821cf12 --- /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 = "carson.farmer@gmail.com" }, +] +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"] +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", - ])