From 75c8e1853391ccc81a546b5143d03851b7495d2e Mon Sep 17 00:00:00 2001 From: Filip Komarzyniec Date: Wed, 22 May 2024 18:00:29 +0200 Subject: [PATCH 1/4] introduced pyproject.toml file; simplified setup.py and MANIFEST.in files --- MANIFEST.in | 8 +------- pyproject.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 48 +++---------------------------------------- 3 files changed, 59 insertions(+), 52 deletions(-) create mode 100644 pyproject.toml 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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..72096f0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools >= 61.0", "Cython"] +build-backend = "setuptools.build_meta" + +[project] +name = 'jenkspy' +dynamic = ["version"] +dependencies = [ + "numpy" +] +requires-python = ">= 3.6" +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.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", +] + + +[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/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} ) From b716c2093da7c7e1bf7e470d077e017a31312eb6 Mon Sep 17 00:00:00 2001 From: Filip Komarzyniec Date: Wed, 22 May 2024 18:00:46 +0200 Subject: [PATCH 2/4] bumped version to 0.4.1 --- jenkspy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 4a313e6d1669fa12a9af76230488ec0a3353ccc4 Mon Sep 17 00:00:00 2001 From: Filip Komarzyniec Date: Mon, 27 May 2024 12:46:18 +0200 Subject: [PATCH 3/4] deleted now redundant requirements.txt file --- requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.txt 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 From 83521642ce0a36cba6dea62d776156b0deb8df85 Mon Sep 17 00:00:00 2001 From: Filip Komarzyniec Date: Mon, 27 May 2024 12:51:08 +0200 Subject: [PATCH 4/4] dropped support for python3.6; updated README --- README.md | 4 ++-- pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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/pyproject.toml b/pyproject.toml index 72096f0..69d313c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] dependencies = [ "numpy" ] -requires-python = ">= 3.6" +requires-python = ">= 3.7" authors = [ {name = "Matthieu Viry", email = "matthieu.viry@cnrs.fr"}, ] @@ -24,7 +24,6 @@ classifiers = [ "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",