Skip to content

Commit

Permalink
Drop support for Python 2.7, 3.5, 3.6; add support for Python 3.9, 3…
Browse files Browse the repository at this point in the history
….10, 3.11. (#9)
  • Loading branch information
Michael Howitz committed Dec 20, 2022
1 parent f1b2908 commit 9c19cac
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 57 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,29 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.8", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["pypy2", "pypy"]
- ["pypy3", "pypy3"]
- ["3.8", "coverage"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["pypy-3.7", "pypy3"]
- ["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 Down
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/
3 changes: 2 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[meta]
template = "buildout-recipe"
commit-id = "07ca2c5c2ba0c3cb369f3ef5c0de595df1246225"
commit-id = "cc836c39"

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

[coverage]
fail-under = 95
Expand Down
8 changes: 5 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Release History
=================

3.1.0 (unreleased)
==================
4.0 (unreleased)
================

- Drop support for Python 2.7, 3.5, 3.6.

- Add support for Python 3.9.
- Add support for Python 3.9, 3.10, 3.11.


3.0.0 (2019-03-30)
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
Generated from:
https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
-->
# Contributing to zopefoundation projects

The projects under the zopefoundation GitHub organization are open source and
welcome contributions in different forms:

* bug reports
* code improvements and bug fixes
* documentation improvements
* pull request reviews

For any changes in the repository besides trivial typo fixes you are required
to sign the contributor agreement. See
https://www.zope.dev/developer/becoming-a-committer.html for details.

Please visit our [Developer
Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to
contribute code changes and our [guidelines for reporting
bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a
bug report.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
include *.md
include *.rst
include *.txt
include buildout.cfg
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 @@ -12,3 +12,14 @@ builtins = write, system, cat, join
ignore =
.editorconfig
.meta.toml

[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
26 changes: 13 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
##############################################################################

import os
from setuptools import setup, find_packages

from setuptools import find_packages
from setuptools import setup


def read(*rnames):
Expand All @@ -25,28 +27,26 @@ def read(*rnames):

setup(
name=name,
version='3.1.0.dev0',
version='4.0.dev0',
author="Jim Fulton",
author_email="jim@zope.com",
description="ZC Buildout recipe for configure/make/make install",
license="ZPL 2.1",
keywords="zc.buildout buildout recipe cmmi configure make install",
classifiers=[
"Environment :: Plugins",
"Framework :: Buildout",
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Topic :: Software Development :: Build Tools",
"Topic :: System :: Software Distribution",
'Environment :: Plugins',
'Framework :: Buildout',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Topic :: Software Development :: Build Tools',
'Topic :: System :: Software Distribution',
'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',
'Natural Language :: English',
Expand Down Expand Up @@ -75,7 +75,7 @@ def read(*rnames):
packages=find_packages('src'),
include_package_data=True,
namespace_packages=['zc', 'zc.recipe'],
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
python_requires='>=3.7',
install_requires=[
'zc.buildout >= 2.9.4',
'setuptools'],
Expand Down
2 changes: 1 addition & 1 deletion src/zc/recipe/cmmi/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ is logged to stdout, and left intact for debugging purposes.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
...
CalledProcessError: Command 'patch -p0 < ...' returned non-zero exit status ...
subprocess.CalledProcessError: Command 'patch -p0 < ...' returned non-zero exit status ...
<BLANKLINE>

>>> import re
Expand Down
14 changes: 8 additions & 6 deletions src/zc/recipe/cmmi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@
##############################################################################


from hashlib import sha1
import logging
import os
import os.path
import re
import subprocess
import setuptools.archive_util
import shutil
import subprocess
import tempfile
from hashlib import sha1

import setuptools.archive_util
import zc.buildout
import zc.buildout.download


almost_environment_setting = re.compile(r'\w+=').match
not_starting_with_digit = re.compile(r'\D').match

Expand All @@ -33,7 +35,7 @@ def system(c):
subprocess.check_call(c, shell=True)


class Recipe(object):
class Recipe:

def __init__(self, buildout, name, options):
self.buildout, self.name, self.options = buildout, name, options
Expand Down Expand Up @@ -104,7 +106,7 @@ def _state_hash(self):
# ./configure options will get a different build directory.
# Be sure to sort to keep a consistent order, since dictionary
# iteration order is never guaranteed.
env = ''.join(['%s%s' % (key, value) for key, value
env = ''.join(['{}{}'.format(key, value) for key, value
in sorted(self.environ.items())])
state = [self.url, self.extra_options, self.autogen,
self.patch, self.patch_options, env]
Expand Down Expand Up @@ -221,6 +223,6 @@ def cmmi(self, dest):
options = '--prefix="%s"' % dest
if self.extra_options:
options += ' %s' % self.extra_options
system("%s %s" % (self.configure_cmd, options))
system("{} {}".format(self.configure_cmd, options))
system("make")
system("make install")
17 changes: 6 additions & 11 deletions src/zc/recipe/cmmi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
#
##############################################################################

import doctest
import os
import re
from io import BytesIO as _BytesIO
import sys
import tarfile
import zc.buildout.testing

import unittest
import doctest
from zope.testing import renormalizing
from io import BytesIO as _BytesIO

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


def _as_bytes(s):
Expand Down Expand Up @@ -113,14 +113,9 @@ def test_suite():
(re.compile(
'Exception IOError: IOError.*finalizer of <closed file.*'),
''),
# IGNORE_EXCEPTION_MODULE_IN_PYTHON2 fails because the output
# doesn't always look like a traceback.
(re.compile('subprocess.CalledProcessError'),
'CalledProcessError'),
]),
optionflags=(doctest.ELLIPSIS
| doctest.NORMALIZE_WHITESPACE
| renormalizing.IGNORE_EXCEPTION_MODULE_IN_PYTHON2)
| doctest.NORMALIZE_WHITESPACE)
),
doctest.DocFileSuite(
'downloadcache.rst',
Expand Down
27 changes: 18 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
minversion = 3.18
envlist =
lint
py27
py35
py36
py37
py38
py39
pypy
py310
py311
pypy3
coverage

Expand All @@ -25,15 +23,26 @@ extras =
[testenv:lint]
basepython = python3
skip_install = true
deps =
flake8
check-manifest
check-python-versions
wheel
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 src setup.py
check-manifest
check-python-versions
deps =
check-manifest
check-python-versions >= 0.19.1
wheel
flake8
isort

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

[testenv:coverage]
basepython = python3
Expand Down

0 comments on commit 9c19cac

Please sign in to comment.