Skip to content

Commit 76dc90e

Browse files
committed
Test on PyPy 3.7 and Python 3.10 alpha 6
1 parent cc37eea commit 76dc90e

File tree

6 files changed

+35
-15
lines changed

6 files changed

+35
-15
lines changed

.github/workflows/python_ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: "windows-2019"
1414
continue-on-error: ${{ matrix.config.experimental }}
1515
env:
16-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5,pypy-3.6'
16+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6,pypy-3.6,pypy-3.7'
1717

1818
strategy:
1919
fail-fast: False
@@ -23,8 +23,9 @@ jobs:
2323
- {python-version: "3.7", testenvs: "py37-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2424
- {python-version: "3.8", testenvs: "py38-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2525
- {python-version: "3.9", testenvs: "py39-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26-
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27-
- {python-version: "pypy-3.6", testenvs: "pypy3-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26+
- {python-version: "3.10.0-alpha.6", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27+
- {python-version: "pypy-3.6", testenvs: "pypy36-attrs{19.3,20.1,20.2,latest},build", experimental: False}
28+
- {python-version: "pypy-3.7", testenvs: "pypy37-attrs{19.3,20.1,20.2,latest},build", experimental: True}
2829

2930
steps:
3031
- name: Checkout 🛎️

.github/workflows/python_ci_linux.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: "ubuntu-20.04"
1414
continue-on-error: ${{ matrix.config.experimental }}
1515
env:
16-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5,pypy-3.6'
16+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6,pypy-3.6,pypy-3.7'
1717

1818
strategy:
1919
fail-fast: False
@@ -23,8 +23,9 @@ jobs:
2323
- {python-version: "3.7", testenvs: "py37-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2424
- {python-version: "3.8", testenvs: "py38-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2525
- {python-version: "3.9", testenvs: "py39-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26-
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27-
- {python-version: "pypy-3.6", testenvs: "pypy3-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26+
- {python-version: "3.10.0-alpha.6", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27+
- {python-version: "pypy-3.6", testenvs: "pypy36-attrs{19.3,20.1,20.2,latest},build", experimental: False}
28+
- {python-version: "pypy-3.7", testenvs: "pypy37-attrs{19.3,20.1,20.2,latest},build", experimental: True}
2829

2930
steps:
3031
- name: Checkout 🛎️

.github/workflows/python_ci_macos.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: "macos-latest"
1414
continue-on-error: ${{ matrix.config.experimental }}
1515
env:
16-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5,pypy-3.6'
16+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.6,pypy-3.6,pypy-3.7'
1717

1818
strategy:
1919
fail-fast: False
@@ -23,8 +23,9 @@ jobs:
2323
- {python-version: "3.7", testenvs: "py37-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2424
- {python-version: "3.8", testenvs: "py38-attrs{19.3,20.1,20.2,latest},build", experimental: False}
2525
- {python-version: "3.9", testenvs: "py39-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26-
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27-
- {python-version: "pypy-3.6", testenvs: "pypy3-attrs{19.3,20.1,20.2,latest},build", experimental: False}
26+
- {python-version: "3.10.0-alpha.6", testenvs: "py310-dev-attrs{19.3,20.1,20.2,latest},build", experimental: True}
27+
- {python-version: "pypy-3.6", testenvs: "pypy36-attrs{19.3,20.1,20.2,latest},build", experimental: False}
28+
- {python-version: "pypy-3.7", testenvs: "pypy37-attrs{19.3,20.1,20.2,latest},build", experimental: True}
2829

2930
steps:
3031
- name: Checkout 🛎️

attr_utils/docstrings.py

+17-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828

2929
# stdlib
3030
import re
31+
from types import MethodType
3132
from typing import Optional, Pattern, Type
3233

3334
# 3rd party
34-
from domdf_python_tools.doctools import PYPY, base_new_docstrings, prettify_docstrings
35+
from domdf_python_tools.compat import PYPY37, PYPY
36+
from domdf_python_tools.doctools import base_new_docstrings, prettify_docstrings
3537
from domdf_python_tools.typing import MethodDescriptorType, MethodWrapperType, WrapperDescriptorType
3638

3739
__all__ = ["add_attrs_doc"]
@@ -79,8 +81,20 @@ def add_attrs_doc(obj: Type) -> Type:
7981

8082
attribute = getattr(obj, attr_name)
8183

82-
if not PYPY and isinstance(attribute, (WrapperDescriptorType, MethodDescriptorType, MethodWrapperType)):
83-
continue
84+
if not PYPY and isinstance(
85+
attribute,
86+
(WrapperDescriptorType, MethodDescriptorType, MethodWrapperType, MethodType),
87+
):
88+
continue # pragma: no cover (!PyPy)
89+
elif PYPY and isinstance(attribute, MethodType):
90+
continue # pragma: no cover
91+
elif PYPY37: # pragma: no cover (not (PyPy and py37))
92+
if attribute is getattr(object, attr_name, None):
93+
continue
94+
elif attribute is getattr(float, attr_name, None):
95+
continue
96+
elif attribute is getattr(str, attr_name, None):
97+
continue
8498

8599
if attribute is None:
86100
continue

repo_helper.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ python_versions:
1818
- '3.8'
1919
- '3.9'
2020
- 3.10-dev
21-
- pypy3
21+
- pypy36
22+
- pypy37
2223

2324
extras_require:
2425
sphinx:

tox.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ envlist =
2121
py38-attrs{19.3,20.1,20.2,latest}
2222
py39-attrs{19.3,20.1,20.2,latest}
2323
py310-dev-attrs{19.3,20.1,20.2,latest}
24-
pypy3-attrs{19.3,20.1,20.2,latest}
24+
pypy36-attrs{19.3,20.1,20.2,latest}
25+
pypy37-attrs{19.3,20.1,20.2,latest}
2526
mypy
2627
build
2728
skip_missing_interpreters = True
@@ -38,7 +39,8 @@ test =
3839
py38-attrs{19.3,20.1,20.2,latest}
3940
py39-attrs{19.3,20.1,20.2,latest}
4041
py310-dev-attrs{19.3,20.1,20.2,latest}
41-
pypy3-attrs{19.3,20.1,20.2,latest}
42+
pypy36-attrs{19.3,20.1,20.2,latest}
43+
pypy37-attrs{19.3,20.1,20.2,latest}
4244
qa = mypy, lint
4345
cov = py36-attrs19.3, coverage
4446

0 commit comments

Comments
 (0)