Skip to content

Commit d2702a2

Browse files
committed
Switch to use pyproject.toml
1 parent a1bfd6c commit d2702a2

7 files changed

Lines changed: 111 additions & 111 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
name: Test
2-
3-
on:
4-
push:
5-
branches: [main, develop]
6-
2+
on: [push, pull_request]
73
jobs:
84
build:
95
runs-on: ubuntu-latest
106
strategy:
117
matrix:
12-
python-version: ["3.10", "3.11", "3.12"]
13-
8+
python-version: ["3.10", "3.11", "3.12", "3.13"]
149
steps:
15-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v4
1611
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
12+
uses: actions/setup-python@v4
1813
with:
1914
python-version: ${{ matrix.python-version }}
2015
- name: Install dependencies

pyproject.toml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[build-system]
2+
requires = ["setuptools>=77.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-travel"
7+
dynamic = ["version"]
8+
description = "A travelogue and bucket list app for Django"
9+
license = "MIT"
10+
license-files = ["LICENSE"]
11+
readme = { file = "README.rst", content-type = "text/x-rst" }
12+
keywords = ["django", "travel", "bucketlist"]
13+
authors = [
14+
{ name = "David Krauth", email = "dakrauth@gmail.com" },
15+
]
16+
requires-python = ">=3.10"
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"Environment :: Web Environment",
20+
"Framework :: Django",
21+
"Framework :: Django :: 4.2",
22+
"Framework :: Django :: 5.1",
23+
"Framework :: Django :: 5.2",
24+
"Intended Audience :: Developers",
25+
"Operating System :: OS Independent",
26+
"Programming Language :: Python",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Topic :: Utilities",
31+
"Topic :: Education",
32+
]
33+
34+
dependencies = [
35+
"Django>=4.2,<6.0",
36+
"django-bootstrap5",
37+
"python-dateutil",
38+
"djangorestframework",
39+
"django-vanilla-views",
40+
]
41+
42+
[project.urls]
43+
Homepage = "https://github.com/dakrauth/django-travel"
44+
45+
[project.optional-dependencies]
46+
test = [
47+
"pytest",
48+
"coverage",
49+
"pytest-django",
50+
"pytest-cov",
51+
]
52+
dev = [
53+
"tox",
54+
"build",
55+
"ipython",
56+
"ipdb",
57+
"twine",
58+
"ruff",
59+
"django-extensions",
60+
"pytest-sugar",
61+
"pytest-clarity"
62+
]
63+
64+
[tool.setuptools]
65+
package-dir = {"" = "src"}
66+
packages = ["travel", "travel.templatetags", "travel.migrations", "travel.extras", "travel.api"]
67+
68+
[tool.setuptools.dynamic]
69+
version = { attr = "travel.version.__version__"}
70+
71+
[tool.black]
72+
line-length = 100
73+
74+
[tool.ruff]
75+
cache-dir = ".dev/ruff"
76+
line-length = 100
77+
indent-width = 4
78+
79+
[tool.ruff.lint]
80+
ignore = ["E741"]

setup.cfg

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

setup.py

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

src/travel/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
VERSION = (0, 51, 0)
2-
3-
4-
def get_version():
5-
return ".".join(map(str, VERSION))

src/travel/version.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__version__ = "0.60.0"
2+
VERSION = tuple(int(i) for i in __version__.split("."))
3+
4+
5+
def get_version():
6+
return __version__

tox.ini

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ isolated_build = true
33
skip_missing_interpreters = true
44
parallel_show_output = true
55
envlist =
6-
py{310,311,312}-dj{42,51}
6+
py{310,311,312}-dj42
7+
py{310,311,312,313}-dj{51,52}
78

89
[pytest]
910
testpaths = test
@@ -29,36 +30,7 @@ deps =
2930
pytest-django
3031
dj42: Django>=4.2.0,<5.0
3132
dj51: Django>=5.1,<5.2
32-
33-
[testenv:pep8]
34-
description = Run flake8 against the source code
35-
skipsdist = true
36-
skip_install = true
37-
basepython = python3.12
38-
deps = flake8
39-
commands = flake8 src/travel test demo
40-
41-
[testenv:clean]
42-
description=Removes all the cache files
43-
skipdist = true
44-
skip_install = true
45-
deps =
46-
whitelist_externals =
47-
find
48-
rm
49-
commands =
50-
rm -rf \
51-
{toxinidir}/build \
52-
{toxinidir}/.cache \
53-
{toxinidir}/.coverage \
54-
{toxinidir}/pip-wheel-metadata \
55-
{toxinidir}/.pytest_cache \
56-
{toxinidir}/.tox \
57-
{toxinidir}/demo/demo_proj/db.sqlite3 \
58-
{toxinidir}/htmlcov \
59-
{toxinidir}/src/django_travel.egg-info
60-
find {toxinidir} -type f -name "*.pyc" -delete
61-
find {toxinidir} -type d -name "__pycache__" -delete
33+
dj52: Django>=5.2,<6.0
6234

6335
[testenv:coverage]
6436
description = Run test coverage and display results
@@ -74,8 +46,26 @@ commands =
7446
pytest --cov-config .coveragerc --cov-report html --cov-report term --cov=travel
7547
echo HTML coverage report: {toxinidir}/htmlcov/index.html
7648

49+
[flake8]
50+
# E128: continuation line under-indented for visual indent
51+
# E124: closing bracket does not match visual indentation
52+
# E126: continuation line over-indented for hanging indent
53+
# W503: line break occurred before a binary operator
54+
# W504 line break after binary operator
55+
ignore = E128,E124,E126,W503,W504
56+
max-line-length = 100
57+
exclude =
58+
.git,
59+
__pycache__,
60+
*/migrations/*
61+
62+
[coverage:run]
63+
omit =
64+
*/migrations/*
65+
7766
[gh-actions]
7867
python =
7968
3.10: py310
8069
3.11: py311
8170
3.12: py312
71+
3.13: py313

0 commit comments

Comments
 (0)