Skip to content

Commit

Permalink
- update to latest meta/config templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Sep 2, 2024
1 parent e0c8be8 commit c6d71aa
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 24 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
name: pre-commit

on:
pull_request:
push:
branches:
- master
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pre-commit:
name: linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --show-diff-on-failure
env:
PRE_COMMIT_COLOR: always
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
with:
msg: Apply pre-commit code formatting
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
config:
# [Python version, tox env]
- ["3.11", "release-check"]
- ["3.11", "lint"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
Expand All @@ -33,7 +32,6 @@ jobs:
- ["3.11", "coverage"]
exclude:
- { os: ["windows", "windows-latest"], config: ["3.11", "release-check"] }
- { os: ["windows", "windows-latest"], config: ["3.11", "lint"] }
- { os: ["windows", "windows-latest"], config: ["3.11", "coverage"] }

runs-on: ${{ matrix.os[1] }}
Expand Down
5 changes: 4 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[meta]
template = "zope-product"
commit-id = "b1221c3c"
commit-id = "acd39fc2"

[python]
with-pypy = true
Expand All @@ -22,3 +22,6 @@ additional-rules = [

[tox]
use-flake8 = true

[pre-commit]
teyit-exclude = "tests/test_datetime\\.py"
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
minimum_pre_commit_version: '3.6'
repos:
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/hhatto/autopep8
rev: "v2.3.1"
hooks:
- id: autopep8
args: [--in-place, --aggressive, --aggressive]
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
hooks:
- id: teyit
exclude: tests/test_datetime\.py
- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- flake8-debugger == 4.1.2
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include *.rst
include *.txt
include buildout.cfg
include tox.ini
include .pre-commit-config.yaml

recursive-include src *.py
recursive-include src *.txt
28 changes: 7 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ envlist =
[testenv]
skip_install = true
deps =
setuptools < 69
zc.buildout >= 3.0.1
setuptools <74
zc.buildout >= 3.1
wheel > 0.37
setenv =
py312: VIRTUALENV_PIP=23.1.2
Expand All @@ -28,6 +28,7 @@ commands_pre =
commands =
{envbindir}/test {posargs:-cv}


[testenv:release-check]
description = ensure that the distribution is ready to release
basepython = python3
Expand All @@ -46,29 +47,14 @@ commands =
twine check dist/*

[testenv:lint]
description = This env runs all linters configured in .pre-commit-config.yaml
basepython = python3
commands_pre =
mkdir -p {toxinidir}/parts/flake8
allowlist_externals =
mkdir
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 {toxinidir}/src {toxinidir}/setup.py
skip_install = true
deps =
flake8
isort
# Useful flake8 plugins that are Python and Plone specific:
flake8-coding
flake8-debugger
mccabe

[testenv:isort-apply]
basepython = python3
pre-commit
commands_pre =
deps =
isort
commands =
isort {toxinidir}/src {toxinidir}/setup.py []
pre-commit run --all-files --show-diff-on-failure

[testenv:coverage]
basepython = python3
Expand Down

0 comments on commit c6d71aa

Please sign in to comment.