From 00d21a4b80aa23787737f1c646c8327e6ef38cc6 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 4 Nov 2024 14:58:24 +0200 Subject: [PATCH 1/2] switch from setup.py to pyproject.toml --- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 25 ------------------------- 2 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d03389c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=64", + "setuptools-scm>=7", +] + +[project] +name = "CHSPy" +dynamic = ["version"] +description = "Cubic Hermite splines" +readme = "README.md" +license = { text = "BSD-3-Clause" } +authors = [ + { name = "Gerrit Ansmann", email = "gansmann@uni-bonn.de" }, +] +requires-python = ">=3.6" +classifiers = [ + "License :: OSI Approved :: BSD License", + "Operating System :: POSIX", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "numpy", +] + +[project.optional-dependencies] +test = [ + "symengine" +] + +[project.urls] +Documentation = "https://chspy.readthedocs.io" +Homepage = "https://github.com/neurophysik/CHSPy" + +[tool.setuptools.packages.find] +include = [ + "chspy*", +] + +[tool.setuptools_scm] +version_file = "chspy/version.py" diff --git a/setup.py b/setup.py deleted file mode 100755 index 84f3e7e..0000000 --- a/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python3 - -from setuptools import setup -from io import open - -setup( - name = 'CHSPy', - description = 'Cubic Hermite splines', - long_description = open('README.md', encoding='utf8').read(), - python_requires=">=3.6", - packages = ['chspy'], - install_requires = ['numpy'], - setup_requires = ['setuptools_scm'], - tests_require = ['symengine'], - use_scm_version = {'write_to': 'chspy/version.py'}, - classifiers = [ - 'License :: OSI Approved :: BSD License', - 'Operating System :: POSIX', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Programming Language :: Python', - 'Topic :: Scientific/Engineering', - ], - ) - From 04498e1ebae1cd990a8362d551d00308a5a01ee0 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 4 Nov 2024 15:05:12 +0200 Subject: [PATCH 2/2] add unittesting on Github Actions --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e95ff29 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [ 'master' ] + pull_request: + branches: [ 'master' ] + schedule: + # at 12:00 on Sunday (UTC) + - cron: '0 12 * * 0' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Unittest ({{ matrix.os}}/py${{ matrix.python-version }}) + runs-on: {{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.6', '3.10', '3.x'] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Main Script + run: | + python -m pip install --upgrade pip setuptools setuptools-scm wheel + python -m pip install --verbose --no-build-isolation --editable . + python -m unittest discover -b -f tests