Skip to content

Commit 44f4cde

Browse files
authored
Modernize packaging with pyproject.toml and hatchling (#528)
* Modernize packaging with pyproject.toml and hatchling - Replace setup.py and MANIFEST.in with comprehensive pyproject.toml using hatchling backend - Update minimum Python version to 3.10 (drop 3.8, 3.9 support) - Update GitHub Actions to v4/v5 and use python -m build - Update tox.ini: remove setup.py from flake8, use black>=22.10.0 - Update Black target version to py310 - Fix .zenodo.json syntax error (missing comma) - Add CITATION.cff for GitHub citation support - Update README.rst badges (GitHub Actions, Black, mypy) and installation instructions - Bump version to 4.1.0 * Fix Christian Bean affiliation to Keele University, fix changelog format * Apply black formatting for Python 3.10 target * Pin black==25.1.0 and apply formatting * Add Python 3.14 testing as main version * update deploy to py314
1 parent 4c0fe01 commit 44f4cde

41 files changed

Lines changed: 245 additions & 188 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v2
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.13"
15+
python-version: "3.14"
1616
- name: install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
19+
pip install build twine
2020
- name: build
21-
run: python setup.py sdist
21+
run: python -m build
2222
- name: deploy
2323
env:
2424
TWINE_USERNAME: __token__

.github/workflows/test.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
include:
12-
- python: "3.13"
12+
- python: "3.14"
1313
toxenv: flake8
1414
os: ubuntu-latest
15-
- python: "3.13"
15+
- python: "3.14"
1616
toxenv: mypy
1717
os: ubuntu-latest
18-
- python: "3.13"
18+
- python: "3.14"
1919
toxenv: pylint
2020
os: ubuntu-latest
21-
- python: "3.13"
21+
- python: "3.14"
2222
toxenv: black
2323
os: ubuntu-latest
2424

@@ -34,6 +34,9 @@ jobs:
3434
- python: "3.13"
3535
toxenv: py313
3636
os: ubuntu-latest
37+
- python: "3.14"
38+
toxenv: py314
39+
os: ubuntu-latest
3740

3841
- python: "pypy-3.10"
3942
toxenv: pypy310
@@ -42,17 +45,17 @@ jobs:
4245
toxenv: pypy311
4346
os: ubuntu-latest
4447

45-
- python: "3.13"
46-
toxenv: py313
48+
- python: "3.14"
49+
toxenv: py314
4750
os: macos-latest
48-
- python: "3.13"
49-
toxenv: py313
51+
- python: "3.14"
52+
toxenv: py314
5053
os: windows-latest
5154

5255
runs-on: ${{ matrix.os }}
5356
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions/setup-python@v2
57+
- uses: actions/checkout@v4
58+
- uses: actions/setup-python@v5
5659
with:
5760
python-version: ${{ matrix.python }}
5861
- name: Install dependencies from develop branch
@@ -61,22 +64,20 @@ jobs:
6164
echo "Installing dependencies from develop branches instead of PyPI"
6265
python -m pip install git+https://github.com/PermutaTriangle/comb_spec_searcher.git@develop
6366
python -m pip install git+https://github.com/PermutaTriangle/Permuta.git@develop
64-
65-
# Optional: Install the project in development mode to work with the new dependencies
67+
68+
# Install the project in development mode to work with the new dependencies
6669
python -m pip install -e .
67-
70+
6871
# Verify installed versions
6972
echo "Checking installed comb_spec_searcher version:"
7073
python -c "import comb_spec_searcher; print(comb_spec_searcher.__version__)"
7174
echo "Checking installed permuta version:"
7275
python -c "import permuta; print(permuta.__version__)"
7376
- name: install dependencies
74-
run: |
75-
python -m pip install --upgrade pip tox
76-
pip install setuptools wheel twine
77+
run: python -m pip install --upgrade pip tox
7778
- name: run
7879
env:
7980
TOXENV: ${{ matrix.toxenv }}
8081
run: tox
8182
- name: setup
82-
run: python setup.py install
83+
run: pip install -e .

.zenodo.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "tilings",
44
"creators": [
55
{
6-
"affiliation": "Reykjavik University",
6+
"affiliation": "Keele University",
77
"name": "Christian Bean"
88
},
99
{
@@ -20,10 +20,10 @@
2020
{
2121
"affiliation": "Marquette University",
2222
"name": "Jay Pantone"
23-
}
23+
},
2424
{
2525
"affiliation": "Reykjavik University",
2626
"name": "Henning Ulfarsson"
27-
},
27+
}
2828
]
2929
}

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77

