Skip to content

Commit

Permalink
Drop support for Python < 3.7 (#22)
Browse files Browse the repository at this point in the history
* Bumped version for breaking release.

* Drop support for Python 2.7, 3.5, 3.6.
  • Loading branch information
Michael Howitz committed Jun 30, 2023
1 parent cd61d50 commit 1286e74
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 65 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/tests.yml
Expand Up @@ -21,16 +21,12 @@ jobs:
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"]
- ["3.11", "py311"]
- ["pypy-2.7", "pypy"]
- ["pypy-3.7", "pypy3"]
- ["pypy-3.9", "pypy3"]
- ["3.9", "docs"]
- ["3.9", "coverage"]

Expand Down Expand Up @@ -60,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 }}
3 changes: 1 addition & 2 deletions .meta.toml
Expand Up @@ -2,11 +2,10 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
commit-id = "200573eb414d2228d463da3de7d71a6d6335a704"
commit-id = "d0bc564f"

[python]
with-pypy = true
with-legacy-python = true
with-docs = true
with-sphinx-doctests = false
with-windows = false
Expand Down
6 changes: 4 additions & 2 deletions CHANGES.rst
Expand Up @@ -2,8 +2,10 @@
Changes
=========

4.6.2 (unreleased)
==================
5.0 (unreleased)
================

- Drop support for Python 2.7, 3.5, 3.6.

- Add support for Python 3.11.

Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
@@ -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
Expand All @@ -16,7 +16,7 @@ ignore =
force_single_line = True
combine_as_imports = True
sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
known_third_party = six, docutils, pkg_resources
known_third_party = docutils, pkg_resources, pytz
known_zope =
known_first_party =
default_section = ZOPE
Expand Down
20 changes: 4 additions & 16 deletions setup.py
Expand Up @@ -12,7 +12,7 @@
#
##############################################################################
# This package is developed by the Zope Toolkit project, documented here:
# http://docs.zope.org/zopetoolkit
# https://zopetoolkit.readthedocs.io/
# When developing and releasing this package, please follow the documented
# Zope Toolkit policies as described by this documentation.
##############################################################################
Expand Down Expand Up @@ -40,9 +40,9 @@ def read(*rnames):

setup(
name='zope.site',
version='4.6.2.dev0',
version='5.0.dev0',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
author_email='zope-dev@zope.dev',
description='Local registries for zope component architecture',
long_description=(
read('README.rst')
Expand All @@ -58,11 +58,7 @@ def read(*rnames):
'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',
Expand Down Expand Up @@ -100,15 +96,7 @@ def read(*rnames):
'zope.lifecycleevent',
'zope.location',
],
tests_require=TESTS_REQUIRE,
include_package_data=True,
zip_safe=False,
python_requires=', '.join([
'>=2.7',
'!=3.0.*',
'!=3.1.*',
'!=3.2.*',
'!=3.3.*',
'!=3.4.*',
]),
python_requires='>=3.7',
)
2 changes: 1 addition & 1 deletion src/zope/site/folder.py
Expand Up @@ -33,7 +33,7 @@ def rootFolder():
return f


class FolderSublocations(object):
class FolderSublocations:
"""
Adapter for an :class:`zope.site.interfaces.IFolder` to
:class:`zope.location.interfaces.ISublocations`.
Expand Down
2 changes: 1 addition & 1 deletion src/zope/site/interfaces.py
Expand Up @@ -29,7 +29,7 @@ class INewLocalSite(zope.interface.Interface):


@zope.interface.implementer(INewLocalSite)
class NewLocalSite(object):
class NewLocalSite:
"""Event: a local site was created
"""
def __init__(self, manager):
Expand Down
8 changes: 4 additions & 4 deletions src/zope/site/site.py
Expand Up @@ -62,7 +62,7 @@ class SiteManagementFolder(BTreeContainer):


@zope.interface.implementer(IDirectoryFactory)
class SMFolderFactory(object):
class SMFolderFactory:
"""
Implementation of a :class:`~.IDirectoryFactory` that creates
:class:`SiteManagementFolder`
Expand Down Expand Up @@ -153,7 +153,7 @@ def _setBases(self, bases):
and interfaces.ILocalSiteManager.providedBy(base)):
base.addSub(self)

super(LocalSiteManager, self)._setBases(bases)
super()._setBases(bases)

def __init__(self, site, default_folder=True):
BTreeContainer.__init__(self)
Expand All @@ -179,8 +179,8 @@ def _init_registries(self):
self.adapters = _LocalAdapterRegistry()
self.utilities = _LocalAdapterRegistry()
self.adapters.__parent__ = self.utilities.__parent__ = self
self.adapters.__name__ = u'adapters'
self.utilities.__name__ = u'utilities'
self.adapters.__name__ = 'adapters'
self.utilities.__name__ = 'utilities'

