Skip to content

Commit 20f4bf1

Browse files
author
Test User
committed
readd coverage
1 parent b458877 commit 20f4bf1

2 files changed

Lines changed: 53 additions & 11 deletions

File tree

.github/workflows/tests.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,35 @@ jobs:
166166
if: runner.os == 'Linux'
167167
with:
168168
python-version: '3.13'
169+
- name: Combine coverage Linux
170+
if: runner.os == 'Linux'
171+
run: |-
172+
echo '############ PWD'
173+
pwd
174+
cp .wheelhouse/.coverage* . || true
175+
ls -al
176+
uv pip install coverage[toml] | pip install coverage[toml]
177+
echo '############ combine'
178+
coverage combine . || true
179+
echo '############ XML'
180+
coverage xml -o ./coverage.xml || true
181+
echo '### The cwd should now have a coverage.xml'
182+
ls -altr
183+
pwd
184+
- uses: codecov/codecov-action@v5.5.2
185+
name: Codecov Upload
186+
env:
187+
HAVE_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
188+
# Only upload coverage if we have the token
189+
if: ${{ env.HAVE_PERSONAL_TOKEN == 'true' }}
190+
with:
191+
file: ./coverage.xml
192+
token: ${{ secrets.CODECOV_TOKEN }}
193+
- uses: codecov/codecov-action@v5.5.2
194+
name: Codecov Upload
195+
with:
196+
file: ./coverage.xml
197+
token: ${{ secrets.CODECOV_TOKEN }}
169198
- uses: actions/upload-artifact@v6.0.0
170199
name: Upload wheels artifact
171200
with:
@@ -376,18 +405,9 @@ jobs:
376405
fpath = sdists[-1]
377406
print(str(fpath).replace(chr(92), chr(47)))
378407
")
379-
export MOD_VERSION=$(python -c "if 1:
380-
from pkginfo import Wheel, SDist
381-
import pathlib
382-
fpath = '$WHEEL_FPATH'
383-
cls = Wheel if fpath.endswith('.whl') else SDist
384-
item = cls(fpath)
385-
print(item.version)
386-
")
387408
echo "WHEEL_FPATH=$WHEEL_FPATH"
388409
echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
389410
echo "UV_RESOLUTION=$UV_RESOLUTION"
390-
echo "MOD_VERSION=$MOD_VERSION"
391411
python -m pip install --prefer-binary "${WHEEL_FPATH}[${INSTALL_EXTRAS}]"
392412
echo "Install finished."
393413
- name: Test wheel ${{ matrix.install-extras }}
@@ -422,6 +442,26 @@ jobs:
422442
echo "changing directory back to th repo root"
423443
cd ..
424444
ls -al
445+
- name: Combine coverage Linux
446+
if: runner.os == 'Linux'
447+
run: |-
448+
echo '############ PWD'
449+
pwd
450+
cp .wheelhouse/.coverage* . || true
451+
ls -al
452+
uv pip install coverage[toml] | pip install coverage[toml]
453+
echo '############ combine'
454+
coverage combine . || true
455+
echo '############ XML'
456+
coverage xml -o ./coverage.xml || true
457+
echo '### The cwd should now have a coverage.xml'
458+
ls -altr
459+
pwd
460+
- uses: codecov/codecov-action@v5.5.2
461+
name: Codecov Upload
462+
with:
463+
file: ./coverage.xml
464+
token: ${{ secrets.CODECOV_TOKEN }}
425465
test_deploy:
426466
name: Deploy Test
427467
runs-on: ubuntu-latest

docs/source/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,11 @@ def create_doctest_figure(app, obj, name, lines):
838838
The idea is that each doctest that produces a figure should generate that
839839
and then that figure should be part of the docs.
840840
"""
841-
import xdoctest
842841
import sys
843842
import types
844843

844+
import xdoctest
845+
845846
if isinstance(obj, types.ModuleType):
846847
module = obj
847848
else:
@@ -1035,9 +1036,10 @@ def postprocess_hyperlinks(app, doctree, docname):
10351036
"autodoc-process-docstring" event.
10361037
"""
10371038
# Your hyperlink postprocessing logic here
1038-
from docutils import nodes
10391039
import pathlib
10401040

1041+
from docutils import nodes
1042+
10411043
for node in doctree.traverse(nodes.reference):
10421044
if 'refuri' in node.attributes:
10431045
refuri = node.attributes['refuri']

0 commit comments

Comments
 (0)