From f56f7261ea3a779ddb0a3dc5e84b8a34a5efbb07 Mon Sep 17 00:00:00 2001 From: Cameron Billingham Date: Sun, 13 Oct 2024 16:14:38 -0700 Subject: [PATCH] Drop support for python 2.7 finally and remove from github actions since its no longer supported --- .github/workflows/test.yaml | 1 - README.md | 8 +++++++- setup.cfg | 4 +--- src/docconvert/parser/module.py | 3 +++ tests/test_module_parser.py | 1 + tox.ini | 5 +---- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1bf6230..f1fe6da 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,6 @@ jobs: fail-fast: false matrix: version: [ - {"python": "2.7", "toxenv": "py27-sdist"}, {"python": "3.9", "toxenv": "py39-sdist"}, {"python": "3.10", "toxenv": "py310-sdist"}, {"python": "3.11", "toxenv": "py311-sdist"}, diff --git a/README.md b/README.md index d0c4409..349ab3b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Update or convert docstrings in existing Python files. -This Python (2.7+/3.6+) module and script intends to help Python programmers to +This Python (3.9+) module and script intends to help Python programmers to enhance internal code documentation using docstrings. It is useful to harmonize or change a project docstring style format. @@ -103,6 +103,12 @@ If you would like to contribute, please take a look at the We use [SemVer][4] for versioning. For the versions available, see the tags on the repository. +### Python 2.7 + +We tried really hard to have this package support both Python 2 and 3 for a +long time. We've dropped Python 2 support officially. Its just become +cumbersome to test with. However, the code will probably still work in +Python 2.7+ *I think*. Good luck! ## License diff --git a/setup.cfg b/setup.cfg index 6f11dc5..87b0e5e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,8 +18,6 @@ classifiers = License :: OSI Approved :: BSD License Natural Language :: English Operating System :: OS Independent - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -31,7 +29,7 @@ classifiers = package_dir= =src packages=find: -python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* +python_requires = >=3.6 install_requires = six enum34;python_version<"3.4" diff --git a/src/docconvert/parser/module.py b/src/docconvert/parser/module.py index ebae4b4..e92b5fd 100644 --- a/src/docconvert/parser/module.py +++ b/src/docconvert/parser/module.py @@ -472,6 +472,9 @@ def __init__(self, generator): def __iter__(self): return self + def next(self): + return self.__next__() + def __next__(self): if self.peeked: self.peeked = False diff --git a/tests/test_module_parser.py b/tests/test_module_parser.py index c5cf837..2ace9e6 100644 --- a/tests/test_module_parser.py +++ b/tests/test_module_parser.py @@ -204,6 +204,7 @@ def test_func_after_assign(self): assert parser.docstrings[2].start == 13 assert parser.docstrings[2].end == 20 + @pytest.mark.skipif(sys.version_info < (3,), reason="requires python3") def test_indentation_error(self): """Make sure we handle IndentationError with valid python syntax.""" lines = get_fixture_lines("indent_error.py") diff --git a/tox.ini b/tox.ini index 711a323..0763f32 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,39,310,311,312,313},formatting +envlist = py{39,310,311,312,313},formatting [testenv] usedevelop = True @@ -8,9 +8,6 @@ deps = commands = pytest {posargs} -[testenv:py27-sdist] -usedevelop = False - [testenv:py39-sdist] usedevelop = False