Skip to content

Commit 02c8c61

Browse files
authored
Merge pull request #322 from zopefoundation/config-with-c-code-template-acd39fc2
Config with c code template acd39fc2
2 parents d16f663 + 04c43de commit 02c8c61

23 files changed

+754
-683
lines changed

.coveragerc

-30
This file was deleted.

.github/workflows/pre-commit.yml

+33
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/action@v3.0.1
26+
with:
27+
extra_args: --all-files --show-diff-on-failure
28+
env:
29+
PRE_COMMIT_COLOR: always
30+
- uses: pre-commit-ci/lite-action@v1.0.2
31+
if: always()
32+
with:
33+
msg: Apply pre-commit code formatting

.github/workflows/tests.yml

+7-89
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
@@ -152,16 +152,10 @@ jobs:
152152
restore-keys: |
153153
${{ runner.os }}-pip-
154154
155-
- name: Install Build Dependencies (3.13)
156-
if: matrix.python-version == '3.13'
157-
run: |
158-
pip install -U pip
159-
pip install -U "setuptools<69" wheel twine
160155
- name: Install Build Dependencies
161-
if: matrix.python-version != '3.13'
162156
run: |
163157
pip install -U pip
164-
pip install -U "setuptools<69" wheel twine
158+
pip install -U "setuptools <74" wheel twine
165159
166160
- name: Build zope.interface (macOS x86_64)
167161
if: >
@@ -199,15 +193,7 @@ jobs:
199193
python setup.py build_ext -i
200194
python setup.py bdist_wheel
201195
202-
- name: Install zope.interface and dependencies (3.13)
203-
if: matrix.python-version == '3.13'
204-
run: |
205-
# Install to collect dependencies into the (pip) cache.
206-
# Use "--pre" here because dependencies with support for this future
207-
# Python release may only be available as pre-releases
208-
pip install --pre .[test]
209196
- name: Install zope.interface and dependencies
210-
if: matrix.python-version != '3.13'
211197
run: |
212198
# Install to collect dependencies into the (pip) cache.
213199
pip install .[test]
@@ -250,7 +236,6 @@ jobs:
250236
&& startsWith(github.ref, 'refs/tags')
251237
&& !startsWith(runner.os, 'Linux')
252238
&& !startsWith(matrix.python-version, 'pypy')
253-
&& !startsWith(matrix.python-version, '3.13')
254239
env:
255240
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
256241
run: |
@@ -331,7 +316,7 @@ jobs:
331316
# works fine with non-editable installs.)
332317
run: |
333318
pip install -U wheel
334-
pip install -U --no-binary :all: coverage
319+
pip install -U --no-binary :all: coverage[toml]
335320
# Unzip into src/ so that testrunner can find the .so files
336321
# when we ask it to load tests from that directory. This
337322
# might also save some build time?
@@ -371,7 +356,7 @@ jobs:
371356
runs-on: ${{ matrix.os }}
372357
strategy:
373358
matrix:
374-
python-version: ["3.9"]
359+
python-version: ["3.11"]
375360
os: [ubuntu-latest]
376361

377362
steps:
@@ -426,7 +411,7 @@ jobs:
426411
- name: Install zope.interface
427412
run: |
428413
pip install -U wheel
429-
pip install -U coverage
414+
pip install -U coverage[toml]
430415
pip install -U "`ls dist/zope.interface-*.whl`[docs]"
431416
- name: Build docs
432417
env:
@@ -435,80 +420,13 @@ jobs:
435420
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
436421
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
437422
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-
505423
manylinux:
506424
runs-on: ubuntu-latest
507425
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
508426
# We use a regular Python matrix entry to share as much code as possible.
509427
strategy:
510428
matrix:
511-
python-version: ["3.9"]
429+
python-version: ["3.11"]
512430
image: [manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64]
513431

514432
steps:

.manylinux-install.sh

+7-12
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,27 @@ yum -y install libffi-devel
2828

2929
tox_env_map() {
3030
case $1 in
31-
*"cp313"*) echo 'py313';;
3231
*"cp38"*) echo 'py38';;
3332
*"cp39"*) echo 'py39';;
3433
*"cp310"*) echo 'py310';;
3534
*"cp311"*) echo 'py311';;
3635
*"cp312"*) echo 'py312';;
36+
*"cp313"*) echo 'py313';;
3737
*) echo 'py';;
3838
esac
3939
}
4040

