Skip to content

Commit ad75aaf

Browse files
committed
Remove coverage report from python
1 parent 3f51349 commit ad75aaf

3 files changed

Lines changed: 8 additions & 127 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 4 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -100,85 +100,10 @@ jobs:
100100
"*/usr/*" \
101101
"*/opt/*" \
102102
"*/CMakeFiles/*" \
103-
-o coverage/cpp.info --ignore-errors ${IGNORE_ERRORS}
104-
lcov --list coverage/cpp.info
105-
106-
- name: Upload C++ Coverage Report
107-
uses: actions/upload-artifact@v4
108-
with:
109-
name: cpp-coverage
110-
path: ${{ runner.workspace }}/build/coverage/cpp.info
111-
112-
- name: Upload Test Results
113-
uses: actions/upload-artifact@v4
114-
if: always()
115-
with:
116-
name: test-results
117-
path: ${{ runner.workspace }}/build/tests/Debug/test_results.xml
118-
119-
# python-coverage:
120-
# runs-on: ubuntu-latest
121-
122-
# steps:
123-
# - name: Checkout repository
124-
# uses: actions/checkout@v4
125-
126-
# - name: Setup and install python
127-
# uses: actions/setup-python@v5
128-
# with:
129-
# python-version: "3.11"
130-
131-
# - name: Install Dependencies
132-
# run: sudo apt-get update && sudo apt-get install -y lcov
133-
134-
# - name: Build Python Wheels and Run Python Tests
135-
# uses: pypa/cibuildwheel@v3.0.0
136-
# env:
137-
# CIBW_ARCHS: x86_64
138-
# CIBW_BUILD: cp311-manylinux_x86_64
139-
# CIBW_TEST_SKIP: "*manylinux*"
140-
# CIBW_DEBUG_TRACEBACK: TRUE
141-
# CIBW_ENVIRONMENT: CIBW_DEBUG_TRACEBACK=TRUE YUP_ENABLE_COVERAGE=1
142-
# with:
143-
# package-dir: python
144-
145-
# - name: Upload Python Coverage Report
146-
# uses: actions/upload-artifact@v4
147-
# with:
148-
# name: python-coverage
149-
# path: wheelhouse/lcov.info
150-
151-
combine-coverage:
152-
runs-on: ubuntu-latest
153-
needs: [cpp-coverage]
154-
155-
steps:
156-
- name: Checkout repository
157-
uses: actions/checkout@v4
158-
159-
- name: Install Dependencies
160-
run: sudo apt-get update && sudo apt-get install -y lcov
161-
162-
- name: Download C++ Coverage Report
163-
uses: actions/download-artifact@v4
164-
with:
165-
name: cpp-coverage
166-
path: coverage/
167-
168-
#- name: Download Python Coverage Report
169-
# uses: actions/download-artifact@v4
170-
# with:
171-
# name: python-coverage
172-
# path: coverage/
173-
174-
- name: Combine Coverage Reports
175-
run: |
176-
#lcov -r coverage/lcov.info "*/pybind11/*" -o coverage/python.info --ignore-errors ${IGNORE_ERRORS}
177-
#lcov -a coverage/cpp.info -a coverage/python.info -o coverage/coverage_final.info --ignore-errors ${IGNORE_ERRORS}
178-
lcov -a coverage/cpp.info -o coverage/coverage_final.info --ignore-errors ${IGNORE_ERRORS}
103+
-o coverage/coverage_final.info --ignore-errors ${IGNORE_ERRORS}
179104
lcov --list coverage/coverage_final.info
180105
181-
- name: Upload Combined Coverage to Codecov
106+
- name: Upload Coverage to Codecov
182107
uses: codecov/codecov-action@v4
183108
with:
184109
token: ${{ secrets.CODECOV_TOKEN }}
@@ -187,9 +112,9 @@ jobs:
187112
fail_ci_if_error: false
188113
verbose: true
189114

190-
- name: Upload Combined Coverage Reports
115+
- name: Upload Coverage Reports
191116
uses: actions/upload-artifact@v4
192117
if: always()
193118
with:
194119
name: combined-coverage-reports
195-
path: coverage/
120+
path: coverage/

