Skip to content

Commit 4e7eb84

Browse files
committed
Add PyPy 3.9 support.
1 parent 96f4a27 commit 4e7eb84

File tree

8 files changed

+119
-18
lines changed

8 files changed

+119
-18
lines changed

.github/workflows/python_ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: "windows-2019"
2323
continue-on-error: ${{ matrix.config.experimental }}
2424
env:
25-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.6,pypy-3.7,pypy-3.8'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.6,pypy-3.6,pypy-3.7,pypy-3.8,pypy39'
2626

2727
strategy:
2828
fail-fast: False
@@ -33,10 +33,11 @@ jobs:
3333
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3434
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3535
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
36-
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
36+
- {python-version: "3.11.0-alpha.6", testenvs: "py311-dev,build", experimental: True}
3737
- {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False}
3838
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
3939
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}
40+
- {python-version: "pypy39", testenvs: "pypy39,build", experimental: True}
4041

4142
steps:
4243
- name: Checkout 🛎️

.github/workflows/python_ci_linux.yml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: "ubuntu-20.04"
2424
continue-on-error: ${{ matrix.config.experimental }}
2525
env:
26-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.6,pypy-3.7,pypy-3.8'
26+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.6,pypy-3.6,pypy-3.7,pypy-3.8,pypy39'
2727

2828
strategy:
2929
fail-fast: False
@@ -34,10 +34,11 @@ jobs:
3434
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3535
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3636
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
37-
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
37+
- {python-version: "3.11.0-alpha.6", testenvs: "py311-dev,build", experimental: True}
3838
- {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False}
3939
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
4040
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}
41+
- {python-version: "pypy39", testenvs: "pypy39,build", experimental: True}
4142

4243
steps:
4344
- name: Checkout 🛎️
@@ -187,22 +188,46 @@ jobs:
187188
with:
188189
python-version: 3.8
189190

191+
- name: Setup Conda
192+
uses: conda-incubator/setup-miniconda@v2
193+
with:
194+
activate-environment: env
195+
conda-build-version: 3.21.0
196+
190197
- name: Install dependencies 🔧
191198
run: |
199+
python -VV
200+
python -m site
192201
python -m pip install --upgrade pip setuptools wheel
193-
python -m pip install --upgrade "mkrecipe" "setuptools>=40.6.0" "wheel>=0.34.2"
202+
python -m pip install --upgrade "mkrecipe" "setuptools<61,>=40.6.0" "wheel>=0.34.2"
203+
# $CONDA is an environment variable pointing to the root of the miniconda directory
204+
$CONDA/bin/conda config --set always_yes yes --set changeps1 no
205+
$CONDA/bin/conda update -n base conda
206+
$CONDA/bin/conda info -a
207+
$CONDA/bin/conda config --add channels conda-forge
208+
$CONDA/bin/conda config --add channels domdfcoding
194209
195-
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh -O miniconda.sh
196-
bash miniconda.sh -b -p $HOME/miniconda
210+
$CONDA/bin/conda config --remove channels defaults
197211
198-
- name: Build Conda 📦
212+
- name: Build Conda Package 📦
199213
run: |
200-
chmod +x .github/actions_build_conda.sh
201-
bash .github/actions_build_conda.sh
214+
python -m mkrecipe --type wheel || exit 1
215+
$CONDA/bin/conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist
202216
203-
- name: Deploy Conda 🚀
217+
- name: Deploy Conda Package 🚀
218+
if: startsWith(github.ref, 'refs/tags/')
204219
run: |
205-
chmod +x .github/actions_deploy_conda.sh
206-
bash .github/actions_deploy_conda.sh
220+
$CONDA/bin/conda config --set always_yes yes --set changeps1 no
221+
$CONDA/bin/conda install anaconda-client
222+
$CONDA/bin/conda info -a
223+
224+
for f in conda/dist/noarch/domdf_python_tools-*.tar.bz2; do
225+
[ -e "$f" ] || continue
226+
echo "$f"
227+
conda install "$f" || exit 1
228+
echo "Deploying to Anaconda.org..."
229+
$CONDA/bin/anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1
230+
echo "Successfully deployed to Anaconda.org."
231+
done
207232
env:
208233
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}

.github/workflows/python_ci_macos.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: "macos-latest"
2323
continue-on-error: ${{ matrix.config.experimental }}
2424
env:
25-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.5,pypy-3.7,pypy-3.8'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11.0-alpha.6,pypy-3.7,pypy-3.8,pypy39'
2626

2727
strategy:
2828
fail-fast: False
@@ -33,9 +33,10 @@ jobs:
3333
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
3434
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
3535
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
36-
- {python-version: "3.11.0-alpha.5", testenvs: "py311-dev,build", experimental: True}
36+
- {python-version: "3.11.0-alpha.6", testenvs: "py311-dev,build", experimental: True}
3737
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: True}
3838
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: True}
39+
- {python-version: "pypy39", testenvs: "pypy39,build", experimental: True}
3940

4041
steps:
4142
- name: Checkout 🛎️