8-
## Unreleased
8+
## [Unreleased]
9+
10+
## [4.1.0] - 2026-01-15
911
### Changed
1012
- new GriddedPerm.contains_patt function checks positions first, then pattern
1113
and as a result can lead to huge 2x - 4x speed improvement in specification
1214
finding
15+
- Migrated to modern pyproject.toml packaging with hatchling backend
16+
- Minimum Python version is now 3.10 (dropped 3.8, 3.9 support)
17+
- Updated GitHub Actions to use latest action versions (checkout@v4, setup-python@v5)
18+
- Updated Black target version to Python 3.10
19+
20+
### Removed
21+
- Removed legacy setup.py and MANIFEST.in files
1322

14-
## [4.0.0 - 2025-03-13]
23+
## [4.0.0] - 2025-03-13
1524
### Added
1625
- python3.9 are deprecated, python3.10 - python3.13 are supported
1726
- added `TileScopePack.requirement_and_row_and_col_placements`

CITATION.cff

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
type: software
4+
title: "tilings: A Python library for gridded permutations and tilings"
5+
url: "https://github.com/PermutaTriangle/Tilings"
6+
repository-code: "https://github.com/PermutaTriangle/Tilings"
7+
license: BSD-3-Clause
8+
authors:
9+
- given-names: "Christian"
10+
family-names: "Bean"
11+
affiliation: "Keele University"
12+
- given-names: "Jon Steinn"
13+
family-names: "Eliasson"
14+
affiliation: "Reykjavik University"
15+
- given-names: "Tomas Ken"
16+
family-names: "Magnusson"
17+
- given-names: "Émile"
18+
family-names: "Nadeau"
19+
affiliation: "Reykjavik University"
20+
- given-names: "Jay"
21+
family-names: "Pantone"
22+
affiliation: "Marquette University"
23+
- given-names: "Henning"
24+
family-names: "Ulfarsson"
25+
affiliation: "Reykjavik University"
26+
identifiers:
27+
- type: doi
28+
value: "10.5281/zenodo.4948344"
29+
description: "DOI for all versions"
30+
- type: url
31+
value: "https://zenodo.org/badge/latestdoi/121506164"
32+
description: "Latest Zenodo DOI"

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
Tilings
22
=======
33

