Skip to content

Commit 9ab8fee

Browse files
Merge pull request #11 from sergei-maertens/chore/maintenance
Periodic package/CI pipeline maintenance
2 parents 27c7391 + b5ef1d2 commit 9ab8fee

File tree

8 files changed

+175
-170
lines changed

8 files changed

+175
-170
lines changed

.bumpversion.cfg

-8
This file was deleted.

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{scss,sass}]
11+
indent_size = 2
12+
13+
[*.{yml,yaml}]
14+
indent_size = 2
15+
16+
[Makefile]
17+
indent_style = tab
18+
19+
[*.toml]
20+
indent_size = 4

.github/workflows/ci.yml

+12-18
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python: ['3.8', '3.9', '3.10']
19-
django: ['3.2', '4.1', '4.2']
20-
include:
21-
- python: '3.11'
22-
django: '4.1'
23-
- python: '3.11'
24-
django: '4.2'
18+
python: ['3.10', '3.11', '3.12']
19+
django: ['4.2']
2520

2621
name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})
2722

28-
env:
29-
PYTHON_VERSION: ${{ matrix.python }}
30-
DJANGO: ${{ matrix.django }}
31-
3223
steps:
3324
- uses: actions/checkout@v4
3425
- uses: actions/setup-python@v5
@@ -40,16 +31,22 @@ jobs:
4031

4132
- name: Run tests
4233
run: tox
34+
env:
35+
PYTHON_VERSION: ${{ matrix.python }}
36+
DJANGO: ${{ matrix.django }}
4337

44-
- uses: codecov/codecov-action@v4
38+
- name: Publish coverage report
39+
uses: codecov/codecov-action@v5
4540
with:
4641
token: ${{ secrets.CODECOV_TOKEN }}
47-
env_vars: PYTHON_VERSION,DJANGO
4842

4943
publish:
5044
name: Publish package to PyPI
5145
runs-on: ubuntu-latest
5246
needs: tests
47+
environment: release
48+
permissions:
49+
id-token: write
5350

5451
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
5552

@@ -61,11 +58,8 @@ jobs:
6158

6259
- name: Build sdist and wheel
6360
run: |
64-
pip install pip setuptools wheel --upgrade
65-
python setup.py sdist bdist_wheel
61+
pip install build --upgrade
62+
python -m build
6663
6764
- name: Publish a Python distribution to PyPI
6865
uses: pypa/gh-action-pypi-publish@release/v1
69-
with:
70-
user: __token__
71-
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/code_quality.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ on:
66
branches:
77
- main
88
tags:
9-
paths:
10-
- '**.py'
11-
- .github/workflows/code_quality.yml
9+
- '*'
1210
pull_request:
13-
paths:
14-
- '**.py'
15-
- .github/workflows/code_quality.yml
1611
workflow_dispatch:
1712

1813
jobs:

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
author = "Sergei Maertens"
3131

3232
# The full version, including alpha/beta/rc tags
33-
release = "2.0.0.post1"
33+
release = "3.0.0-dev.0"
3434

3535

3636
# -- General configuration ---------------------------------------------------

pyproject.toml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-privates"
7+
version = "3.0.0-dev.0"
8+
description = "Simple private media integration for Django"
9+
authors = [
10+
{name = "Sergei Maertens", email = "[email protected]"}
11+
]
12+
readme = "README.rst"
13+
license = {file = "LICENSE"}
14+
keywords = ["django", "media", "private", "storage"]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Framework :: Django",
18+
"Framework :: Django :: 4.2",
19+
"Intended Audience :: Developers",
20+
"Operating System :: Unix",
21+
"Operating System :: MacOS",
22+
"Operating System :: Microsoft :: Windows",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Topic :: Software Development :: Libraries :: Python Modules",
27+
]
28+
requires-python = ">=3.10"
29+
dependencies = [
30+
"django>=4.2",
31+
"django-sendfile2>=0.5"
32+
]
33+
34+
[project.urls]
35+
Homepage = "https://github.com/sergei-maertens/django-privates"
36+
Documentation = "https://django-privates.readthedocs.io/en/latest/"
37+
"Bug Tracker" = "https://github.com/sergei-maertens/django-privates/issues"
38+
"Source Code" = "https://github.com/sergei-maertens/django-privates"
39+
40+
[project.optional-dependencies]
41+
tests = [
42+
"Pillow",
43+
"pytest",
44+
"pytest-pythonpath",
45+
"pytest-django",
46+
"pytest-cov",
47+
"tox",
48+
"pyquery",
49+
"isort",
50+
"black",
51+
"django-stubs[compatible-mypy]",
52+
]
53+
docs = [
54+
"sphinx",
55+
"sphinx-rtd-theme",
56+
]
57+
release = [
58+
"bump-my-version",
59+
]
60+
61+
[tool.setuptools.packages.find]
62+
include = ["privates*"]
63+
namespaces = true
64+
65+
[tool.isort]
66+
profile = "black"
67+
combine_as_imports = true
68+
skip = ["env", ".tox", ".history", ".eggs"]
69+
known_django = "django"
70+
known_first_party="privates"
71+
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
72+
73+
[tool.pytest.ini_options]
74+
testpaths = ["tests"]
75+
DJANGO_SETTINGS_MODULE = "testapp.settings"
76+
77+
[tool.bumpversion]
78+
current_version = "3.0.0-dev.0"
79+
files = [
80+
{filename = "pyproject.toml", search = "^version = \"{current_version}\""},
81+
{filename = "docs/conf.py"},
82+
]
83+
parse = """(?x)
84+
(?P<major>0|[1-9]\\d*)\\.
85+
(?P<minor>0|[1-9]\\d*)\\.
86+
(?P<patch>0|[1-9]\\d*)
87+
(?:
88+
- # dash separator for pre-release section
89+
(?P<pre_l>[a-zA-Z-]+)\\. # pre/post-release label
90+
(?P<pre_n>0|[1-9]\\d*) # pre/post-release version number
91+
)? # pre/post-release section is optional
92+
"""
93+
serialize = [
94+
"{major}.{minor}.{patch}-{pre_l}.{pre_n}",
95+
"{major}.{minor}.{patch}",
96+
]
97+
[tool.bumpversion.parts.pre_l]
98+
values = ["dev", "beta", "rc", "post"]
99+
optional_value = "post"
100+
101+
102+
[tool.coverage.run]
103+
branch = true
104+
source = ["privates"]
105+
omit = [
106+
# migrations run while django initializes the test db
107+
"*/migrations/*",
108+
"testapp/*",
109+
"tests/*",
110+
]
111+
112+
[tool.coverage.report]
113+
exclude_also = [
114+
"if (typing\\.)?TYPE_CHECKING:",
115+
"@(typing\\.)?overload",
116+
"class .*\\(.*Protocol.*\\):",
117+
"@(abc\\.)?abstractmethod",
118+
"raise NotImplementedError",
119+
"\\.\\.\\.",
120+
]
121+
122+
[tool.mypy]
123+
plugins = ["mypy_django_plugin.main"]
124+
125+
[tool.django-stubs]
126+
django_settings_module = "testapp.settings"
127+
128+
[[tool.mypy.overrides]]
129+
module = "django_sendfile"
130+
ignore_missing_imports = true

