Skip to content

Commit

Permalink
Update Python version support. (#59)
Browse files Browse the repository at this point in the history
* Add support for Python 3.13.
* Add missing version pin needed by zope.testbrowser.
* Add `zope.testbrowser` to the list of tested packages.
  • Loading branch information
icemac authored Nov 8, 2024
1 parent a483fcb commit 7a96fd4
Show file tree
Hide file tree
Showing 20 changed files with 141 additions and 51 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/toolkit
name: pre-commit

on:
pull_request:
push:
branches:
- master
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
pre-commit:
name: linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --show-diff-on-failure
env:
PRE_COMMIT_COLOR: always
- uses: pre-commit-ci/[email protected]
if: always()
with:
msg: Apply pre-commit code formatting
17 changes: 9 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- ["ubuntu", "ubuntu-latest"]
config:
# [Python version, tox env]
- ["3.11", "release-check"]
- ["3.11", "lint"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.11", "release-check"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.13", "py313"]
- ["pypy-3.10", "pypy3"]
- ["3.11", "docs"]
- ["3.11", "docs"]

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
Expand All @@ -39,6 +39,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config[0] }}
allow-prereleases: true
- name: Pip cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/toolkit
[meta]
template = "toolkit"
commit-id = "2247fc22"
commit-id = "f317618e"

[python]
with-sphinx-doctests = false
Expand Down
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/toolkit
minimum_pre_commit_version: '3.6'
repos:
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/hhatto/autopep8
rev: "v2.3.1"
hooks:
- id: autopep8
args: [--in-place, --aggressive, --aggressive]
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
hooks:
- id: teyit
- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- flake8-debugger == 4.1.2
2 changes: 2 additions & 0 deletions dependabot/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ collective.recipe.template==2.2
decorator==5.1.1
gnureadline==8.2.13
ipython-genutils==0.2.0
legacy-cgi==2.6.1
mock==5.1.0
Paste==3.10.1
pexpect==4.9.0
pickleshare==0.7.5
Expand Down
6 changes: 6 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
5.2 (unreleased)
----------------

- Add support for Python 3.13.

- Drop version pins for ``twine`` and ``pkginfo`` as they are not used and we
pinned incompatible versions resulting in an error downstream.

- Update zopetoolkit to version 3.1.

- Add ``zope.testbrowser`` to the list of tested packages.

5.1 (2024-08-22)
----------------

Expand Down
9 changes: 4 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Grok Reference documentation build configuration file, created by
# sphinx-quickstart.py on Wed Feb 20 02:11:17 2008.
Expand Down Expand Up @@ -45,7 +44,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
]

# Order autodoc generated docs in source code order.
autodoc_member_order = 'alphabetical'
Expand Down Expand Up @@ -175,7 +174,7 @@
'manual'),
(path.join('reference', 'index'), 'reference.tex', 'Grok Reference',
'The Grok Team', 'manual'),
]
]

