Skip to content

Commit

Permalink
Merge pull request #55 from ronawho/remove-py2-vestiges
Browse files Browse the repository at this point in the history
Remove vestiges of python 2 support from sphinx domain

[Reviewed by @lydia-duncan]

#38 started requiring python3, so remove python2 specific code. We don't
need six and can just use python3 features and don't need unittest2,
which was a backport of unittest to old python2 versions.
  • Loading branch information
ronawho authored Mar 25, 2022
2 parents 0e2acd9 + af4ed9d commit e7a18c6
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
docutils==0.16
six
Sphinx==4.3.2
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Framework :: Sphinx :: Extension',
'Topic :: Documentation',
Expand All @@ -43,7 +42,6 @@
include_package_data=True,
install_requires=[
'docutils',
'six',
'Sphinx',
],
namespace_packages=['sphinxcontrib']
Expand Down
5 changes: 2 additions & 3 deletions sphinxcontrib/chapeldomain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from docutils.nodes import Node
from docutils.parsers.rst.states import Inliner
from docutils.parsers.rst import directives
from six import iteritems

from sphinx import addnodes
from sphinx.environment import BuildEnvironment
Expand Down Expand Up @@ -685,7 +684,7 @@ def generate(self, docnames=None):
ignores = sorted(ignores, key=len, reverse=True)

# list of all modules, sorted by module name
modules = sorted(iteritems(self.domain.data['modules']),
modules = sorted(self.domain.data['modules'].items(),
key=lambda x: x[0].lower())

# sort out collapsible modules
Expand Down Expand Up @@ -739,7 +738,7 @@ def generate(self, docnames=None):
collapse = len(modules) - num_toplevels < num_toplevels

# sort by first leter
content = sorted(iteritems(content))
content = sorted(content.items())

return content, collapse

Expand Down
1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ mock
pytest
pytest-cov
tox
unittest2
4 changes: 0 additions & 4 deletions test/test_chapeldomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import sys
import unittest

# For python 2.6 and lower, use unittest2.
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
import unittest2 as unittest

from sphinxcontrib.chapeldomain import (
ChapelDomain, ChapelModuleIndex, ChapelModuleLevel, ChapelObject,
ChapelTypedField,
Expand Down

0 comments on commit e7a18c6

Please sign in to comment.