Skip to content

Commit

Permalink
Merge 9370fdf into 5b74092
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Apr 22, 2022
2 parents 5b74092 + 9370fdf commit 72cbbbf
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 402 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/python_ci.yml
Expand Up @@ -22,19 +22,17 @@ jobs:
runs-on: "windows-2019"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.6,pypy-3.7'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.7'

strategy:
fail-fast: False
matrix:
config:
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.11.0-alpha.7", testenvs: "py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: True}
- {python-version: "pypy-3.6", testenvs: "pypy36-sphinx{4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
- {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: True}

steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/python_ci_linux.yml
Expand Up @@ -23,19 +23,17 @@ jobs:
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.6,pypy-3.7'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.7'

strategy:
fail-fast: False
matrix:
config:
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.11.0-alpha.7", testenvs: "py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: True}
- {python-version: "pypy-3.6", testenvs: "pypy36-sphinx{4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
- {python-version: "pypy-3.7", testenvs: "pypy37-sphinx{4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: True}

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/python_ci_macos.yml
Expand Up @@ -22,13 +22,12 @@ jobs:
runs-on: "macos-latest"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.7'
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11.0-alpha.7,pypy-3.7'

strategy:
fail-fast: False
matrix:
config:
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,latest},build", experimental: False}
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -40,7 +40,7 @@ base-classifiers = [
"Topic :: Utilities",
"Typing :: Typed",
]
python-versions = [ "3.6", "3.7", "3.8", "3.9", "3.10",]
python-versions = [ "3.7", "3.8", "3.9", "3.10",]
python-implementations = [ "CPython", "PyPy",]
platforms = [ "Windows", "macOS", "Linux",]
license-key = "MIT"
Expand Down Expand Up @@ -141,7 +141,7 @@ autodoc_exclude_members = [
]

[tool.mypy]
python_version = "3.6"
python_version = "3.7"
namespace_packages = true
check_untyped_defs = true
warn_unused_ignores = true
Expand Down
9 changes: 0 additions & 9 deletions repo_helper.yml
Expand Up @@ -22,20 +22,11 @@ conda_channels:
- conda-forge

python_versions:
3.6:
3.7:
3.8:
3.9:
"3.10":
3.11-dev:
pypy36:
matrix_exclude:
sphinx:
- 3.2
- 3.3
- 3.4
- 3.5
- latest
pypy37:
matrix_exclude:
sphinx:
Expand Down
25 changes: 15 additions & 10 deletions sphinx_toolbox/more_autodoc/typehints.py
Expand Up @@ -119,19 +119,24 @@ def setup(app: Sphinx) -> Dict[str, Any]:
from contextlib import suppress
from tempfile import TemporaryDirectory
from types import FunctionType, ModuleType
from typing import Any, AnyStr, Callable, Dict, List, NewType, Optional, Tuple, Type, TypeVar, get_type_hints

# 3rd party
from domdf_python_tools.stringlist import DelimitedList

if sys.version_info < (3, 7, 4): # pragma: no cover (py37+)
# stdlib
from typing import _ForwardRef as ForwardRef # type: ignore[attr-defined]
else: # pragma: no cover (<py37)
from typing import ForwardRef # type: ignore[attr-defined]
from typing import (
Any,
AnyStr,
Callable,
Dict,
ForwardRef,
List,
NewType,
Optional,
Tuple,
Type,
TypeVar,
get_type_hints
)

# 3rd party
import sphinx_autodoc_typehints
from domdf_python_tools.stringlist import DelimitedList
from domdf_python_tools.typing import (
ClassMethodDescriptorType,
MethodDescriptorType,
Expand Down
10 changes: 2 additions & 8 deletions sphinx_toolbox/more_autodoc/typevars.py
Expand Up @@ -173,15 +173,9 @@ def resolve_type(self, forward_ref: ForwardRef) -> Type:
"""

if forward_ref.__forward_evaluated__:
return forward_ref.__forward_value__
return forward_ref.__forward_value__ # type: ignore
else:
if sys.version_info[:2] == (3, 6) and self.object.__module__ == "typing" and isinstance(
self.parent, ModuleType
):
# __module__ is 'typing' for 3.6
globanls = self.parent.__dict__
else:
globanls = sys.modules[self.object.__module__].__dict__
globanls = sys.modules[self.object.__module__].__dict__

eval_ = eval
return eval_(forward_ref.__forward_code__, globanls, globanls)
Expand Down
5 changes: 0 additions & 5 deletions tests/test_issues_output/test_source_output.py
Expand Up @@ -69,11 +69,6 @@ def test_output_github(github_source_page: BeautifulSoup, html_regression: HTMLR

pages_to_check: List[Union[str, ParameterSet]] = [
"autoprotocol.html",
pytest.param(
"generic_bases.html",
marks=only_version(3.6, reason="Output differs on Python 3.6"),
id="generic_bases_36"
),
pytest.param(
"generic_bases.html",
marks=only_version(3.7, reason="Output differs on Python 3.7"),
Expand Down
1 change: 0 additions & 1 deletion tests/test_more_autodoc/test_autodoc_typehints.py
Expand Up @@ -190,7 +190,6 @@ def test_format_annotation(inv, annotation, expected_result):
assert m.group("role") == expected_role


@pytest.mark.skipif(condition=sys.version_info < (3, 7), reason="Broken on 3.6")
@pytest.mark.parametrize(
"annotation, expected_result",
[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_output/_autonamedtuple_demo_pep563.py
@@ -1,4 +1,4 @@
from __future__ import annotations # type: ignore[attr-defined]
from __future__ import annotations

# stdlib
from typing import Callable, NamedTuple
Expand Down
26 changes: 3 additions & 23 deletions tests/test_output/test_output.py
Expand Up @@ -114,34 +114,14 @@ def test_example_html_output(page: BeautifulSoup):
param("latex.html", idx=0),
param("collapse.html", idx=0),
param("footnote_symbols.html", idx=0),
param(
"instancevar.html",
marks=pytest.mark.skipif(
condition=sys.version_info < (3, 7),
reason="Output differs on Python 3.6",
),
idx=0,
),
pytest.param(
"generic_bases.html",
marks=only_version(3.6, reason="Output differs on Python 3.6"),
id="generic_bases_36"
),
param("instancevar.html", idx=0),
pytest.param(
"generic_bases.html",
marks=min_version(3.7, reason="Output differs on Python 3.8+"),
id="generic_bases"
),
pytest.param(
"autonamedtuple_pep563.html",
marks=min_version(3.7, reason="Output differs on Python 3.6, and not as relevant."),
id="autonamedtuple_pep563"
),
pytest.param(
"genericalias.html",
marks=min_version(3.7, reason="Output differs on Python 3.6"),
id="genericalias"
),
pytest.param("autonamedtuple_pep563.html", id="autonamedtuple_pep563"),
pytest.param("genericalias.html", id="genericalias"),
]


Expand Down

0 comments on commit 72cbbbf

Please sign in to comment.