def _p_repr(self):
return PersistentComponents.__repr__(self)
Expand Down
12 changes: 0 additions & 12 deletions src/zope/site/testing.py
Expand Up @@ -13,32 +13,20 @@
##############################################################################
"""Reusable functionality for testing site-related code
"""
import re

import zope.component
import zope.component.hooks
import zope.component.interfaces
import zope.container.interfaces
import zope.container.testing
from zope.interface import Interface
from zope.interface.interfaces import IComponentLookup
from zope.testing import renormalizing

import zope.site.site
from zope.site import LocalSiteManager
from zope.site import SiteManagerAdapter
from zope.site.folder import rootFolder


checker = renormalizing.RENormalizing([
# Python 3 unicode removed the "u".
(re.compile("u('.*?')"),
r"\1"),
(re.compile('u(".*?")'),
r"\1"),
])


def createSiteManager(folder, setsite=False):
if not zope.component.interfaces.ISite.providedBy(folder):
folder.setSiteManager(LocalSiteManager(folder))
Expand Down
6 changes: 3 additions & 3 deletions src/zope/site/tests/folder.txt
Expand Up @@ -40,19 +40,19 @@ Let's add another folder to see how a non-site folder behaves:
The site folder now contains the new folder:

>>> list(fs_folder.keys())
[u'test', '++etc++site']
['test', '++etc++site']
>>> fs_folder.get('test')
<...Folder object at 0x...>
>>> fs_folder['test']
<...Folder object at 0x...>
>>> list(fs_folder.__iter__())
[u'test', '++etc++site']
['test', '++etc++site']
>>> list(fs_folder.values())
[...Folder object at 0x...>, <LocalSiteManager ++etc++site>]
>>> len(fs_folder)
2
>>> list(fs_folder.items())
[(u'test', ...Folder object at 0x...>),
[('test', ...Folder object at 0x...>),
('++etc++site', <LocalSiteManager ++etc++site>)]
>>> 'test' in fs_folder
True
5 changes: 1 addition & 4 deletions src/zope/site/tests/test_folder.py
@@ -1,10 +1,7 @@


import doctest
import unittest

from zope.site.folder import Folder
from zope.site.testing import checker
from zope.site.testing import siteSetUp
from zope.site.testing import siteTearDown
from zope.site.tests.test_site import TestSiteManagerContainer
Expand Down Expand Up @@ -63,5 +60,5 @@ def test_suite():
setUp=setUp, tearDown=tearDown),
doctest.DocFileSuite("folder.txt",
setUp=setUp, tearDown=tearDown,
checker=checker, optionflags=flags),
optionflags=flags),
))
2 changes: 1 addition & 1 deletion src/zope/site/tests/test_localsitemanager.py
Expand Up @@ -56,5 +56,5 @@ def testPersistence(self):

def test_suite():
return unittest.TestSuite((
unittest.makeSuite(TestLocalSiteManager),
unittest.defaultTestLoader.loadTestsFromTestCase(TestLocalSiteManager),
))
8 changes: 4 additions & 4 deletions src/zope/site/tests/test_site.py
Expand Up @@ -30,18 +30,18 @@


@zope.interface.implementer(interfaces.ILocalSiteManager)
class SiteManagerStub(object):
class SiteManagerStub:
pass


class CustomFolder(folder.Folder):

def __init__(self, name):
self.__name__ = name
super(CustomFolder, self).__init__()
super().__init__()

def __repr__(self): # pragma: no cover
return '<%s %s>' % (self.__class__.__name__, self.__name__)
return '<{} {}>'.format(self.__class__.__name__, self.__name__)


def test_SiteManagerAdapter():
Expand Down Expand Up @@ -181,7 +181,7 @@ def tearDown(test):
testing.siteTearDown()


class Layer(object):
class Layer:

@staticmethod
def setUp():
Expand Down
2 changes: 1 addition & 1 deletion src/zope/site/tests/test_sitemanagercontainer.py
Expand Up @@ -28,7 +28,7 @@
from zope.site.site import SiteManagerContainer


class Dummy(object):
class Dummy:
pass


Expand Down
6 changes: 0 additions & 6 deletions tox.ini
Expand Up @@ -4,15 +4,11 @@
minversion = 3.18
envlist =
lint
py27
py35
py36
py37
py38
py39
py310
py311
pypy
pypy3
docs
coverage
Expand Down Expand Up @@ -66,7 +62,6 @@ allowlist_externals =
mkdir
deps =
coverage
coverage-python-version
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
Expand All @@ -75,7 +70,6 @@ commands =

[coverage:run]
branch = True
plugins = coverage_python_version
source = zope.site

[coverage:report]
Expand Down

0 comments on commit 1286e74

Please sign in to comment.