# Additional stuff for the LaTeX preamble.
latex_preamble = r'''
Expand All @@ -195,8 +194,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'grok', u'grok Documentation',
[u'The Grok developers and community'], 1)
('index', 'grok', 'grok Documentation',
['The Grok developers and community'], 1)
]


Expand Down
8 changes: 4 additions & 4 deletions docs/design/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,21 @@ class IMenuItem(Interface):

# ########### Implementation sketches

class ViewMenuItem(object):
class ViewMenuItem:

def __init__(self, view):
# View must be a view
pass


class Action(object):
class Action:

def __init__(self, title, target):
self.title = title
self.target = target # TALES expression


class BaseMenuItem(object):
class BaseMenuItem:

def __init__(self, condition):
self.condition = condition
Expand All @@ -183,7 +183,7 @@ def checkCondition(context, request):
pass


class Menu(object):
class Menu:

def __init__(self, menu_items):
# XXX assert: All items must be menu items
Expand Down
4 changes: 2 additions & 2 deletions docs/design/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Calculator(grok.GlobalUtility):
grok.provides(ICalculator) # this is actually the default


grok.global_utility(Calculator, provides=ICalculator, name=u'')
grok.global_utility(Calculator, provides=ICalculator, name='')


class LocalCalculator(grok.LocalUtility):
Expand All @@ -23,7 +23,7 @@ class Anything(grok.Model):
pass


class NonPersistent(object):
class NonPersistent:
pass


Expand Down
2 changes: 1 addition & 1 deletion docs/design/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Index(grok.Form):
"""

class fields:
operand = schema.Int(title=u'Operand')
operand = schema.Int(title='Operand')
operator = schema.Choice(...)
operand2 = schema.Int(...)

Expand Down
2 changes: 1 addition & 1 deletion docs/groktut/the_rules_of_persistence/src/sample/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Sample(grok.Application, grok.Container):
def __init__(self):
super(Sample, self).__init__()
super().__init__()
self.list = []


Expand Down
2 changes: 1 addition & 1 deletion docs/groktut/the_rules_of_persistence2/src/sample/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Sample(grok.Application, grok.Container):
def __init__(self):
super(Sample, self).__init__()
super().__init__()
self.list = []


Expand Down
2 changes: 1 addition & 1 deletion docs/groktut/the_rules_of_persistence3/src/sample/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Sample(grok.Application, grok.Container):
def __init__(self):
super(Sample, self).__init__()
super().__init__()
self.list = []

def addText(self, text):
Expand Down
5 changes: 2 additions & 3 deletions docs/reference/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Grok Reference documentation build configuration file, created by
# sphinx-quickstart.py on Wed Feb 20 02:11:17 2008.
Expand All @@ -22,7 +21,7 @@
setupfilepath = path.join(path.dirname(
path.dirname(path.abspath(curdir))), 'setup.py')
reg = re.compile(r"^\s*version=.(.+).,.*")
for line in open(setupfilepath, 'r').read().split():
for line in open(setupfilepath).read().split():
m = reg.match(line)
if m:
version = m.groups()[0]
Expand Down Expand Up @@ -129,7 +128,7 @@
# latex_documents = []
latex_documents = [
('reference.tex', 'Grok Reference', 'The Grok Team', 'manual')
]
]

# Additional stuff for the LaTeX preamble.
# latex_preamble = '
Expand Down
12 changes: 6 additions & 6 deletions docs/scripts/update-releaseinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def package_list(
doap.parse(doap_xml)
description = ' '.join(
doap.find('//{%s}shortdesc' % DOAP_NS).text.splitlines())
homepage = 'http://pypi.python.org/pypi/%s/%s' % (package, version)
homepage = f'http://pypi.python.org/pypi/{package}/{version}'
print(line % dict(
name=package, homepage=homepage,
description=description, version=version), file=out)
Expand All @@ -85,7 +85,7 @@ def write_package_list(path, version, use_trunk=False):

config = ConfigParser.RawConfigParser()
config.optionxform = str
fp = StringIO.StringIO((location/'grok.cfg').read())
fp = StringIO.StringIO((location / 'grok.cfg').read())
config.readfp(fp)
output = open(path, 'w')

Expand All @@ -102,12 +102,12 @@ def write_package_list(path, version, use_trunk=False):
print('Zope Toolkit %s' % ztk_version, file=output)
print('------------------------------', file=output)
print("""
This Grok released is based on Zope Toolkit %s.
This Grok released is based on Zope Toolkit {}.
`Overview <http://docs.zope.org/zopetoolkit/releases/overview-%s.html>`_ of
`Overview <http://docs.zope.org/zopetoolkit/releases/overview-{}.html>`_ of
the ZTK. List of the ZTK `packages
<http://docs.zope.org/zopetoolkit/releases/packages-%s.html>`_
""" % (ztk_version, ztk_version, ztk_version), file=output)
<http://docs.zope.org/zopetoolkit/releases/packages-{}.html>`_
""".format(ztk_version, ztk_version, ztk_version), file=output)

print('Packages', file=output)
print('--------', file=output)
Expand Down
2 changes: 2 additions & 0 deletions grok-versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ collective.recipe.template = 2.2
decorator = 5.1.1
gnureadline = 8.2.13
ipython-genutils = 0.2.0
legacy-cgi = 2.6.1
mock = 5.1.0
Paste = 3.10.1
pexpect = 4.9.0
pickleshare = 0.7.5
Expand Down
1 change: 1 addition & 0 deletions grok.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ included =
z3c.flashmessage
zc.catalog
zope.errorview
zope.testbrowser

# These packages will be removed in the next version
deprecating =
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/toolkit

[build-system]
requires = ["setuptools < 74"]
build-backend = "setuptools.build_meta"

[tool.coverage.run]
branch = true
source = ["groktoolkit"]

[tool.coverage.report]
fail_under = "not applicable"
precision = 2
ignore_errors = true
show_missing = true
exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"]

[tool.coverage.html]
directory = "parts/htmlcov"
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from setuptools import setup


version = '6.0.dev0'

with open('README.rst') as f:
Expand All @@ -22,6 +23,7 @@
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: CPython",
],
Expand Down
Loading

0 comments on commit 7a96fd4

Please sign in to comment.