4-
.. image:: https://travis-ci.org/PermutaTriangle/Tilings.svg?branch=master
5-
:alt: Travis
6-
:target: https://travis-ci.org/PermutaTriangle/Tilings
7-
.. image:: https://coveralls.io/repos/github/PermutaTriangle/Tilings/badge.svg?branch=master
4+
.. image:: https://github.com/PermutaTriangle/Tilings/actions/workflows/test.yml/badge.svg
5+
:alt: Tests
6+
:target: https://github.com/PermutaTriangle/Tilings/actions/workflows/test.yml
7+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
8+
:alt: Code style: black
9+
:target: https://github.com/psf/black
10+
.. image:: https://img.shields.io/badge/mypy-checked-blue
11+
:alt: mypy: checked
12+
:target: https://mypy-lang.org/
13+
.. image:: https://img.shields.io/coveralls/github/PermutaTriangle/Tilings.svg
814
:alt: Coveralls
9-
:target: https://coveralls.io/github/PermutaTriangle/Tilings?branch=master
15+
:target: https://coveralls.io/github/PermutaTriangle/Tilings
1016
.. image:: https://img.shields.io/pypi/v/Tilings.svg
1117
:alt: PyPI
1218
:target: https://pypi.python.org/pypi/Tilings
1319
.. image:: https://img.shields.io/pypi/l/Tilings.svg
1420
:target: https://pypi.python.org/pypi/Tilings
1521
.. image:: https://img.shields.io/pypi/pyversions/Tilings.svg
1622
:target: https://pypi.python.org/pypi/Tilings
17-
.. image:: https://requires.io/github/PermutaTriangle/Tilings/requirements.svg?branch=master
18-
:target: https://requires.io/github/PermutaTriangle/Tilings/requirements/?branch=master
19-
:alt: Requirements Status
2023
.. image:: https://zenodo.org/badge/121506164.svg
2124
:target: https://zenodo.org/badge/latestdoi/121506164
2225

@@ -54,7 +57,7 @@ development mode by cloning the repository, running
5457

5558
.. code:: bash
5659
57-
./setup.py develop
60+
pip install -e .
5861
5962
To verify that your installation is correct, you can try to get a specification for
6063
`Av(12)` by running in your terminal:

pyproject.toml

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,80 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "tilings"
7+
dynamic = ["version"]
8+
authors = [
9+
{name = "Permuta Triangle", email = "permutatriangle@gmail.com"},
10+
]
11+
description = "A Python library for gridded permutations and tilings."
12+
readme = "README.rst"
13+
license = {text = "BSD-3-Clause"}
14+
keywords = [
15+
"permutation",
16+
"perm",
17+
"gridded",
18+
"pattern",
19+
"tiling",
20+
"avoid",
21+
"contain",
22+
"occurrences",
23+
"grid",
24+
"class",
25+
]
26+
classifiers = [
27+
"Development Status :: 5 - Production/Stable",
28+
"Intended Audience :: Education",
29+
"Intended Audience :: Science/Research",
30+
"License :: OSI Approved :: BSD License",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
36+
"Programming Language :: Python :: Implementation :: CPython",
37+
"Programming Language :: Python :: Implementation :: PyPy",
38+
"Topic :: Education",
39+
"Topic :: Scientific/Engineering :: Mathematics",
40+
]
41+
requires-python = ">=3.10"
42+
dependencies = [
43+
"comb-spec-searcher>=4.2.1",
44+
"permuta>=2.3.0",
45+
]
46+
47+
[project.urls]
48+
Source = "https://github.com/PermutaTriangle/Tilings"
49+
Tracker = "https://github.com/PermutaTriangle/Tilings/issues"
50+
51+
[project.scripts]
52+
tilescope = "tilings.cli:main"
53+
54+
[tool.hatch.version]
55+
path = "tilings/__init__.py"
56+
57+
[tool.hatchling.build.targets.wheel]
58+
packages = ["tilings"]
59+
60+
[tool.hatchling.build.targets.sdist]
61+
include = [
62+
"tilings",
63+
"tests",
64+
"README.rst",
65+
"LICENSE",
66+
"CHANGELOG.md",
67+
"CITATION.cff",
68+
]
69+
170
[tool.black]
2-
target-version = ['py37']
71+
target-version = ['py310']
372
include = '\.pyi?$'
473
exclude = '''
5-
674
(
775
/(
8-
\.eggs # exclude a few common directories in the
9-
| \.git # root of the project
76+
\.eggs
77+
| \.git
1078
| \.hg
1179
| \.mypy_cache
1280
| \.tox
@@ -16,7 +84,6 @@ exclude = '''
1684
| build
1785
| dist
1886
)/
19-
| foo.py # also separately exclude a file named foo.py in
20-
# the root of the project
87+
| foo.py
2188
)
2289
'''

setup.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)