diff --git a/MANIFEST.in b/MANIFEST.in index 602fc2f..96737d3 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1 @@ -# C/cython source files -include jenkspy/src/* - -include README.md -include LICENSE -include tests/*.* -include requirements.txt +graft tests diff --git a/README.md b/README.md index 1f0b51e..4191e53 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Compute "natural breaks" (*Fisher-Jenks algorithm*) on list / tuple / array / nu The algorithm implemented by this library is also sometimes referred to as *Fisher-Jenks algorithm*, *Jenks Optimisation Method* or *Fisher exact optimization method*. This is a deterministic method to calculate the optimal class boundaries. -Intended compatibility: CPython 3.6+ +Intended compatibility: CPython 3.7+ Wheels are provided via PyPI for Windows / MacOS / Linux users - Also available on conda-forge channel for Anaconda users. @@ -86,7 +86,7 @@ pip install jenkspy ```shell git clone http://github.com/mthh/jenkspy cd jenkspy/ -python setup.py install +pip install . ``` - **For anaconda users** diff --git a/jenkspy/__init__.py b/jenkspy/__init__.py index 6fe1477..a96367a 100644 --- a/jenkspy/__init__.py +++ b/jenkspy/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -__version__ = "0.4.0" +__version__ = "0.4.1" from .core import jenks_breaks from .core import _jenks_matrices diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..69d313c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[build-system] +requires = ["setuptools >= 61.0", "Cython"] +build-backend = "setuptools.build_meta" + +[project] +name = 'jenkspy' +dynamic = ["version"] +dependencies = [ + "numpy" +] +requires-python = ">= 3.7" +authors = [ + {name = "Matthieu Viry", email = "matthieu.viry@cnrs.fr"}, +] +maintainers = [ + {name = "Matthieu Viry", email = "matthieu.viry@cnrs.fr"}, +] +description = "Compute Natural Breaks (Fisher-Jenks algorithm)" +readme = "README.md" +license = {file = "LICENSE"} + +classifiers = [ + "Programming Language :: Python", + "Development Status :: 5 - Production/Stable", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", + "Typing :: Typed", +] + + +[project.urls] +Homepage = "https://github.com/mthh/jenkspy" +Repository = "https://github.com/mthh/jenkspy.git" +Issues = "https://github.com/mthh/jenkspy/issues" +Changelog = "https://github.com/mthh/jenkspy/blob/master/CHANGES.rst" + +[tool.setuptools] +packages = ["jenkspy"] +include-package-data = false + + +[tool.setuptools.package-data] +jenkspy = ["src/*"] + +[tool.setuptools.dynamic] +version = {attr = "jenkspy.__version__"} +readme = {file = "README.md", content-type = "text/x-rst"} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 296d654..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy \ No newline at end of file diff --git a/setup.py b/setup.py index 1214b44..4c596d1 100644 --- a/setup.py +++ b/setup.py @@ -1,61 +1,19 @@ # -*- coding: utf-8 -*- from distutils.core import setup from distutils.extension import Extension -from ast import parse -from os import path -from Cython.Distutils import build_ext from Cython.Build import cythonize - -ext = '.pyx' +from Cython.Distutils import build_ext exts = [ Extension( "jenkspy.jenks", - ["jenkspy/src/jenks" + ext], + ["jenkspy/src/jenks.pyx"], ["jenkspy"], ) ] -with open(path.join('jenkspy', '__init__.py')) as f: - __version__ = parse(next(filter(lambda line: line.startswith('__version__'), - f))).body[0].value.s - -with open('README.md') as f: - long_desc = f.read() - -with open('requirements.txt') as f: - requirements = f.read().splitlines() - setup( - name='jenkspy', - version=__version__, - license="MIT", ext_modules=cythonize(exts), - cmdclass={'build_ext': build_ext}, - packages=["jenkspy"], - include_package_data=True, - description="Compute Natural Breaks (Fisher-Jenks algorithm)", - long_description=long_desc, - long_description_content_type='text/x-rst', - install_requires=requirements, - test_suite="tests", - author="Matthieu Viry", - author_email="matthieu.viry@cnrs.fr", - url='https://github.com/mthh/jenkspy', - classifiers=[ - "Programming Language :: Python", - "Development Status :: 5 - Production/Stable", - "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Scientific/Engineering", - "Typing :: Typed", - ], + cmdclass={'build_ext': build_ext} )