Skip to content

Commit

Permalink
Prune the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 11, 2024
1 parent 5abbe11 commit 49f8ea8
Show file tree
Hide file tree
Showing 11 changed files with 654 additions and 61 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down
29 changes: 19 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,35 @@ 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
- id: ruff-format
- repo: https://github.com/biomejs/pre-commit
rev: "v0.4.0"
hooks:
- id: biome-check
additional_dependencies: ["@biomejs/[email protected]"]
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 [email protected] --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 @@ -8,6 +8,7 @@ Next version

- Added support for setting ``IMAGEFIELD_AUTOGENERATE = False``. Previously,
only ``True`` or an iterable were supported.
- Dropped compatibility with Python 3.8 and 3.9.


0.19 (2024-08-03)
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 imagefield/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _process_context(self, processors):
return context

def process(self, spec, *, force=False):
if isinstance(spec, (list, tuple)):
if isinstance(spec, list | tuple):
processors = spec
spec = "<ad hoc>"
elif callable(spec):
Expand Down
2 changes: 1 addition & 1 deletion imagefield/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def build_handler(processors, handler=None):
handler = handler or (lambda image, context: image)

for part in reversed(processors):
if isinstance(part, (list, tuple)):
if isinstance(part, list | tuple):
handler = PROCESSORS[part[0]](handler, *part[1:])
else:
handler = PROCESSORS[part](handler)
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"
}
}
10 changes: 2 additions & 8 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 = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.10"
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
Expand All @@ -21,8 +21,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -51,7 +49,7 @@ include = [
path = "imagefield/__init__.py"

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

fix = true
show-fixes = true
Expand All @@ -75,8 +73,6 @@ lint.extend-select = [
"INT",
# flake8-implicit-string-concatenation
"ISC",
# pep8-naming
"N",
# pygrep-hooks
"PGH",
# flake8-pie
Expand All @@ -87,8 +83,6 @@ lint.extend-select = [
"PLW",
# unused noqa
"RUF100",
# flake8-simplify
"SIM",
# pyupgrade
"UP",
"W",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{38,39,310}-dj{32,42}
py{310}-dj{32,42}
py{310,311,312}-dj{32,42,50,51,main}
docs

Expand Down
Loading

0 comments on commit 49f8ea8

Please sign in to comment.