Skip to content

Commit 8723143

Browse files
authored
chore: also run coverage with PyPy 3.10 (#668)
1 parent 506da18 commit 8723143

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: wntrblm/nox@2023.04.22
1919
with:
20-
python-versions: "3.8, 3.11"
20+
python-versions: "3.8, 3.11, pypy3.10"
2121

2222
- name: Install Intel SDE
2323
run: |

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test(session: nox.Session) -> None:
6565
session.run("pytest", *session.posargs, env=env)
6666

6767

68-
@nox.session(python=["3.8", "3.11"])
68+
@nox.session(python=["3.8", "3.11", "pypy3.10"])
6969
def _coverage(session: nox.Session) -> None:
7070
"""internal coverage run. Do not run manually"""
7171
with_sde = "--with-sde" in session.posargs
@@ -132,6 +132,7 @@ def coverage(session: nox.Session) -> None:
132132
assert len(posargs - {"--with-sde"}) == 0
133133
posargs.add("--report")
134134
session.notify("_coverage-3.8", ["--clean"])
135+
session.notify("_coverage-pypy3.10", [])
135136
session.notify("_coverage-3.11", posargs)
136137

137138

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,16 @@ def base64_build(plat_name):
174174
class BuildExt(build_ext):
175175
def finalize_options(self):
176176
if "-coverage" in os.environ.get("CFLAGS", "").split():
177-
coverage_build = HERE / "build" / "coverage"
177+
plat_name = getattr(self, "plat_name", None) or sysconfig.get_platform()
178+
temp_name = f"coverage-{plat_name}-{sys.implementation.cache_tag}"
179+
coverage_build = HERE / "build" / temp_name
178180
if coverage_build.exists():
179181
shutil.rmtree(coverage_build)
180182
self.build_temp = str(coverage_build)
181183
super().finalize_options()
182184

183185
def run(self):
184-
plat_name = None
185-
if hasattr(self, "plat_name"):
186-
plat_name = getattr(self, "plat_name")
186+
plat_name = getattr(self, "plat_name", None)
187187
with base64_build(plat_name):
188188
super().run()
189189

0 commit comments

Comments
 (0)