diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index d198ea2..f5f58a0 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -16,9 +16,9 @@ jobs: - name: install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine - name: build - run: python setup.py sdist + run: python -m build - name: deploy env: TWINE_USERNAME: __token__ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d24e8ae..cbe7739 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: - python: "3.13" toxenv: py313 os: macos-latest - - python: "3.11" + - python: "3.13" toxenv: py313 os: windows-latest @@ -56,10 +56,10 @@ jobs: with: python-version: ${{ matrix.python }} - name: install dependencies - run: python -m pip install --upgrade pip tox setuptools wheel twine + run: python -m pip install --upgrade pip tox - name: run env: TOXENV: ${{ matrix.toxenv }} run: tox - name: setup - run: python setup.py install + run: pip install -e . diff --git a/.gitignore b/.gitignore index 7c0a98f..5d16deb 100644 --- a/.gitignore +++ b/.gitignore @@ -104,4 +104,8 @@ ENV/ .pytest_cache/ # vscode settings -.vscode/ \ No newline at end of file +.vscode/ + +# Local Claude instructions +CLAUDE.local.md +.claude/ \ No newline at end of file diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index c8157c9..0000000 --- a/.zenodo.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "upload_type": "software", - "title": "Permuta: A Python Library for Permutations and Patterns", - "creators": [ - { - "name": "Ragnar Pall Ardal" - }, - { - "name": "Arnar Bjarni Arnarson" - }, - { - "affiliation": "Reykjavik University", - "name": "Christian Bean" - }, - { - "name": "Alfur Birkir Bjarnason" - }, - { - "affiliation": "Reykjavik University", - "name": "Jon Steinn Eliasson" - }, - { - "name": "Bjarki Agust Gudmundsson" - }, - { - "affiliation": "Reykjavik University", - "name": "Sigurjón Ingi Jónsson" - } - { - "name": "Bjarni Jens Kristinsson" - }, - { - "name": "Tomas Ken Magnusson" - }, - { - "affiliation": "Reykjavik University", - "name": "Émile Nadeau" - }, - { - "affiliation": "Marquette University", - "name": "Jay Pantone" - }, - { - "name": "Murray Tannock" - }, - { - "affiliation": "Reykjavik University", - "name": "Henning Ulfarsson" - }, - ] -} diff --git a/CHANGELOG.md b/CHANGELOG.md index d65025a..c417405 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +### Changed + - Migrated from setup.py to modern pyproject.toml packaging with hatchling backend + - Updated minimum Python requirement to 3.10+ (removed support for 3.7-3.9) + - Updated GitHub Actions workflows to use modern build tools + - Removed legacy packaging files (setup.py, MANIFEST.in) ## 2.3.0 - 2024-04-03 ### Changed diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..97fd679 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,21 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +title: "Permuta: A Python Library for Permutations and Patterns" +type: software +authors: + - name: "Ragnar Pall Ardal" + - name: "Arnar Bjarni Arnarson" + - name: "Christian Bean" + affiliation: "Keele University" + - name: "Alfur Birkir Bjarnason" + - name: "Jon Steinn Eliasson" + - name: "Bjarki Agust Gudmundsson" + - name: "Sigurjón Ingi Jónsson" + - name: "Bjarni Jens Kristinsson" + - name: "Tomas Ken Magnusson" + - name: "Émile Nadeau" + - name: "Jay Pantone" + affiliation: "Marquette University" + - name: "Murray Tannock" + - name: "Henning Ulfarsson" + affiliation: "Reykjavik University" diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 34fdff2..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include permuta/py.typed -include permuta/resources/bisc/*.json diff --git a/README.rst b/README.rst index 9b4638e..1277f39 100644 --- a/README.rst +++ b/README.rst @@ -2,9 +2,9 @@ permuta ####### -.. image:: https://travis-ci.org/PermutaTriangle/Permuta.svg?branch=master - :alt: Travis - :target: https://travis-ci.org/PermutaTriangle/Permuta +.. image:: https://github.com/PermutaTriangle/Permuta/workflows/tests/badge.svg + :alt: Tests + :target: https://github.com/PermutaTriangle/Permuta/actions .. image:: https://img.shields.io/pypi/v/Permuta.svg :alt: PyPI :target: https://pypi.python.org/pypi/Permuta @@ -12,12 +12,12 @@ permuta :target: https://pypi.python.org/pypi/Permuta .. image:: https://img.shields.io/pypi/pyversions/Permuta.svg :target: https://pypi.python.org/pypi/Permuta -.. image:: http://img.shields.io/badge/readme-tested-brightgreen.svg - :alt: Travis - :target: https://travis-ci.org/PermutaTriangle/Permuta -.. image:: https://requires.io/github/PermutaTriangle/Permuta/requirements.svg?branch=master - :target: https://requires.io/github/PermutaTriangle/Permuta/requirements/?branch=master - :alt: Requirements Status +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :alt: Code style: black + :target: https://github.com/psf/black +.. image:: http://www.mypy-lang.org/static/mypy_badge.svg + :alt: Checked with mypy + :target: http://mypy-lang.org/ .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4725758.svg :target: https://doi.org/10.5281/zenodo.4725758 @@ -25,9 +25,11 @@ Permuta is a Python library for working with perms (short for permutations), patterns, and mesh patterns. If this code is useful to you in your work, please consider citing it. To generate a -BibTeX entry (or another format), click the "DOI" badge above and locate the "Cite As" +BibTeX entry (or another format), click the "DOI" badge above to go to `Zenodo`_ and locate the "Export" section. +.. _Zenodo: https://doi.org/10.5281/zenodo.4725758 + If you need support, you can join us in our `Discord support server`_. .. _Discord support server: https://discord.gg/ngPZVT5 @@ -46,14 +48,13 @@ source code, in which case you run the following after cloning the repository: .. code-block:: bash - ./setup.py develop + pip install -e . To run the unit tests: .. code-block:: bash - pip install -r test_requirements.txt - ./setup.py test + tox Using Permuta ############# @@ -522,12 +523,3 @@ License BSD-3: see the `LICENSE `_ file. -Citing -###### - -If you found this library helpful with your research and would like to cite us, -you can use the following `BibTeX`_ or go to `Zenodo`_ for alternative formats. - -.. _BibTex: https://zenodo.org/record/4945792/export/hx#.YImTibX7SUk - -.. _Zenodo: https://doi.org/10.5281/zenodo.4725758 diff --git a/pyproject.toml b/pyproject.toml index c459f89..a20030d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,57 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "permuta" +dynamic = ["version"] +authors = [ + {name = "Permuta Triangle", email = "permutatriangle@gmail.com"}, +] +description = "A comprehensive high performance permutation library." +readme = "README.rst" +license = {text = "BSD-3-Clause"} +keywords = ["permutation", "perm", "mesh", "pattern", "patt", "avoid", "contain", "occurrence", "statistic"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Education", + "Topic :: Scientific/Engineering :: Mathematics", +] +requires-python = ">=3.10" +dependencies = [ + "automata-lib==9.0.0", +] + +[project.urls] +Source = "https://github.com/PermutaTriangle/Permuta" +Tracker = "https://github.com/PermutaTriangle/Permuta/issues" + +[project.scripts] +permtools = "permuta.cli:main" + +[tool.hatch.version] +path = "permuta/__init__.py" + +[tool.hatchling.build.targets.wheel] +packages = ["permuta"] + +[tool.hatchling.build.targets.sdist] +include = [ + "/permuta", + "/tests", + "/README.rst", + "/LICENSE", +] + [tool.black] target-version = ['py310'] include = '\.pyi?$' diff --git a/setup.py b/setup.py deleted file mode 100644 index 875261d..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -import os - -from setuptools import find_packages, setup - - -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8").read() - - -def get_version(rel_path): - for line in read(rel_path).splitlines(): - if line.startswith("__version__"): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - raise RuntimeError("Unable to find version string.") - - -setup( - name="permuta", - version=get_version("permuta/__init__.py"), - author="Permuta Triangle", - author_email="permutatriangle@gmail.com", - description="A comprehensive high performance permutation library.", - license="BSD-3", - keywords=( - "permutation perm mesh pattern patt avoid contain occurrence" "statistic" - ), - url="https://github.com/PermutaTriangle/Permuta", - project_urls={ - "Source": "https://github.com/PermutaTriangle/Permuta", - "Tracker": "https://github.com/PermutaTriangle/Permuta/issues", - }, - packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), - package_data={"permuta": ["py.typed"]}, - long_description=read("README.rst"), - python_requires=">=3.7", - include_package_data=True, - zip_safe=False, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Education", - "Topic :: Scientific/Engineering :: Mathematics", - ], - install_requires=["automata-lib==9.0.0"], - entry_points={"console_scripts": ["permtools=permuta.cli:main"]}, -) diff --git a/tox.ini b/tox.ini index 8015fcc..63928c6 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ deps = flake8 flake8-isort commands = - flake8 --isort-show-traceback permuta tests setup.py + flake8 --isort-show-traceback permuta tests [testenv:pylint] description = run pylint (static code analysis)