Skip to content

Commit

Permalink
Add support for Python 3.10, 3.11. (#29)
Browse files Browse the repository at this point in the history
* isort imports
  • Loading branch information
Michael Howitz authored Dec 2, 2022
1 parent 8d9e55d commit 8568d2d
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ max_line_length = off
# 4 space indentation
indent_size = 4

[*.{yml,zpt,pt,dtml}]
[*.{yml,zpt,pt,dtml,zcml}]
# 2 space indentation
indent_size = 2

Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,34 @@ jobs:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ubuntu
config:
# [Python version, tox env]
- ["3.8", "lint"]
- ["3.9", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["pypy2", "pypy"]
- ["pypy3", "pypy3"]
- ["3.8", "coverage"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["pypy-2.7", "pypy"]
- ["pypy-3.7", "pypy3"]
- ["3.9", "coverage"]

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}-latest
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
*.dll
*.egg-info/
*.profraw
*.pyc
*.pyo
*.so
.coverage
.coverage.*
.eggs/
Expand All @@ -26,4 +28,5 @@ lib64
log/
parts/
pyvenv.cfg
testing.log
var/
7 changes: 4 additions & 3 deletions .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 = "d4e8550e4a37df10866d376fceac4e91689df8c5"
commit-id = "d8ee00613a60c98a8d2227b0564403d0e447741a"

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

[coverage]
fail-under = 79
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change log
4.4 (unreleased)
================

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

- Drop support for Python 3.4.

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
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from setuptools import setup
import os

from setuptools import setup


tests_require = [
'manuel',
Expand Down Expand Up @@ -66,6 +67,8 @@ def read(*rnames):
'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 :: POSIX',
Expand Down
2 changes: 2 additions & 0 deletions src/zdaemon/__main__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from zdaemon.zdctl import main


main()
1 change: 1 addition & 0 deletions src/zdaemon/tests/nokill.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import signal


signal.signal(signal.SIGTERM, signal.SIG_IGN)

while True:
Expand Down
3 changes: 2 additions & 1 deletion src/zdaemon/tests/parent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
import os
import sys
import time


donothing_contents = """\
#!/bin/sh
Expand Down
6 changes: 4 additions & 2 deletions src/zdaemon/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
import unittest
from contextlib import contextmanager

import ZConfig
import manuel.capture
import manuel.doctest
import manuel.testing
import zc.customdoctests
import zdaemon
import ZConfig
from zope.testing import renormalizing

import zdaemon


try:
import pkg_resources
zdaemon_loc = pkg_resources.working_set.find(
Expand Down
6 changes: 4 additions & 2 deletions src/zdaemon/tests/testuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@

# Test user and groups options

from zope.testing import setupstack
import doctest
import mock
import os
import sys

import mock
from zope.testing import setupstack

import zdaemon.zdctl


Expand Down
14 changes: 9 additions & 5 deletions src/zdaemon/tests/testzdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@

"""Test suite for zdaemon.zdoptions."""

import doctest
import os
import shutil
import sys
import tempfile
import shutil
import unittest
import doctest

import ZConfig

import zdaemon
from zdaemon.zdoptions import (
ZDOptions, RunnerOptions, list_of_ints,
existing_parent_directory, existing_parent_dirpath)
from zdaemon.zdoptions import RunnerOptions
from zdaemon.zdoptions import ZDOptions
from zdaemon.zdoptions import existing_parent_directory
from zdaemon.zdoptions import existing_parent_dirpath
from zdaemon.zdoptions import list_of_ints


try:
from StringIO import StringIO
Expand Down
10 changes: 6 additions & 4 deletions src/zdaemon/tests/testzdrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
from __future__ import print_function

import os
import sys
import time
import shutil
import signal
import socket
import sys
import tempfile
import time
import unittest
import socket


try:
from StringIO import StringIO
Expand All @@ -18,7 +19,8 @@

import ZConfig

from zdaemon import zdrun, zdctl
from zdaemon import zdctl
from zdaemon import zdrun


class ConfiguredOptions:
Expand Down
15 changes: 10 additions & 5 deletions src/zdaemon/zdctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@
"""
from __future__ import print_function

import cmd
import os
import os.path
import re
import cmd
import sys
import time
import signal
import socket
import stat
import sys
import time


if __name__ == "__main__":
# Add the parent of the script directory to the module search path
# (but only when the script is run from inside the zdaemon package)
from os.path import dirname, basename, abspath, normpath
from os.path import abspath
from os.path import basename
from os.path import dirname
from os.path import normpath
scriptdir = dirname(normpath(abspath(sys.argv[0])))
if basename(scriptdir).lower() == "zdaemon":
sys.path.append(dirname(scriptdir))
Expand All @@ -67,7 +71,8 @@
sys.path.insert(0, d)
break

from zdaemon.zdoptions import RunnerOptions, name2signal
from zdaemon.zdoptions import RunnerOptions
from zdaemon.zdoptions import name2signal


def string_list(arg):
Expand Down
6 changes: 4 additions & 2 deletions src/zdaemon/zdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
##############################################################################
"""Option processing for zdaemon and related code."""
from __future__ import print_function
import os
import sys

import getopt
import os
import signal
import sys

import pkg_resources

import ZConfig


Expand Down
13 changes: 9 additions & 4 deletions src/zdaemon/zdrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@
Usage: python zrdun.py [zrdun-options] program [program-arguments]
"""

from stat import ST_MODE
import errno
import fcntl
import logging
import os
import select
import signal
import socket
import sys
import subprocess
import sys
import threading
import time
from stat import ST_MODE


if __name__ == "__main__":
# Add the parent of the script directory to the module search path
# (but only when the script is run from inside the zdaemon package)
from os.path import dirname, basename, abspath, normpath
from os.path import abspath
from os.path import basename
from os.path import dirname
from os.path import normpath
scriptdir = dirname(normpath(abspath(sys.argv[0])))
if basename(scriptdir).lower() == "zdaemon":
sys.path.append(dirname(scriptdir))
Expand All @@ -46,9 +50,10 @@
sys.path.insert(0, d)
break

from zdaemon.zdoptions import RunnerOptions
from ZConfig.components.logger.loghandler import reopenFiles

from zdaemon.zdoptions import RunnerOptions


def string_list(arg):
return arg.split()
Expand Down
Loading

0 comments on commit 8568d2d

Please sign in to comment.