python/pyproject.toml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,13 @@ manylinux-aarch64-image = "manylinux_2_28"
3232
[tool.cibuildwheel.linux]
3333
before-build = [
3434
"""dnf install -y zlib-devel openssl-devel freetype-devel fontconfig-devel freeglut-devel alsa-lib-devel mesa-libGL-devel \
35-
xorg-x11-proto-devel xorg-x11-proto-devel libcurl-devel libpng-devel libX11-devel libXcursor-devel libXrandr-devel \
36-
libXinerama-devel libXrender-devel libXcomposite-devel libXinerama-devel libXcursor-devel xorg-x11-server-Xvfb \
37-
gtk3-devel webkit2gtk3-devel wget lcov""",
38-
39-
#"wget https://github.com/linux-test-project/lcov/releases/download/v2.3.1/lcov-2.3.1-1.noarch.rpm",
40-
#"yum localinstall -y lcov-2.3.1-1.noarch.rpm",
41-
42-
#"wget https://rpmfind.net/linux/epel/7/x86_64/Packages/p/perl-JSON-XS-3.01-2.el7.x86_64.rpm",
43-
#"yum localinstall -y perl-JSON-XS-3.01-2.el7.x86_64.rpm",
44-
45-
#"wget https://repo.almalinux.org/almalinux/8/PowerTools/x86_64/os/Packages/perl-JSON-XS-3.04-3.el8.x86_64.rpm",
46-
#"yum localinstall -y perl-JSON-XS-3.04-3.el8.x86_64.rpm",
47-
48-
#"sed -i \"s/use JSON::PP/use JSON::XS/g\" /usr/bin/geninfo"
49-
# "ln -s /usr/include/freetype2/ft2build.h /usr/include/ft2build.h",
50-
# "ln -s /usr/include/freetype2/freetype /usr/include/freetype"
35+
xorg-x11-proto-devel xorg-x11-proto-devel libcurl-devel libpng-devel libX11-devel libXcursor-devel libXrandr-devel \
36+
libXinerama-devel libXrender-devel libXcomposite-devel libXinerama-devel libXcursor-devel xorg-x11-server-Xvfb \
37+
gtk3-devel webkit2gtk3-devel wget""",
5138
]
5239

5340
test-command = [
5441
"xvfb-run -a -s \"-screen 0 1024x768x24\" pytest -s {project}/python/tests"
5542
# """xvfb-run -a -s \"-screen 0 1024x768x24\" pytest -s {project}/python/tests || \
5643
# { (mkdir -p /output/compare_data && cp {project}/python/tests/compare_data/* /output/compare_data/) ; exit 1 ; }"""
5744
]
58-
59-
#repair-wheel-command = """
60-
#pip install auditwheel-symbols && (auditwheel repair -w {dest_dir} {wheel} || auditwheel-symbols --manylinux 2014 {wheel})
61-
#"""

python/setup.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def __init__(self, name):
8383

8484

8585
class CMakeBuildExtension(build_ext):
86-
build_for_coverage = get_environment_option(int, "YUP_ENABLE_COVERAGE", 0)
8786
build_for_distribution = get_environment_option(int, "YUP_ENABLE_DISTRIBUTION", 0)
8887
build_with_lto = get_environment_option(int, "YUP_ENABLE_LTO", 0)
8988
build_osx_architectures = get_environment_option(str, "YUP_OSX_ARCHITECTURES", "arm64")
@@ -103,7 +102,7 @@ def build_extension(self, ext):
103102
output_path = extdir.parent
104103
output_path.mkdir(parents=True, exist_ok=True)
105104

106-
config = "Debug" if self.debug or self.build_for_coverage else "Release"
105+
config = "Debug" if self.debug else "Release"
107106
cmake_args = [
108107
f"-DYUP_BUILD_WHEEL:BOOL=ON",
109108
f"-DYUP_EXPORT_MODULES:BOOL=OFF",
@@ -123,9 +122,6 @@ def build_extension(self, ext):
123122
f"-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING={self.build_osx_deployment_target}"
124123
]
125124

126-
if self.build_for_coverage:
127-
cmake_args += ["-DYUP_ENABLE_COVERAGE:BOOL=ON"]
128-
129125
if self.build_for_distribution:
130126
cmake_args += ["-DYUP_ENABLE_DISTRIBUTION:BOOL=ON"]
131127

@@ -144,34 +140,11 @@ def build_extension(self, ext):
144140
build_command += ["--", f"-j{os.cpu_count()}"]
145141
self.spawn(build_command)
146142

147-
if self.build_for_coverage:
148-
self.generate_coverage(cwd)
149-
150143
finally:
151144
os.chdir(str(cwd))
152145

153146
self.generate_pyi(cwd)
154147

155-
def generate_coverage(self, cwd):
156-
log.info("generating coverage files")
157-
158-
self.spawn([sys.executable, "-m", "pytest", "-s", os.path.join(cwd, "tests")])
159-
self.spawn(["lcov", "--directory", cwd, "--capture", "--output-file", "coverage/coverage.info",
160-
"--ignore-errors", "gcov,source"])
161-
162-
if not os.path.isdir("/host"): # We are not running in cibuildwheel container
163-
return
164-
165-
for m in glob.iglob(f"{cwd}/**/coverage.info", recursive=True):
166-
log.info(f"found {m} coverage info file")
167-
168-
self.spawn(["sed", "-i", "s:/project/::g", m])
169-
170-
os.makedirs("/output", exist_ok=True)
171-
shutil.copyfile(m, f"/output/lcov.info")
172-
173-
break
174-
175148
def generate_pyi(self, cwd):
176149
log.info("generating pyi files")
177150

0 commit comments

Comments
 (0)