Skip to content

Commit 602657c

Browse files
committed
build: Migrate project configuration to pyproject.toml, update CI for newer Python versions, and add project backlog.
1 parent 1a75a1e commit 602657c

File tree

18 files changed

+138
-139
lines changed

18 files changed

+138
-139
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2.5.0
11-
- uses: actions/setup-python@v2.3.3
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
1212
with:
13-
python-version: "3.10"
13+
python-version: "3.13"
1414
architecture: "x64"
1515

16-
- name: Install Dependencies
16+
- name: Install Dependencies
1717
run: |
1818
python -m pip install --upgrade pip
1919
python -m pip install .[docs]

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ jobs:
44
run:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2.5.0
8-
- uses: actions/setup-python@v2.3.3
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-python@v5
99
with:
10-
python-version: "3.10"
10+
python-version: "3.13"
1111
architecture: "x64"
1212
- name: Install dependencies for pre-commit
1313
run: |

.github/workflows/pypi.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ jobs:
77
test:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2.5.0
11-
- uses: actions/setup-python@v2.3.3
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
1212
with:
13-
python-version: "3.10"
13+
python-version: "3.13"
1414
architecture: "x64"
1515

16-
- name: Install Dependencies
16+
- name: Install Dependencies
1717
run: |
1818
python -m pip install --upgrade pip
1919
python -m pip install --upgrade build
2020
- run: python -m build
2121
- name: Publish package to TestPyPI
22-
uses: pypa/gh-action-pypi-publish@v1.5.1
22+
uses: pypa/gh-action-pypi-publish@release/v1
2323
with:
2424
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
2525
repository_url: https://test.pypi.org/legacy/
@@ -28,19 +28,19 @@ jobs:
2828
publish:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2.5.0
32-
- uses: actions/setup-python@v2.3.3
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.10"
34+
python-version: "3.13"
3535
architecture: "x64"
3636

37-
- name: Install Dependencies
37+
- name: Install Dependencies
3838
run: |
3939
python -m pip install --upgrade pip
4040
python -m pip install --upgrade build
4141
- run: python -m build
4242
- name: Publish a Python distribution to PyPI
43-
uses: pypa/gh-action-pypi-publish@v1.5.1
43+
uses: pypa/gh-action-pypi-publish@release/v1
4444
with:
4545
password: ${{ secrets.PYPI_API_TOKEN }}
4646
verbose: true

.github/workflows/tests.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,49 @@ jobs:
66
strategy:
77
matrix:
88
os: [ubuntu-latest, macos-latest]
9-
python-version: ["3.8", "3.9", "3.10"]
9+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1010
steps:
11-
- uses: actions/[email protected]
11+
- uses: actions/checkout@v4
12+
13+
- name: Install Dependencies for macOS
14+
if: runner.os == 'macOS'
15+
run: |
16+
brew install gettext
17+
brew link --force gettext
1218
1319
- name: Set up Python${{ matrix.python-version }}
14-
uses: actions/setup-python@v2.3.3
20+
uses: actions/setup-python@v5
1521
with:
1622
python-version: ${{ matrix.python-version }}
1723
architecture: x64
1824

19-
- name: Install Dependencies for Python${{ matrix.python-version }}
25+
- name: Install Dependencies for Python${{ matrix.python-version }}
2026
run: |
2127
python -m pip install --upgrade pip
2228
python -m pip install tox
2329
- name: Test with pytest for Python${{ matrix.python-version }}
2430
run: |
25-
tox -e ${{ matrix.python-version }}
31+
tox -e py$(echo ${{ matrix.python-version }} | tr -d .)
2632
coverage:
2733
runs-on: ubuntu-latest
2834
steps:
29-
- uses: actions/checkout@v2.5.0
35+
- uses: actions/checkout@v4
3036

31-
- name: Set up Python3.10
32-
uses: actions/setup-python@v2.3.3
37+
- name: Set up Python3.13
38+
uses: actions/setup-python@v5
3339
with:
34-
python-version: "3.10"
40+
python-version: "3.13"
3541
architecture: x64
3642

37-
- name: Install Dependencies
43+
- name: Install Dependencies
3844
run: |
3945
python -m pip install --upgrade pip
4046
python -m pip install .[tests]
4147
- name: Generate coverage report
4248
run: |
4349
pytest --cov=./ --cov-report=xml
4450
- name: Upload coverage to Codecov
45-
uses: codecov/codecov-action@v3.1.1
51+
uses: codecov/codecov-action@v4
4652
with:
4753
token: ${{secrets.CODECOV_TOKEN }}
4854
verbose: true

.pre-commit-config.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
repos:
66
- repo: https://github.com/PyCQA/isort
7-
rev: 5.12.0
7+
rev: 7.0.0
88
hooks:
99
- id: isort
1010

1111
- repo: https://github.com/hakancelikdev/unimport
12-
rev: 0.16.0
12+
rev: 1.3.0
1313
hooks:
1414
- id: unimport
1515
args:
@@ -25,29 +25,25 @@ repos:
2525
args:
2626
- --refactor
2727

