From a5ecc6bf1531c58af7974e42275cbc7750d2bb1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20G=C3=B6ries?= <43136580+dgoeries@users.noreply.github.com> Date: Wed, 23 Oct 2024 03:16:52 +0200 Subject: [PATCH] feat: Add numpy 2.X build and support for python 3.10+ (#27) * feat: Add numpy 2.X build and support for python 3.10+ * Update git workflow --- .github/workflows/python-app.yml | 6 +++--- .gitignore | 2 +- pyproject.toml | 23 +++++++++++------------ requirements.txt | 1 - setup.py | 11 +---------- tox.ini | 6 ++++-- 6 files changed, 20 insertions(+), 29 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 55bdb90..5f69504 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,19 +13,19 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip + python -m pip install setuptools python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Build package run: | python -m pip install . -v diff --git a/.gitignore b/.gitignore index 7e9606c..56ab1d3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ wheels/ .installed.cfg *.egg .tox/ - +*.whl # Installer logs pip-log.txt pip-delete-this-directory.txt diff --git a/pyproject.toml b/pyproject.toml index 4b6544b..a4e567a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,27 +1,27 @@ [build-system] requires = [ - "setuptools>=51.0", - "wheel>=0.36", - "numpy==1.22" + "setuptools>=65.5.0", + "wheel>=0.40", + "numpy>=2.0" ] build-backend = "setuptools.build_meta" [project] name = "lttbc" -version = "0.2.4" -description ="Largest triangle three buckets module for Python written in C" +version = "0.3.0" +description = "Largest triangle three buckets module for Python written in C" dynamic = ["readme"] -requires-python = ">=3.8" +requires-python = ">=3.10" authors = [ - {name = "European XFEL GmbH", email = "dennis.goeries@xfel.eu"} + { name = "European XFEL GmbH", email = "dennis.goeries@xfel.eu" } ] maintainers = [ - {name = "Dennis Goeries", email = "dennis.goeries@xfel.eu"}, + { name = "Dennis Goeries", email = "dennis.goeries@xfel.eu" }, ] dependencies = [ - "numpy>=1.22", + "numpy>=2.0", ] -license = {text = "MIT"} +license = { text = "MIT" } classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -38,6 +38,5 @@ classifiers = [ [project.urls] "git" = "https://github.com/dgoeries/lttbc" - [tool.setuptools.dynamic] -readme = {file = ["README.txt"], content-type = "text/markdown"} +readme = { file = ["README.md"], content-type = "text/markdown" } diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 61dc1ae..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy==1.22 diff --git a/setup.py b/setup.py index 3f9e0a4..8cd59a8 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,7 @@ #!/usr/bin/env python -import os.path as osp -import sys - from setuptools import Extension, setup -def get_script_path(): - return osp.dirname(osp.realpath(sys.argv[0])) - - class numpy_get_include: def __str__(self): import numpy @@ -18,10 +11,8 @@ def __str__(self): lttbc_py = Extension("lttbc", sources=["lttbc.c"], define_macros=[ ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")], - include_dirs=[numpy_get_include(), - get_script_path()], + include_dirs=[numpy_get_include()], ) - setup( ext_modules=[lttbc_py], ) diff --git a/tox.ini b/tox.ini index 5a250cc..4c16378 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,13 @@ [tox] -envlist = py38,py39,py310,py311 +envlist = py310,py311,py312,py313 [testenv] deps = pytest - -requirements.txt + numpy + setuptools commands = pip wheel . + python setup.py build pytest -v