doc-source/api/compat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
.. automodule:: domdf_python_tools.compat
66
:no-autosummary:
77
:no-special-members:
8-
:exclude-members: PYPY,PYPY36,PYPY37,PYPY38
8+
:exclude-members: PYPY,PYPY36,PYPY37,PYPY38,PYPY39,PYPY37_PLUS,PYPY38_PLUS,PYPY39_PLUS

domdf_python_tools/compat/__init__.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@
2323
.. autovariable:: domdf_python_tools.compat.PYPY37
2424
:no-value:
2525
26+
.. autovariable:: domdf_python_tools.compat.PYPY37_PLUS
27+
:no-value:
28+
2629
.. autovariable:: domdf_python_tools.compat.PYPY38
2730
:no-value:
2831
32+
.. autovariable:: domdf_python_tools.compat.PYPY38_PLUS
33+
:no-value:
34+
35+
.. autovariable:: domdf_python_tools.compat.PYPY39
36+
:no-value:
37+
38+
.. autovariable:: domdf_python_tools.compat.PYPY39_PLUS
39+
:no-value:
40+
2941
.. raw:: latex
3042
3143
\end{multicols}
@@ -84,7 +96,11 @@
8496
"PYPY",
8597
"PYPY36",
8698
"PYPY37",
99+
"PYPY37_PLUS",
87100
"PYPY38",
101+
"PYPY38_PLUS",
102+
"PYPY39",
103+
"PYPY39_PLUS",
88104
]
89105

90106
if sys.version_info[:2] < (3, 7) or domdf_python_tools.__docs or TYPE_CHECKING: # pragma: no cover (py37+)
@@ -163,10 +179,43 @@ def __exit__(self, *excinfo):
163179
.. versionadded:: 3.2.0
164180
"""
165181

182+
PYPY39: bool = False
183+
"""
184+
:py:obj:`True` if running on PyPy 3.9.
185+
186+
.. versionadded:: 3.3.0
187+
"""
188+
189+
PYPY37_PLUS: bool = False
190+
"""
191+
:py:obj:`True` if running on PyPy 3.7 or newer.
192+
193+
.. versionadded:: 3.3.0
194+
"""
195+
196+
PYPY38_PLUS: bool = False
197+
"""
198+
:py:obj:`True` if running on PyPy 3.8 or newer.
199+
200+
.. versionadded:: 3.3.0
201+
"""
202+
203+
PYPY39_PLUS: bool = False
204+
"""
205+
:py:obj:`True` if running on PyPy 3.9 or newer.
206+
207+
.. versionadded:: 3.3.0
208+
"""
209+
166210
if PYPY: # pragma: no cover
167211
if sys.version_info[:2] == (3, 6):
168212
PYPY36 = True
169213
elif sys.version_info[:2] == (3, 7):
170214
PYPY37 = True
215+
PYPY37_PLUS = True
171216
elif sys.version_info[:2] == (3, 8):
172217
PYPY38 = True
218+
PYPY38_PLUS = PYPY37_PLUS = True
219+
elif sys.version_info[:2] == (3, 9):
220+
PYPY39 = True
221+
PYPY39_PLUS = PYPY38_PLUS = PYPY37_PLUS = True

repo_helper.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ python_versions:
2828
pypy36:
2929
pypy37:
3030
pypy38:
31+
pypy39:
3132

3233
classifiers:
3334
- 'Development Status :: 5 - Production/Stable'

tests/test_import_tools.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,20 @@ def test_discover_entry_points_by_name_name_match_func(advanced_data_regression:
156156
only_pypy("Output differs on PyPy 3.8")
157157
]
158158
),
159-
pytest.param(3.9, marks=only_version(3.9, reason="Output differs on Python 3.9")),
159+
pytest.param(
160+
3.9,
161+
marks=[
162+
only_version(3.9, reason="Output differs on Python 3.9"),
163+
not_pypy("Output differs on PyPy 3.9")
164+
]
165+
),
166+
pytest.param(
167+
"3.9_pypy",
168+
marks=[
169+
only_version(3.9, reason="Output differs on Python 3.9"),
170+
only_pypy("Output differs on PyPy 3.9")
171+
]
172+
),
160173
pytest.param("3.10", marks=only_version("3.10", reason="Output differs on Python 3.10")),
161174
]
162175
)

tox.ini

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ envlist =
2525
pypy36
2626
pypy37
2727
pypy38
28+
pypy39
2829
mypy
2930
build
3031
skip_missing_interpreters = True
@@ -34,7 +35,17 @@ requires =
3435
tox-envlist>=0.2.1
3536

3637
[envlists]
37-
test = py36, py37, py38, py39, py310, py311-dev, pypy36, pypy37, pypy38
38+
test =
39+
py36
40+
py37
41+
py38
42+
py39
43+
py310
44+
py311-dev
45+
pypy36
46+
pypy37
47+
pypy38
48+
pypy39
3849
qa = mypy, lint
3950
cov = py36, coverage
4051

0 commit comments

Comments
 (0)