setup.cfg

-120
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,3 @@
1-
# setuptools config
2-
# see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
3-
[metadata]
4-
name = django-privates
5-
version = 2.0.0.post1
6-
description = Simple private media integration for Django
7-
long_description = file: README.rst
8-
url = https://github.com/sergei-maertens/django-privates
9-
license =
10-
author = Sergei Maertens
11-
author_email = [email protected]
12-
keywords = django, media, private, storage
13-
classifiers =
14-
Development Status :: 5 - Production/Stable
15-
Framework :: Django
16-
Framework :: Django :: 3.2
17-
Framework :: Django :: 4.1
18-
Framework :: Django :: 4.2
19-
Intended Audience :: Developers
20-
Operating System :: Unix
21-
Operating System :: MacOS
22-
Operating System :: Microsoft :: Windows
23-
Programming Language :: Python :: 3.8
24-
Programming Language :: Python :: 3.9
25-
Programming Language :: Python :: 3.10
26-
Programming Language :: Python :: 3.11
27-
Topic :: Software Development :: Libraries :: Python Modules
28-
29-
[options]
30-
zip_safe = False
31-
include_package_data = True
32-
packages = find:
33-
install_requires =
34-
django >= 3.2
35-
django-sendfile2 > 0.5
36-
tests_require =
37-
Pillow
38-
pytest
39-
pytest-pythonpath
40-
pytest-django
41-
tox
42-
pyquery
43-
isort
44-
black
45-
django-stubs[compatible-mypy]
46-
47-
[options.extras_require]
48-
tests =
49-
Pillow
50-
pytest
51-
pytest-pythonpath
52-
pytest-django
53-
tox
54-
pyquery
55-
isort
56-
black
57-
django-stubs[compatible-mypy]
58-
pep8 = flake8
59-
coverage = pytest-cov
60-
docs =
61-
sphinx
62-
sphinx-rtd-theme
63-
release =
64-
twine
65-
bump2version
66-
67-
[options.packages.find]
68-
include =
69-
privates
70-
privates.*
71-
exclude =
72-
tests
73-
tests.*
74-
testapp
75-
testapp.*
76-
77-
# 3rd party configuration
78-
79-
[aliases]
80-
test=pytest
81-
82-
[isort]
83-
combine_as_imports = true
84-
default_section = THIRDPARTY
85-
include_trailing_comma = true
86-
line_length = 88
87-
multi_line_output = 3
88-
skip = env,.tox,.history,.eggs
89-
skip_glob = */migrations/*
90-
known_django=django
91-
known_first_party=privates
92-
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
93-
94-
[tool:pytest]
95-
testpaths = tests
96-
DJANGO_SETTINGS_MODULE=testapp.settings
97-
junit_family=xunit1
98-
99-
[coverage:run]
100-
branch = True
101-
source = privates
102-
omit =
103-
*/migrations/*
104-
testapp/*
105-
tests/*
106-
107-
[pep8]
108-
max-line-length=119
109-
exclude=env,.tox,doc
110-
1111
[flake8]
1122
max-line-length=119
1133
exclude=env,.tox,doc
114-
115-
[mypy]
116-
plugins =
117-
mypy_django_plugin.main
118-
119-
[mypy.plugins.django-stubs]
120-
django_settings_module = "testapp.settings"
121-
122-
[mypy-django_sendfile]
123-
ignore_missing_imports = True

0 commit comments

Comments
 (0)