Skip to content

Commit 94fd4cb

Browse files
committed
- update package configurations from latest meta/config templates
1 parent 6ffccef commit 94fd4cb

File tree

6 files changed

+76
-88
lines changed

6 files changed

+76
-88
lines changed

.github/workflows/pre-commit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/c-code
3+
name: pre-commit
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
# Allow to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
FORCE_COLOR: 1
15+
16+
jobs:
17+
pre-commit:
18+
name: linting
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.x
25+
- uses: pre-commit/[email protected]
26+
with:
27+
extra_args: --all-files --show-diff-on-failure
28+
env:
29+
PRE_COMMIT_COLOR: always
30+
- uses: pre-commit-ci/[email protected]
31+
if: always()
32+
with:
33+
msg: Apply pre-commit code formatting

.github/workflows/tests.yml

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Original comment follows.
1010
###
1111
###
12-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
12+
# This workflow will install Python dependencies, run tests with a variety of Python versions
1313
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1414
###
1515

@@ -81,7 +81,7 @@ jobs:
8181
# other people to test/debug), the strategy is to divide the process
8282
# into several different jobs. The first builds and saves the binary
8383
# wheels. It has dependent jobs that download and install the wheel
84-
# to run tests, build docs, and perform linting. Building the
84+
# to run tests, and build docs. Building the
8585
# manylinux wheels is an independent set of jobs.
8686
#
8787
# This division is time-saving for projects that take awhile to
@@ -156,12 +156,12 @@ jobs:
156156
if: matrix.python-version == '3.13'
157157
run: |
158158
pip install -U pip
159-
pip install -U "setuptools<69" wheel twine
159+
pip install -U "setuptools <74" wheel twine
160160
- name: Install Build Dependencies
161161
if: matrix.python-version != '3.13'
162162
run: |
163163
pip install -U pip
164-
pip install -U "setuptools<69" wheel twine
164+
pip install -U "setuptools <74" wheel twine
165165
166166
- name: Build zope.interface (macOS x86_64)
167167
if: >
@@ -371,7 +371,7 @@ jobs:
371371
runs-on: ${{ matrix.os }}
372372
strategy:
373373
matrix:
374-
python-version: ["3.9"]
374+
python-version: ["3.11"]
375375
os: [ubuntu-latest]
376376

377377
steps:
@@ -435,80 +435,13 @@ jobs:
435435
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
436436
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
437437
438-
lint:
439-
needs: build-package
440-
runs-on: ${{ matrix.os }}
441-
strategy:
442-
matrix:
443-
python-version: ["3.9"]
444-
os: [ubuntu-latest]
445-
446-
steps:
447-
- name: checkout
448-
uses: actions/checkout@v4
449-
- name: Set up Python ${{ matrix.python-version }}
450-
uses: actions/setup-python@v5
451-
with:
452-
python-version: ${{ matrix.python-version }}
453-
allow-prereleases: true
454-
###
455-
# Caching.
456-
# This actually *restores* a cache and schedules a cleanup action
457-
# to save the cache. So it must come before the thing we want to use
458-
# the cache.
459-
###
460-
- name: Get pip cache dir (default)
461-
id: pip-cache-default
462-
if: ${{ !startsWith(runner.os, 'Windows') }}
463-
run: |
464-
echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT
465-
466-
- name: Get pip cache dir (Windows)
467-
id: pip-cache-windows
468-
if: ${{ startsWith(runner.os, 'Windows') }}
469-
run: |
470-
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
471-
472-
- name: pip cache (default)
473-
uses: actions/cache@v4
474-
if: ${{ !startsWith(runner.os, 'Windows') }}
475-
with:
476-
path: ${{ steps.pip-cache-default.outputs.dir }}
477-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
478-
restore-keys: |
479-
${{ runner.os }}-pip-
480-
481-
- name: pip cache (Windows)
482-
uses: actions/cache@v4
483-
if: ${{ startsWith(runner.os, 'Windows') }}
484-
with:
485-
path: ${{ steps.pip-cache-windows.outputs.dir }}
486-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
487-
restore-keys: |
488-
${{ runner.os }}-pip-
489-
490-
- name: Download zope.interface wheel
491-
uses: actions/download-artifact@v4
492-
with:
493-
name: zope.interface-${{ runner.os }}-${{ matrix.python-version }}.whl
494-
path: dist/
495-
- name: Install zope.interface
496-
run: |
497-
pip install -U pip
498-
pip install -U wheel
499-
pip install -U `ls dist/zope.interface-*`[test]
500-
- name: Lint
501-
run: |
502-
pip install -U tox
503-
tox -e lint
504-
505438
manylinux:
506439
runs-on: ubuntu-latest
507440
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
508441
# We use a regular Python matrix entry to share as much code as possible.
509442
strategy:
510443
matrix:
511-
python-version: ["3.9"]
444+
python-version: ["3.11"]
512445
image: [manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64]
513446