4141
# Compile wheels
4242
for PYBIN in /opt/python/*/bin; do
4343
if \
44-
[[ "${PYBIN}" == *"cp313/"* ]] || \
45-
[[ "${PYBIN}" == *"cp311/"* ]] || \
46-
[[ "${PYBIN}" == *"cp312/"* ]] || \
4744
[[ "${PYBIN}" == *"cp38/"* ]] || \
4845
[[ "${PYBIN}" == *"cp39/"* ]] || \
49-
[[ "${PYBIN}" == *"cp310/"* ]] ; then
50-
if [[ "${PYBIN}" == *"cp313/"* ]] ; then
51-
"${PYBIN}/pip" install --pre -e /io/
52-
"${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/
53-
else
54-
"${PYBIN}/pip" install -e /io/
55-
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
56-
fi
46+
[[ "${PYBIN}" == *"cp310/"* ]] || \
47+
[[ "${PYBIN}" == *"cp311/"* ]] || \
48+
[[ "${PYBIN}" == *"cp312/"* ]] || \
49+
[[ "${PYBIN}" == *"cp313/"* ]] ; then
50+
"${PYBIN}/pip" install -e /io/
51+
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
5752
if [ `uname -m` == 'aarch64' ]; then
5853
cd /io/
5954
${PYBIN}/pip install tox

.meta.toml

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,28 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "8d837c89"
5+
commit-id = "85622de1"
66

77
[python]
88
with-pypy = true
99
with-sphinx-doctests = true
1010
with-windows = true
11-
with-future-python = true
11+
with-future-python = false
1212
with-docs = true
1313
with-macos = false
1414

1515
[tox]
1616
use-flake8 = true
1717
testenv-commands = [
18+
"pip install -U -e .[test]",
1819
"coverage run -p -m unittest discover -s src {posargs}",
1920
]
20-
testenv-deps = [
21-
"py37: urllib3 < 2",
22-
]
2321
testenv-setenv = [
2422
"ZOPE_INTERFACE_STRICT_IRO=1",
2523
]
2624
coverage-command = "coverage combine"
2725
coverage-additional = [
28-
"depends = py37,py37-pure,py38,py38-pure,py39,py39-pure,py310,py310-pure,py311,py311-pure,pypy,pypy3,docs",
26+
"depends = py38,py38-pure,py39,py39-pure,py310,py310-pure,py311,py311-pure,py312,py312-pure,py313,py313-pure,pypy3,docs",
2927
"parallel_show_output = true",
3028
]
3129

@@ -41,15 +39,14 @@ additional-config = [
4139
]
4240

4341
[coverage]
44-
fail-under = 99
42+
fail-under = 98
4543

4644
[manifest]
4745
additional-rules = [
4846
"include *.yaml",
4947
"include *.cmd",
5048
"include *.sh",
5149
"include *.yml",
52-
"include .coveragerc",
5350
"recursive-include benchmarks *.py",
5451
"recursive-include docs *.bat",
5552
"recursive-include docs *.py",
@@ -73,7 +70,7 @@ additional-install = [
7370
" # works fine with non-editable installs.)",
7471
" run: |",
7572
" pip install -U wheel",
76-
" pip install -U --no-binary :all: coverage",
73+
" pip install -U --no-binary :all: coverage[toml]",
7774
" # Unzip into src/ so that testrunner can find the .so files",
7875
" # when we ask it to load tests from that directory. This",
7976
" # might also save some build time?",

.pre-commit-config.yaml

+28
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include *.rst
55
include *.txt
66
include buildout.cfg
77
include tox.ini
8-
include .coveragerc
8+
include .pre-commit-config.yaml
99

1010
recursive-include docs *.py
1111
recursive-include docs *.rst
@@ -17,7 +17,6 @@ include *.yaml
1717
include *.cmd
1818
include *.sh
1919
include *.yml
20-
include .coveragerc
2120
recursive-include benchmarks *.py
2221
recursive-include docs *.bat
2322
recursive-include docs *.py

0 commit comments

Comments
 (0)