Skip to content

Commit 177c0c8

Browse files
kashewnutsclaude
andcommitted
setup.pyからpyproject.tomlへ移行し、Python 3.12~3.14とDjango 5.2をサポート
- setup.py/setup.cfgを削除し、pyproject.tomlへ移行 - tox.iniをpyproject.tomlのlegacy_tox_iniへ移植 - Python 3.12, 3.13, 3.14サポート追加 - Django 5.2サポート追加 - Python 3.8, 3.9サポート終了 - Django 3.2, 4.1, 5.1サポート終了 - namespace packageをpkg_resourcesから暗黙的namespace packageに変更 - CI設定をPython/Djangoの新マトリクスに更新 - ChangeLog.rst, checklist.rstを更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0db0be3 commit 177c0c8

File tree

12 files changed

+105
-121
lines changed

12 files changed

+105
-121
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,32 @@ jobs:
1010
fail-fast: false
1111
max-parallel: 5
1212
matrix:
13-
python-version: ['3.8', '3.9', '3.10', '3.11']
14-
django-version: ['3.2', '4.1', '4.2']
13+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
14+
django-version: ['4.2', '5.2']
15+
exclude:
16+
- python-version: '3.13'
17+
django-version: '4.2'
18+
- python-version: '3.14'
19+
django-version: '4.2'
1520

1621
steps:
17-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v6
1823

1924
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
25+
uses: actions/setup-python@v6
2126
with:
2227
python-version: ${{ matrix.python-version }}
2328

2429
- name: Get pip cache dir
2530
id: pip-cache
2631
run: |
27-
echo "::set-output name=dir::$(pip cache dir)"
32+
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
2833
- name: Cache
29-
uses: actions/cache@v2
34+
uses: actions/cache@v5
3035
with:
3136
path: ${{ steps.pip-cache.outputs.dir }}
3237
key:
33-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
38+
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}
3439
restore-keys: |
3540
${{ matrix.python-version }}-v1-
3641
- name: Install dependencies

ChangeLog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ ChangeLog
44

55
Release 0.43 (Unreleased)
66
==========================
7+
- Support Python-3.12, 3.13, 3.14
8+
- Support Django-4.2, 5.2
9+
- Drop Python-3.8, 3.9
10+
- Drop Django-3.2, 4.1, 5.1
11+
- Migrate packaging from setup.py to pyproject.toml
712

813
Release 0.42 (2023-01-24)
914
==========================

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Run tests using tox::
1212

1313
Supports
1414
========
15-
- Python: 3.6, 3.7, 3.8, 3.9, 3.10
16-
- Django: 2.2, 3.2
15+
- Python: 3.10, 3.11, 3.12, 3.13, 3.14
16+
- Django: 4.2, 5.2
1717

1818
Links
1919
=====

beproud/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
2-
try:
3-
__import__('pkg_resources').declare_namespace(__name__)
4-
except ImportError:
5-
from pkgutil import extend_path
6-
__path__ = locals()['__path__'] # make PyFlakes happy
7-
__path__ = extend_path(__path__, __name__)

beproud/django/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
2-
try:
3-
__import__('pkg_resources').declare_namespace(__name__)
4-
except ImportError:
5-
from pkgutil import extend_path
6-
__path__ = locals()['__path__'] # make PyFlakes happy
7-
__path__ = extend_path(__path__, __name__)

beproud/django/commons/test/simple.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __str__(self):
2626
class RequestTestCase(TestCase):
2727

2828
def assertStatus(self, response, status=200):
29-
self.assertEquals(response.status_code, status)
29+
self.assertEqual(response.status_code, status)
3030

3131
def assertOk(self, response):
3232
self.assertStatus(response)
@@ -70,12 +70,12 @@ def assertNotFound(self, response):
7070
self.assertStatus(response, 404)
7171