514447
steps:
@@ -589,6 +522,8 @@ jobs:
589522
name: manylinux_${{ matrix.image }}_wheels.zip
590523
- name: Restore pip cache permissions
591524
run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }}
525+
- name: Prevent publishing wheels for unreleased Python versions
526+
run: VER=$(echo '3.13' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse
592527
- name: Publish package to PyPI
593528
uses: pypa/gh-action-pypi-publish@release/v1
594529
if: >

.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "8d837c89"
5+
commit-id = "acd39fc2"
66

77
[python]
88
with-pypy = true

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/c-code
3+
minimum_pre_commit_version: '3.6'
4+
repos:
5+
- repo: https://github.com/pycqa/isort
6+
rev: "5.13.2"
7+
hooks:
8+
- id: isort
9+
- repo: https://github.com/hhatto/autopep8
10+
rev: "v2.3.1"
11+
hooks:
12+
- id: autopep8
13+
args: [--in-place, --aggressive, --aggressive]
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v3.17.0
16+
hooks:
17+
- id: pyupgrade
18+
args: [--py38-plus]
19+
- repo: https://github.com/isidentical/teyit
20+
rev: 0.4.3
21+
hooks:
22+
- id: teyit
23+
- repo: https://github.com/PyCQA/flake8
24+
rev: "7.1.1"
25+
hooks:
26+
- id: flake8
27+
additional_dependencies:
28+
- flake8-debugger == 4.1.2

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include *.rst
55
include *.txt
66
include buildout.cfg
77
include tox.ini
8+
include .pre-commit-config.yaml
89
include .coveragerc
910

1011
recursive-include docs *.py

tox.ini

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ envlist =
1515
coverage
1616

1717
[testenv]
18-
usedevelop = true
1918
pip_pre = py313: true
2019
deps =
21-
setuptools < 69
20+
setuptools <74
2221
py37: urllib3 < 2
2322
Sphinx
2423
setenv =
@@ -50,6 +49,7 @@ commands =
5049
coverage report -i -m --fail-under=99
5150
depends = py37,py37-pure,py38,py38-pure,py39,py39-pure,py310,py310-pure,py311,py311-pure,pypy,pypy3,docs
5251
parallel_show_output = true
52+
5353
[testenv:release-check]
5454
description = ensure that the distribution is ready to release
5555
basepython = python3
@@ -68,23 +68,14 @@ commands =
6868
twine check dist/*
6969

7070
[testenv:lint]
71+
description = This env runs all linters configured in .pre-commit-config.yaml
7172
basepython = python3
7273
skip_install = true
7374
deps =
74-
isort
75-
flake8
76-
commands =
77-
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
78-
flake8 src setup.py
79-
80-
[testenv:isort-apply]
81-
basepython = python3
82-
skip_install = true
75+
pre-commit
8376
commands_pre =
84-
deps =
85-
isort
8677
commands =
87-
isort {toxinidir}/src {toxinidir}/setup.py []
78+
pre-commit run --all-files --show-diff-on-failure
8879

8980
[testenv:docs]
9081
basepython = python3

0 commit comments

Comments
 (0)