diff options
author | Michael Howitz <mh@gocept.com> | 2023-01-10 17:11:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 17:11:28 +0100 |
commit | baab811cdb2cf88abbd26443e07aff87ebe55d9b (patch) | |
tree | 2814bff84c73f0e177a85b1589abe8377a5aa767 | |
parent | d686a14e5663c5f852abe8933c3aa31b53026960 (diff) | |
download | zope-contenttype-baab811cdb2cf88abbd26443e07aff87ebe55d9b.tar.gz |
Config with pure python template (#11)
* Drop support for Python 2.7, 3.5, 3.6.
* Add support for Python 3.11.
-rw-r--r-- | .github/workflows/tests.yml | 17 | ||||
-rw-r--r-- | .meta.toml | 4 | ||||
-rw-r--r-- | CHANGES.rst | 6 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | setup.py | 7 | ||||
-rw-r--r-- | src/zope/contenttype/__init__.py | 1 | ||||
-rw-r--r-- | src/zope/contenttype/parse.py | 4 | ||||
-rw-r--r-- | src/zope/contenttype/tests/testContentTypes.py | 1 | ||||
-rw-r--r-- | tox.ini | 13 |
9 files changed, 23 insertions, 32 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9f622d..2ca497a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,33 +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') }} @@ -59,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 }} @@ -2,15 +2,15 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = "pure-python" -commit-id = "d5b6c610d0ec7f0b8f6bbba49353eb89288f62b1" +commit-id = "d03ad585" [python] with-windows = false with-pypy = true with-future-python = false -with-legacy-python = true with-docs = true with-sphinx-doctests = false +with-macos = false [tox] use-flake8 = true diff --git a/CHANGES.rst b/CHANGES.rst index 38cfdd2..c90de35 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,10 +2,12 @@ Change History ================ -4.7 (unreleased) +5.0 (unreleased) ================ -- Nothing changed yet. +- Add support for Python 3.11. + +- Drop support for Python 2.7, 3.5, 3.6. 4.6 (2022-09-07) @@ -1,7 +1,7 @@ # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/pure-python [bdist_wheel] -universal = 1 +universal = 0 [flake8] doctests = 1 @@ -38,7 +38,7 @@ TESTS_REQUIRE = [ setup( name='zope.contenttype', - version='4.7.dev0', + version='5.0.dev0', url='http://github.com/zopefoundation/zope.contenttype', author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', @@ -48,15 +48,12 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', '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', 'Operating System :: OS Independent', diff --git a/src/zope/contenttype/__init__.py b/src/zope/contenttype/__init__.py index 0c8176b..5d89f5c 100644 --- a/src/zope/contenttype/__init__.py +++ b/src/zope/contenttype/__init__.py @@ -12,7 +12,6 @@ ############################################################################## """A utility module for content-type handling. """ -from __future__ import print_function import mimetypes import os.path diff --git a/src/zope/contenttype/parse.py b/src/zope/contenttype/parse.py index 02ff7df..345b0c3 100644 --- a/src/zope/contenttype/parse.py +++ b/src/zope/contenttype/parse.py @@ -150,8 +150,8 @@ def join(spec): # ensure a predictable order: params = sorted(params) for name, value in params: - pstr += ";%s=%s" % (name, _escape(value)) - return "%s/%s%s" % (major, minor, pstr) + pstr += ";{}={}".format(name, _escape(value)) + return "{}/{}{}".format(major, minor, pstr) def _escape(string): diff --git a/src/zope/contenttype/tests/testContentTypes.py b/src/zope/contenttype/tests/testContentTypes.py index eb04a9a..8032c70 100644 --- a/src/zope/contenttype/tests/testContentTypes.py +++ b/src/zope/contenttype/tests/testContentTypes.py @@ -13,7 +13,6 @@ ############################################################################## """Tests of the contenttypes extension mechanism. """ -from __future__ import print_function import unittest @@ -1,17 +1,15 @@ # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/pure-python + [tox] minversion = 3.18 envlist = lint - py27 - py35 - py36 py37 py38 py39 py310 - pypy + py311 pypy3 docs coverage @@ -41,6 +39,7 @@ deps = [testenv:isort-apply] basepython = python3 +skip_install = true commands_pre = deps = isort @@ -62,16 +61,14 @@ allowlist_externals = mkdir deps = coverage - coverage-python-version commands = mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} - coverage html - coverage report -m --fail-under=100 + coverage html --ignore-errors + coverage report --ignore-errors --show-missing --fail-under=100 [coverage:run] branch = True -plugins = coverage_python_version source = zope.contenttype [coverage:report] |