Skip to content

Commit

Permalink
Config with buildout recipe template (#5)
Browse files Browse the repository at this point in the history
* Drop support for Python 2.7, 3.5, 3.6.
* Add support for Python 3.11.
  • Loading branch information
Michael Howitz committed Jan 6, 2023
1 parent bd12df5 commit 9101a85
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 48 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[run]
source = z3c.recipe.mkdir
plugins = coverage_python_version
branch = true
parallel = true

Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,30 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.9", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["pypy-2.7", "pypy"]
- ["3.11", "py311"]
- ["pypy-3.7", "pypy3"]
- ["3.9", "docs"]
- ["3.9", "coverage"]

runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os[1] }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
Expand All @@ -58,7 +56,7 @@ jobs:
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ lib64
log/
parts/
pyvenv.cfg
testing.log
var/
4 changes: 2 additions & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[meta]
template = "buildout-recipe"
commit-id = "3b712f305ca8207e971c5bf81f2bdb5872489f2f"
commit-id = "d03ad585"

[python]
with-pypy = true
with-legacy-python = true
with-docs = true
with-sphinx-doctests = false
with-windows = false
with-future-python = false
with-macos = false

[coverage]
fail-under = 91
Expand Down
6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Changes
*******

0.8 (unreleased)
1.0 (unreleased)
================

- Add support for Python 3.8, 3.9, 3.10.
- Drop support for Python 2.7, 3.4. 3.5, 3.6.

- Drop support for Python 3.4.
- Add support for Python 3.8, 3.9, 3.10, 3.11.


0.7 (2018-11-16)
Expand Down
13 changes: 12 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[bdist_wheel]
universal = 1
universal = 0

[flake8]
doctests = 1
Expand All @@ -14,3 +14,14 @@ ignore =
.meta.toml
docs/_build/html/_sources/*
docs/_build/html/_static/placeholder.txt

[isort]
force_single_line = True
combine_as_imports = True
sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
known_third_party = six, docutils, pkg_resources
known_zope =
known_first_party =
default_section = ZOPE
line_length = 79
lines_after_imports = 2
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from setuptools import setup, find_packages
import os

version = '0.8.dev0'
from setuptools import find_packages
from setuptools import setup


version = '1.0.dev0'

with open("README.rst") as f:
README = f.read()
Expand All @@ -26,15 +29,12 @@
"Development Status :: 3 - Alpha",
"Framework :: Buildout",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
7 changes: 1 addition & 6 deletions src/z3c/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
7 changes: 1 addition & 6 deletions src/z3c/recipe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
1 change: 1 addition & 0 deletions src/z3c/recipe/mkdir/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os

import zc.buildout


Expand Down
9 changes: 5 additions & 4 deletions src/z3c/recipe/mkdir/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from __future__ import print_function

import doctest
import grp
import os
import pwd
import re
import stat
import unittest
import doctest

import zc.buildout.testing
from zope.testing import renormalizing


user = pwd.getpwuid(os.geteuid()).pw_name
group = grp.getgrgid(os.getegid()).gr_name

Expand All @@ -40,7 +41,7 @@ def perm(mode):
st = os.stat(path)
type_flag = stat.S_ISDIR(st.st_mode) and 'd' or '-'
permissions = type_flag + perm(st.st_mode)
return '%s %s %s %s' % (permissions, user, group, path)
return '{} {} {} {}'.format(permissions, user, group, path)


def ls_parts(dir='parts', *subs):
Expand Down Expand Up @@ -98,7 +99,7 @@ def setUp(test):
),
(re.compile("user '%s'" % user), "user 'USER'"),
(re.compile("group '%s'" % group), "group 'GROUP'"),
(re.compile("%s %s" % (user, group)), "USER GROUP"),
(re.compile("{} {}".format(user, group)), "USER GROUP"),
(re.compile(user), "USER"),
])

Expand Down
25 changes: 16 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
minversion = 3.18
envlist =
lint
py27
py35
py36
py37
py38
py39
py310
pypy
py311
pypy3
docs
coverage
Expand All @@ -27,15 +24,26 @@ extras =
[testenv:lint]
basepython = python3
skip_install = true
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 src setup.py
check-manifest
check-python-versions
deps =
flake8
check-manifest
check-python-versions >= 0.19.1
wheel
flake8
isort

[testenv:isort-apply]
basepython = python3
skip_install = true
commands_pre =
deps =
isort
commands =
flake8 src setup.py
check-manifest
check-python-versions
isort {toxinidir}/src {toxinidir}/setup.py []

[testenv:docs]
basepython = python3
Expand All @@ -54,7 +62,6 @@ setenv =
COVERAGE_PROCESS_START={toxinidir}/.coveragerc
deps =
coverage
coverage-python-version
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage erase
Expand Down

0 comments on commit 9101a85

Please sign in to comment.