28-
- repo: https://github.com/myint/docformatter
29-
rev: v1.6.5
30-
hooks:
31-
- id: docformatter
32-
args: [--in-place]
28+
3329

3430
- repo: https://github.com/pre-commit/mirrors-mypy
35-
rev: v1.3.0
31+
rev: v1.19.0
3632
hooks:
3733
- id: mypy
3834
args: [--no-strict-optional, --ignore-missing-imports, --show-error-codes]
3935
additional_dependencies: [types-toml==0.1.3]
4036
exclude: "tests/"
4137

4238
- repo: https://github.com/pycqa/flake8
43-
rev: 6.0.0
39+
rev: 7.3.0
4440
hooks:
4541
- id: flake8
4642
args:
4743
- --max-line-length=120
4844

4945
- repo: https://github.com/pre-commit/pre-commit-hooks
50-
rev: v4.4.0
46+
rev: v6.0.0
5147
hooks:
5248
- id: end-of-file-fixer
5349
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html|.yml)$"

docs/tutorial/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ In here, username field will be lowered case.
298298

299299
### Custom Validation
300300
We have some built-in validators, but you can also create your own validator.
301-
For more information, see [Validators](/validators).
301+
For more information, see [Validators](validators.md).
302302

303303
```python
304304
from pydbm import DbmModel, Field

mkdocs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ markdown_extensions:
2828
- pymdownx.critic
2929
- pymdownx.details
3030
- pymdownx.emoji:
31-
emoji_index: !!python/name:materialx.emoji.twemoji
32-
emoji_generator: !!python/name:materialx.emoji.to_svg
31+
emoji_index: !!python/name:material.extensions.emoji.twemoji
32+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
3333
- pymdownx.highlight
3434
- pymdownx.inlinehilite
3535
- pymdownx.keys
@@ -52,7 +52,6 @@ markdown_extensions:
5252
plugins:
5353
- search:
5454
separator: '[\s\-\.]+'
55-
prebuild_index: true
5655
- git-revision-date-localized:
5756
type: date
5857
enable_creation_date: true

pyproject.toml

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
11
# Build system
22
[build-system]
3-
requires = [
4-
"setuptools>=65",
5-
"wheel>=0.38.4"
6-
]
3+
requires = ["setuptools>=65", "wheel>=0.38.4"]
74
build-backend = "setuptools.build_meta"
85

6+
[project]
7+
name = "pythonic-dbm"
8+
version = "0.6.1"
9+
description = "Pydbm is a more pythonic way to use dbm."
10+
readme = "README.md"
11+
requires-python = ">=3.9"
12+
license = {text = "GPL-3.0"}
13+
authors = [
14+
{name = "Hakan Celik", email = "[email protected]"}
15+
]
16+
classifiers = [
17+
"Development Status :: 3 - Alpha",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: Implementation :: CPython",
30+
"Topic :: Software Development :: Libraries :: Python Modules",
31+
]
32+
dependencies = []
33+
34+
[project.urls]
35+
Documentation = "https://pydbm.hakancelik.dev/"
36+
Issues = "https://github.com/hakancelikdev/pydbm/issues/"
37+
Changelog = "https://pydbm.hakancelik.dev/changelog"
38+
39+
[project.optional-dependencies]
40+
tests = [
41+
"pytest>=8.3.4",
42+
"pytest-cov>=6.0.0",
43+
]
44+
docs = [
45+
"mkdocs>=1.6.1",
46+
"mkdocs-material>=9.7.0",
47+
"mkdocs-markdownextradata-plugin>=0.2.6",
48+
"mkdocs-minify-plugin>=0.8.0",
49+
"mkdocs-git-revision-date-localized-plugin>=1.5.0",
50+
"mike>=2.1.3",
51+
]
52+
53+
[tool.setuptools]
54+
include-package-data = true
55+
zip-safe = true
56+
57+
[tool.setuptools.packages.find]
58+
where = ["src"]
59+
60+
[tool.setuptools.package-data]
61+
"*" = ["py.typed"]
62+
963
# Tools
1064
[tool.pytest.ini_options]
1165
addopts = "-v"
@@ -19,19 +73,13 @@ skip_gitignore = true
1973

2074
[tool.black]
2175
line-length = 120
22-
target-version = ['py39']
76+
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
2377

2478
[tool.unimport]
2579
remove = true
2680
include_star_import = true
2781
ignore_init = true
2882

29-
[tool.docformatter]
30-
recursive = true
31-
wrap-summaries = 79
32-
wrap-descriptions = 79
33-
blank = true
34-
3583
[tool.mypy]
3684
warn_unused_configs = true
3785
no_strict_optional = true

setup.cfg

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

src/pydbm/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, field_name: str, field_value: typing.Any, error: ValueError)
3131
self.error = error
3232

3333
def __str__(self) -> str:
34-
return f"Invalid value for {self.field_name}={self.field_value!r}; {self.error}."
34+
return f"Invalid value for {self.field_name}={self.field_value!r}, {self.error}."
3535

3636

3737
class EmptyModelError(PydbmBaseException):

0 commit comments

Comments
 (0)