diff --git a/.bandit b/.bandit deleted file mode 100644 index fba0d25..0000000 --- a/.bandit +++ /dev/null @@ -1,2 +0,0 @@ -[bandit] -exclude: tests diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d232a23..dd93a24 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,10 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - schedule: - interval: daily -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c8d201..f853b72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,10 @@ name: CI - on: push: branches: - master pull_request: - jobs: - - lint: - strategy: - fail-fast: false - matrix: - lint-command: - - ruff format --check . - - ruff check --output-format=github . - - django-upgrade --check `git ls-files | grep .py` - - pyupgrade `git ls-files | grep .py` - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - cache: pip - cache-dependency-path: pyproject.toml - - run: python -m pip install .[lint] - - run: ${{ matrix.lint-command }} - dist: runs-on: ubuntu-latest steps: @@ -42,7 +19,6 @@ jobs: - uses: actions/upload-artifact@v5 with: path: dist/* - docs: runs-on: ubuntu-latest steps: @@ -54,9 +30,8 @@ jobs: - run: python -m pip install sphinxcontrib-spelling - run: python -m pip install -e '.[docs]' - run: python -m sphinx -W -b spelling docs docs/_build - SQLite: - needs: [ lint, dist, docs ] + needs: [dist, docs] runs-on: ubuntu-latest strategy: matrix: @@ -81,13 +56,12 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: python-${{ matrix.python-version }} - wagtail: - needs: [ lint, dist, docs ] + needs: [dist, docs] runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.x" ] + python-version: ["3.x"] wagtail-version: - "6.3.0" - "7.0.0" @@ -105,14 +79,12 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: ${{ matrix.extras }} - - PostgreSQL: - needs: [ lint, dist, docs ] + needs: [dist, docs] runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.x" ] + python-version: ["3.x"] services: postgres: image: postgres diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88e7ad0..59051bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,14 +1,11 @@ name: Release - on: release: types: [published] workflow_dispatch: - jobs: pypi-build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 @@ -20,14 +17,12 @@ jobs: with: name: release-dists path: dist/ - pypi-publish: runs-on: ubuntu-latest needs: - pypi-build permissions: id-token: write - steps: - uses: actions/download-artifact@v6 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b51293a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,48 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: check-merge-conflict + - id: check-ast + - id: check-toml + - id: check-yaml + - id: check-symlinks + - id: debug-statements + - id: end-of-file-fixer + exclude: "mailauth/templates/registration/login_subject.txt" + - id: no-commit-to-branch + args: [--branch, main] + - repo: https://github.com/asottile/pyupgrade + rev: v3.20.0 + hooks: + - id: pyupgrade + - repo: https://github.com/adamchainz/django-upgrade + rev: 1.29.0 + hooks: + - id: django-upgrade + - repo: https://github.com/hukkin/mdformat + rev: 0.7.22 + hooks: + - id: mdformat + additional_dependencies: + - mdformat-ruff + - mdformat-deflist + - mdformat-footnote + - mdformat-gfm + - mdformat-gfm-alerts + - mdformat-tables + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.13.3 + hooks: + - id: ruff-check + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format + - repo: https://github.com/google/yamlfmt + rev: v0.19.0 + hooks: + - id: yamlfmt +ci: + autoupdate_schedule: weekly + skip: + - no-commit-to-branch diff --git a/.readthedocs.yaml b/.readthedocs.yaml index bb73bc5..c49bf5f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,17 +1,13 @@ # .readthedocs.yaml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - version: 2 - build: os: ubuntu-20.04 tools: python: "3.11" - sphinx: configuration: docs/conf.py - python: install: - method: pip diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 9664db7..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include *.rst -recursive-include mailauth/templates * -recursive-include mailauth/contrib/admin/templates * -recursive-include mailauth/contrib/admin/static * -recursive-include mailauth/contrib/admin/locale * -recursive-include mailauth/contrib/user/locale * diff --git a/pyproject.toml b/pyproject.toml index 0b264d4..d946996 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,11 +52,6 @@ test = [ "pytest-cov", "pytest-django", ] -lint = [ - "ruff==0.14.2", - "pyupgrade==3.21.0", - "django-upgrade==1.29.1", -] docs = [ "sphinx", ]