summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@plyp.com>2023-01-03 14:52:28 +0100
committerJens Vagelpohl <jens@plyp.com>2023-01-03 14:52:28 +0100
commitd5c9fe7e470fbd65d916c7d24ffd808efdcad30f (patch)
tree8018cfee465e47deb5ba0e7c9259fda70f8c8e3e
parentd7145657a546bb97f2395b3add2be446d9285b2c (diff)
downloadzope-i18nmessageid-d5c9fe7e470fbd65d916c7d24ffd808efdcad30f.tar.gz
- Drop support for Python 2.7, 3.5, 3.6
-rw-r--r--.github/workflows/tests.yml56
-rwxr-xr-x.manylinux-install.sh6
-rw-r--r--.meta.toml3
-rw-r--r--CHANGES.rst2
-rw-r--r--appveyor.yml3
-rw-r--r--setup.cfg2
-rw-r--r--setup.py14
-rw-r--r--src/zope/i18nmessageid/message.py14
-rw-r--r--src/zope/i18nmessageid/tests.py6
-rw-r--r--tox.ini9
10 files changed, 24 insertions, 91 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 0cca637..7fb3bee 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -96,24 +96,16 @@ jobs:
fail-fast: false
matrix:
python-version:
- - "2.7"
- - "3.5"
- - "pypy-2.7"
- "pypy-3.7"
- - "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- os: [ubuntu-20.04, macos-latest]
+ os: [ubuntu-20.04, macos-11]
exclude:
- - os: macos-latest
- python-version: "pypy-2.7"
- - os: macos-latest
+ - os: macos-11
python-version: "pypy-3.7"
- - os: macos-latest
- python-version: "3.5"
steps:
- name: checkout
@@ -141,15 +133,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- - name: Install Build Dependencies (PyPy2)
- if: >
- startsWith(matrix.python-version, 'pypy-2.7')
- run: |
- pip install -U pip
- pip install -U setuptools wheel twine "cffi != 1.15.1"
- - name: Install Build Dependencies (other Python versions)
- if: >
- !startsWith(matrix.python-version, 'pypy-2.7')
+ - name: Install Build Dependencies
run: |
pip install -U pip
pip install -U setuptools wheel twine cffi
@@ -158,9 +142,6 @@ jobs:
if: >
startsWith(runner.os, 'Mac')
&& !(startsWith(matrix.python-version, 'pypy')
- || matrix.python-version == '2.7'
- || matrix.python-version == '3.5'
- || matrix.python-version == '3.6'
|| matrix.python-version == '3.7')
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
@@ -175,9 +156,6 @@ jobs:
if: >
startsWith(runner.os, 'Mac')
&& !(startsWith(matrix.python-version, 'pypy')
- || matrix.python-version == '2.7'
- || matrix.python-version == '3.5'
- || matrix.python-version == '3.6'
|| matrix.python-version == '3.7')
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
@@ -192,9 +170,6 @@ jobs:
if: >
!startsWith(runner.os, 'Mac')
|| startsWith(matrix.python-version, 'pypy')
- || matrix.python-version == '2.7'
- || matrix.python-version == '3.5'
- || matrix.python-version == '3.6'
|| matrix.python-version == '3.7'
run: |
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
@@ -205,7 +180,6 @@ jobs:
- name: Install zope.i18nmessageid and dependencies
run: |
# Install to collect dependencies into the (pip) cache.
- pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
pip install .[test]
- name: Check zope.i18nmessageid build
@@ -223,9 +197,6 @@ jobs:
if: >
startsWith(runner.os, 'Mac')
&& !(startsWith(matrix.python-version, 'pypy')
- || matrix.python-version == '2.7'
- || matrix.python-version == '3.5'
- || matrix.python-version == '3.6'
|| matrix.python-version == '3.7')
uses: actions/upload-artifact@v3
with:
@@ -262,24 +233,16 @@ jobs:
fail-fast: false
matrix:
python-version:
- - "2.7"
- - "3.5"
- - "pypy-2.7"
- "pypy-3.7"
- - "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- os: [ubuntu-20.04, macos-latest]
+ os: [ubuntu-20.04, macos-11]
exclude:
- - os: macos-latest
- python-version: "pypy-2.7"
- - os: macos-latest
+ - os: macos-11
python-version: "pypy-3.7"
- - os: macos-latest
- python-version: "3.5"
steps:
- name: checkout
@@ -316,7 +279,6 @@ jobs:
run: |
pip install -U wheel setuptools
pip install -U coverage
- pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
pip install -U 'cffi; platform_python_implementation == "CPython"'
# Unzip into src/ so that testrunner can find the .so files
# when we ask it to load tests from that directory. This
@@ -461,7 +423,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9"]
- image: [manylinux2010_x86_64, manylinux2010_i686, manylinux2014_aarch64]
+ image: [manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64]
steps:
- name: checkout
@@ -492,18 +454,16 @@ jobs:
- name: Update pip
run: pip install -U pip
- name: Build zope.i18nmessageid (x86_64)
- if: matrix.image == 'manylinux2010_x86_64'
+ if: matrix.image == 'manylinux2014_x86_64'
# An alternate way to do this is to run the container directly with a uses:
# and then the script runs inside it. That may work better with caching.
# See https://github.com/pyca/bcrypt/blob/f6b5ee2eda76d077c531362ac65e16f045cf1f29/.github/workflows/wheel-builder.yml
- # The 2010 image is the most recent spec that comes with Python 2.7,
- # and only up through the tag 2021-02-06-3d322a5
env:
DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
run: |
bash .manylinux.sh
- name: Build zope.i18nmessageid (i686)
- if: matrix.image == 'manylinux2010_i686'
+ if: matrix.image == 'manylinux2014_i686'
env:
DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
PRE_CMD: linux32
diff --git a/.manylinux-install.sh b/.manylinux-install.sh
index cb697de..73e5fe9 100755
--- a/.manylinux-install.sh
+++ b/.manylinux-install.sh
@@ -28,9 +28,6 @@ yum -y install libffi-devel
tox_env_map() {
case $1 in
- *"cp27"*) echo 'py27';;
- *"cp35"*) echo 'py35';;
- *"cp36"*) echo 'py36';;
*"cp37"*) echo 'py37';;
*"cp38"*) echo 'py38';;
*"cp39"*) echo 'py39';;
@@ -43,10 +40,7 @@ tox_env_map() {
# Compile wheels
for PYBIN in /opt/python/*/bin; do
if \
- [[ "${PYBIN}" == *"cp27"* ]] || \
- [[ "${PYBIN}" == *"cp35"* ]] || \
[[ "${PYBIN}" == *"cp311"* ]] || \
- [[ "${PYBIN}" == *"cp36"* ]] || \
[[ "${PYBIN}" == *"cp37"* ]] || \
[[ "${PYBIN}" == *"cp38"* ]] || \
[[ "${PYBIN}" == *"cp39"* ]] || \
diff --git a/.meta.toml b/.meta.toml
index 30ce2b2..92b1a21 100644
--- a/.meta.toml
+++ b/.meta.toml
@@ -2,14 +2,13 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
-commit-id = "342271a70d886e753e5cc629e8a81b3cfab692ac"
+commit-id = "3c9d0741"
[python]
with-appveyor = true
with-windows = false
with-pypy = true
with-future-python = false
-with-legacy-python = true
with-docs = true
with-sphinx-doctests = true
with-macos = false
diff --git a/CHANGES.rst b/CHANGES.rst
index a25d43f..229991d 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,9 +5,9 @@
6.0.0 (unreleased)
==================
-
- Drop support for Python 2.7, 3.5, 3.6.
+
5.1.1 (2022-11-17)
==================
diff --git a/appveyor.yml b/appveyor.yml
index 992ec50..7d2b543 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,9 +9,6 @@ environment:
secure: aoZC/+rvJKg8B5GMGIxd1VZ0Oxtmc0lPMiqT2wHP5qBRoZf6tEB7n9u7uCIifcAX1IWsLCRF7DKWvvCQTFJL5HcQvXFQSnEuXvdMT/utFFx9eCCy+Cu+WuWkasGCG+gx9uhMTe01mixi8yujgVj894Xjdv5YyNH2dPeqV5kInTzYrOmKZs1FTvKTlYZNHyYWRnYhyaLBn4FmmeuXuFcd5o05jkaa2dnerW85F3sr7mWbCgL4GpEQ59rYX34Cl4EdEXw+IViTyFWJuZp+k9GCUnzxAmA+vlfoSbZ6JfvTLaU=
matrix:
- - python: 27-x64
- - python: 35-x64
- - python: 36-x64
- python: 37-x64
- python: 38-x64
- python: 39-x64
diff --git a/setup.cfg b/setup.cfg
index b41962b..fdfa80f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[bdist_wheel]
-universal = 1
+universal = 0
[zest.releaser]
create-wheel = no
diff --git a/setup.py b/setup.py
index d566703..28d5987 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,6 @@
##############################################################################
"""Setup for zope.i18nmessageid package
"""
-from __future__ import print_function
import os
import platform
@@ -112,11 +111,7 @@ 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',
@@ -135,14 +130,7 @@ setup(
package_dir={'': 'src'},
namespace_packages=['zope'],
install_requires=['setuptools', 'six'],
- python_requires=', '.join([
- '>=2.7',
- '!=3.0.*',
- '!=3.1.*',
- '!=3.2.*',
- '!=3.3.*',
- '!=3.4.*',
- ]),
+ python_requires='>=3.7',
include_package_data=True,
test_suite='zope.i18nmessageid.tests.test_suite',
zip_safe=False,
diff --git a/src/zope/i18nmessageid/message.py b/src/zope/i18nmessageid/message.py
index 5142a81..0acab7a 100644
--- a/src/zope/i18nmessageid/message.py
+++ b/src/zope/i18nmessageid/message.py
@@ -13,14 +13,12 @@
##############################################################################
"""I18n Messages and factories.
"""
-import six
-
__docformat__ = "reStructuredText"
_marker = object()
-class Message(six.text_type):
+class Message(str):
"""Message (Python implementation)
This is a string used as a message. It has a domain attribute that is
@@ -36,7 +34,7 @@ class Message(six.text_type):
def __new__(cls, ustr, domain=_marker, default=_marker, mapping=_marker,
msgid_plural=_marker, default_plural=_marker, number=_marker):
- self = six.text_type.__new__(cls, ustr)
+ self = str.__new__(cls, ustr)
if isinstance(ustr, self.__class__):
self.domain = ustr.domain
self.default = ustr.default
@@ -66,7 +64,7 @@ class Message(six.text_type):
self.number = number
if self.number is not None and not isinstance(
- self.number, six.integer_types + (float,)):
+ self.number, (int,) + (float,)):
raise TypeError('`number` should be an integer or a float')
self._readonly = True
@@ -80,11 +78,11 @@ class Message(six.text_type):
if getattr(self, '_readonly', False):
raise TypeError('readonly attribute')
else:
- return six.text_type.__setattr__(self, key, value)
+ return str.__setattr__(self, key, value)
def __getstate__(self):
return (
- six.text_type(self), self.domain, self.default, self.mapping,
+ str(self), self.domain, self.default, self.mapping,
self.msgid_plural, self.default_plural, self.number)
def __reduce__(self):
@@ -101,7 +99,7 @@ except ImportError: # pragma: no cover
pass
-class MessageFactory(object):
+class MessageFactory:
"""Factory for creating i18n messages."""
def __init__(self, domain):
diff --git a/src/zope/i18nmessageid/tests.py b/src/zope/i18nmessageid/tests.py
index 5dafd4e..1b2bbee 100644
--- a/src/zope/i18nmessageid/tests.py
+++ b/src/zope/i18nmessageid/tests.py
@@ -151,7 +151,7 @@ class PyMessageTests(unittest.TestCase):
# https://github.com/zopefoundation/zope.i18nmessageid/issues/14
pref_msg = self._makeOne("${name} Preferences")
self.assertIsNone(pref_msg.default)
- copy = self._makeOne(pref_msg, mapping={u'name': u'name'})
+ copy = self._makeOne(pref_msg, mapping={'name': 'name'})
self.assertIsNone(copy.default)
def test_copy_no_overrides(self):
@@ -220,12 +220,12 @@ class PyMessageTests(unittest.TestCase):
'testings', 'defaults', 2))
def test_non_unicode_default(self):
- message = self._makeOne(u'str', default=123)
+ message = self._makeOne('str', default=123)
self.assertEqual(message.default, 123)
def test_non_numeric_number(self):
with self.assertRaises((TypeError, AttributeError)):
- self._makeOne(u'str', default=123, number="one")
+ self._makeOne('str', default=123, number="one")
@unittest.skipIf(messageid.Message is messageid.pyMessage, "Duplicate tests")
diff --git a/tox.ini b/tox.ini
index 1774d1f..f182c06 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,15 +4,11 @@
minversion = 3.18
envlist =
lint
- py27,py27-pure
- py35,py35-pure
- py36,py36-pure
py37,py37-pure
py38,py38-pure
py39,py39-pure
py310,py310-pure
py311,py311-pure
- pypy
pypy3
docs
coverage
@@ -22,10 +18,10 @@ usedevelop = true
deps =
setenv =
pure: PURE_PYTHON=1
- !pure-!pypy-!pypy3: PURE_PYTHON=0
+ !pure-!pypy3: PURE_PYTHON=0
commands =
zope-testrunner --test-path=src {posargs:-vc}
- !py27-!pypy-!pypy3: sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
+ sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
extras =
test
docs
@@ -61,6 +57,7 @@ deps =
[testenv:isort-apply]
basepython = python3
+skip_install = true
commands_pre =
deps =
isort