Skip to content

Commit

Permalink
third_party: update six to 1.16
Browse files Browse the repository at this point in the history
Improves compatibility with Python 3.10
  • Loading branch information
coderkalyan committed Feb 5, 2022
1 parent 7d93f00 commit 6907b9c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 25 deletions.
48 changes: 29 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,36 @@ environment:
matrix:
- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: "C:\\Python39-x64"
PYTHON: "C:\\Python310-x64"

- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: "3.9"
# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.10"

- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: "3.8"
# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.9"

- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: "3.7"
# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.8"

- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: "3.6"
# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.7"

# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.6"

# - job_group: tests
# APPVEYOR_BUILD_WORKER_IMAGE: macos
# PYTHON: "3.9"

- job_name: deploy
job_depends_on: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: "3.9"
# - job_name: deploy
# job_depends_on: tests
# APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
# PYTHON: "3.10"

GIT_TOKEN:
secure: +jQhxLpePj6hdDryfET/XpLo7VL9fhDXVHlwLOPp/nRDYe97TJAfd0XCTuPz1qkT
Expand All @@ -49,11 +57,13 @@ for:
- cmd: 'SET PATH=%PYTHON%\\Scripts;%PATH%'
- cmd: 'echo %PATH%'
# Shared config.
- python -m pip install --upgrade pip setuptools nox
- python -m pip install --upgrade pip setuptools nox typed_ast
- python --version
test_script:
# GNU/Linux test.
- sh: nox --non-interactive --error-on-missing-interpreters --session test lint --python $PYTHON
- sh: nox --non-interactive --session docs
# skip macOS docs build
- sh: 'if [ "$APPVEYOR_BUILD_WORKER_IMAGE" != "macos" ]; then nox --non-interactive --session docs; fi'
# MS Windows test.
- cmd: nox --forcecolor --non-interactive --error-on-missing-interpreters --session test lint
# Shared test for all platforms.
Expand Down
5 changes: 5 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ body {
max-width: unset;
}


h2 {
border-bottom: 1px solid #ddd;
padding-bottom: 0.2em;
Expand Down Expand Up @@ -41,3 +42,7 @@ p {
div, section, img {
background-color: inherit;
}

dl.property {
width: 100%;
}
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx == 3.5.3
sphinx_rtd_theme == 0.5.1
sphinx == 4.4.0
sphinx_rtd_theme == 1.0.0
sphinx-computron >= 0.2, < 2.0
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import nox


PYTHONS = ["3.6", "3.7", "3.8", "3.9"]
PYTHONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
"""The newest supported Python shall be listed LAST."""

nox.options.error_on_external_run = True
Expand Down Expand Up @@ -64,7 +64,7 @@ def test(session):
def lint(session):
session.log("Using the newest supported Python: %s", is_latest_python(session))
session.install(
"mypy == 0.812",
"mypy == 0.931",
"pylint == 2.7.2",
)
session.run(
Expand All @@ -84,7 +84,7 @@ def lint(session):
},
)
if is_latest_python(session):
session.install("black == 20.8b1")
session.install("black == 21.12b0")
session.run("black", "--check", ".")


Expand Down
18 changes: 17 additions & 1 deletion pydsdl/third_party/six.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import types

__author__ = "Benjamin Peterson <[email protected]>"
__version__ = "1.15.0"
__version__ = "1.16.0"


# Useful for very coarse version differentiation.
Expand Down Expand Up @@ -71,6 +71,11 @@ def __len__(self):
MAXSIZE = int((1 << 63) - 1)
del X

if PY34:
from importlib.util import spec_from_loader
else:
spec_from_loader = None


def _add_doc(func, doc):
"""Add documentation to a function."""
Expand Down Expand Up @@ -186,6 +191,11 @@ def find_module(self, fullname, path=None):
return self
return None

def find_spec(self, fullname, path, target=None):
if fullname in self.known_modules:
return spec_from_loader(fullname, self)
return None

def __get_module(self, fullname):
try:
return self.known_modules[fullname]
Expand Down Expand Up @@ -223,6 +233,12 @@ def get_code(self, fullname):
return None
get_source = get_code # same as get_code

def create_module(self, spec):
return self.load_module(spec.name)

def exec_module(self, module):
pass

_importer = _SixMetaPathImporter(__name__)


Expand Down

0 comments on commit 6907b9c

Please sign in to comment.