7272
def assertNotAllowed(self, response, allow=None):
73-
self.assertEquals(response.status_code, 405)
73+
self.assertEqual(response.status_code, 405)
7474
if allow is not None:
75-
self.assertEquals(response["Allow"], allow)
75+
self.assertEqual(response["Allow"], allow)
7676

7777
def assertGone(self, response):
78-
self.assertEquals(response.status_code, 410)
78+
self.assertEqual(response.status_code, 410)
7979

8080
def assertHtml(self, response):
8181
self.assertContains(response, "<html") # open tag
@@ -103,7 +103,7 @@ def _assertLocationHeader(self, response, redirect_url=None):
103103
if redirect_url is None:
104104
self.assertTrue(response.get("Location", None) is not None)
105105
else:
106-
self.assertEquals(response.get("Location", None), redirect_url)
106+
self.assertEqual(response.get("Location", None), redirect_url)
107107

108108

109109
class BaseURLTestCase(type):

checklist.rst

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

55
1. check CI status testing result: https://github.com/beproud/bpcommons/actions
66
2. update release version/date in ``ChangeLog.rst``
7-
3. run ``python setup.py release sdist bdist_wheel``
8-
4. check ``twine check dist/*``
9-
5. upload ``twine upload dist/*``
10-
6. tagging version e.g. ``git tag v0.40``.
11-
7. check PyPI page: https://pypi.org/p/beproud.django.commons/
12-
8. bump versions and commit/push them onto GitHub
7+
3. run ``python -m build .``
8+
4. check ``twine check --strict dist/*``
9+
5. upload testpypi ``twine upload --repository testpypi dist/*``
10+
6. check description, and uploaded build package.
11+
7. upload ``twine upload dist/*``
12+
8. tagging version e.g. ``git tag v0.40``.
13+
9. check PyPI page: https://pypi.org/p/beproud.django.commons/
14+
10. bump versions and commit/push them onto GitHub
1315

1416
* ``ChangeLog.rst`` next version
15-
* ``bpcommons/beproud/django/commons/__init__.py`` next version
17+
* ``beproud/django/commons/__init__.py`` next version
18+
* ``pyproject.toml`` next version

pyproject.toml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[build-system]
2+
requires = ["setuptools>=77.0.3", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "beproud.django.commons"
7+
version = "0.43"
8+
description = "Common utilities for Django"
9+
readme = "README.rst"
10+
authors = [
11+
{ name = "BeProud Inc.", email = "project@beproud.jp" },
12+
]
13+
classifiers = [
14+
"Development Status :: 3 - Alpha",
15+
"Environment :: Plugins",
16+
"Framework :: Django",
17+
"Framework :: Django :: 4.2",
18+
"Framework :: Django :: 5.2",
19+
"Intended Audience :: Developers",
20+
"License :: OSI Approved :: BSD License",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
29+
"Topic :: Software Development :: Libraries :: Python Modules",
30+
]
31+
dependencies = [
32+
"Django>=4.2", "six",
33+
]
34+
35+
[project.urls]
36+
Homepage = "http://www.beproud.jp/"
37+
38+
[tool.setuptools.packages.find]
39+
where = ["."]
40+
41+
[tool.tox]
42+
legacy_tox_ini = """
43+
[tox]
44+
envlist = py{310,311,312}-dj{42,52},py{313,314}-dj52
45+
46+
[testenv]
47+
deps =
48+
pytest
49+
pytest-django
50+
factory-boy
51+
six
52+
BeautifulSoup4==4.10.0
53+
dj42: Django>=4.2,<5.0
54+
dj52: Django>=5.2,<6.0
55+
56+
commands=pytest tests {posargs}
57+
58+
[gh-actions]
59+
python =
60+
3.10: py310
61+
3.11: py311
62+
3.12: py312
63+
3.13: py313
64+
3.14: py314
65+
66+
[gh-actions:env]
67+
DJANGO =
68+
4.2: dj42
69+
5.2: dj52
70+
"""

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)