Skip to content

Commit

Permalink
It's time to leave the past behind
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 11, 2024
1 parent bb16c48 commit 7a2b8c4
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 62 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down
30 changes: 20 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,36 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.18.0
rev: 1.21.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.9"
rev: "v0.6.4"
hooks:
- id: ruff
args: [--unsafe-fixes]
- id: ruff-format
- repo: https://github.com/biomejs/pre-commit
rev: "v0.4.0"
hooks:
- id: biome-check
additional_dependencies: ["@biomejs/biome@1.8.1"]
args: [--unsafe]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
rev: 2.2.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.19
hooks:
- id: validate-pyproject
- repo: local
hooks:
- id: prettier
name: prettier
entry: npx prettier@3.3.3 --no-semi --write
language: system
types_or: [css, scss]
require_serial: true
- id: eslint
name: eslint
entry: yarn eslint
language: system
types_or: [javascript]
require_serial: true
verbose: true
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Next version
- Added support for embedding content from the SRF (the Swiss television
broadcast company).
- Lifted the move status indicator above the nav sidebar.
- Dropped compatibility with Python 3.9.


5.2 (2024-06-07)
Expand Down
38 changes: 0 additions & 38 deletions biome.json

This file was deleted.

17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from "globals";
import pluginJs from "@eslint/js";


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "script"}},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
{
rules: {
"no-unused-vars": [
"error",
{argsIgnorePattern: "^_", varsIgnorePattern: "^_"}
]
},
},
];
2 changes: 1 addition & 1 deletion feincms3/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def reverse_app(namespaces, viewname, *args, languages=None, **kwargs):
f"{_APPS_MODEL.LANGUAGE_CODES_NAMESPACE}-{language}"
for language in languages
),
(namespaces if isinstance(namespaces, (list, tuple)) else (namespaces,)),
(namespaces if isinstance(namespaces, list | tuple) else (namespaces,)),
(viewname,),
)
]
Expand Down
2 changes: 1 addition & 1 deletion feincms3/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def render_in_context(context, template, local_context=None):
except AttributeError:
engine = Engine.get_default()

if isinstance(template, (list, tuple)):
if isinstance(template, list | tuple):
template = engine.select_template(template)
else:
template = engine.get_template(template)
Expand Down
2 changes: 1 addition & 1 deletion feincms3/templatetags/feincms3.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def render(self, context):
namespaces = self.namespaces.resolve(context)
view_name = self.view_name.resolve(context)
fallback = kwargs.pop("fallback", None)
if not isinstance(namespaces, (list, tuple)):
if not isinstance(namespaces, list | tuple):
namespaces = namespaces.split(",")
# Try to look up the URL. If it fails, raise NoReverseMatch unless the
# {% reverse ... as var %} construct is used, in which case return
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "module",
"devDependencies": {
"@eslint/js": "^9.10.0",
"eslint": "^9.10.0",
"globals": "^15.9.0"
}
}
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = { text = "BSD-3-Clause" }
authors = [
{ name = "Matthias Kestenholz", email = "mk@feinheit.ch" },
]
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
Expand All @@ -21,7 +21,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -65,7 +64,7 @@ include = [
]

[tool.ruff]
target-version = "py39"
target-version = "py310"

fix = true
show-fixes = true
Expand All @@ -89,8 +88,6 @@ lint.extend-select = [
"INT",
# flake8-implicit-string-concatenation
"ISC",
# pep8-naming
"N",
# pygrep-hooks
"PGH",
# flake8-pie
Expand All @@ -101,8 +98,6 @@ lint.extend-select = [
"PLW",
# unused noqa
"RUF100",
# flake8-simplify
"SIM",
# pyupgrade
"UP",
"W",
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{39,310}-dj{32,41,42}
py{310,311,312}-dj{32,41,42,50,main}
py{310}-dj{32,42}
py{310,311,312}-dj{32,42,50,51,main}
docs
slowtests

Expand All @@ -13,9 +13,9 @@ commands =
coverage report -m
deps =
dj32: Django>=3.2,<4.0
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj50: Django>=5.0,<5.1
dj51: Django>=5.1,<5.2
djmain: https://github.com/django/django/archive/main.tar.gz

[testenv:docs]
Expand Down

0 comments on commit 7a2b8c4

Please sign in to comment.