Skip to content

Commit cbaa9aa

Browse files
Release pyhops snapshot @ 10beb3f4 (v1.7.0)
Imported from MesoscienceLab/pyhops master at commit 10beb3f4 via the release_to_mesohops.py tool. Identifier renames (pyhops -> mesohops) and display-string renames (PyHOPS -> MesoHOPS) applied during import; private files (README.md, LICENSE, .gitignore) preserved from mesohops master. Highlights of v1.7.0 (vs. mesohops 1.6.0): Build stability: - pyproject.toml: pin all dependency ranges. numba and numpy pinned tight (numba >=0.63,<0.64; numpy >=2.3,<2.4) to guard against a history of stochastic test failures and memory issues that tracked numba minor bumps; numba binds against a specific numpy ABI per release. Other deps loose- pinned at the major. - pyproject.toml: tighten requires-python to >=3.12,<3.14 (matches what CI validates and what the numba pin allows). - pyproject.toml: replace malformed "Development Status :: full release 1.6.0" classifier with the standard trove classifier. - .github/workflows/coverage.yml: matrix CI on Python 3.12 + 3.13 and add a gating clean-install smoke job that runs `pip install .` (non-editable) + level-1 tests; catches packaging bugs the editable-install coverage job hides. Cleanup: - src/mesohops/noise/hops_noise.py: fix __title__ casing typo. - tests/test_git_utils.py: skip test_get_git_commit_hash_success when the installed package is not inside a git working tree (the function returns the git error message string in that case, by design). - Remove two orphan test fixtures (pyhops_testing_noise{,_v0}.npy) that were never referenced by any test. Test results on the imported snapshot: level-2 suite passes 319/319 in a fresh venv with the pinned dep ranges resolving cleanly.
1 parent a1d1820 commit cbaa9aa

52 files changed

Lines changed: 12576 additions & 1851 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coverage

52 KB
Binary file not shown.

.coveragerc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[run]
2+
source = mesohops
3+
relative_files = true
4+
omit =
5+
*/tests/*
6+
*/test_*
7+
setup.py
8+
*/venv/*
9+
*/virtualenv/*
10+
*/site-packages/*
11+
*/timing/timing_analysis.py
12+
*/timing/helper_functions/*
13+
*/timing/timing_models/*
14+
*/timing/__init__.py
15+
16+
[report]
17+
exclude_lines =
18+
pragma: no cover
19+
def __repr__
20+
if self.debug:
21+
if settings.DEBUG
22+
raise AssertionError
23+
raise NotImplementedError
24+
if 0:
25+
if __name__ == .__main__.:
26+
class .*\bProtocol\):
27+
@(abc\.)?abstractmethod
28+
29+
[html]
30+
directory = htmlcov

.github/workflows/coverage.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Code Coverage
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
checks: write # Needed for test reporting
11+
12+
jobs:
13+
coverage:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ['3.12', '3.13']
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies (editable)
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -e .
32+
33+
- name: Run tests with coverage
34+
continue-on-error: true
35+
run: |
36+
# Run tests and generate both coverage and test report
37+
pytest --cov=mesohops --cov-report=xml --cov-report=term --junitxml=test-results.xml -v || true
38+
39+
# Show test results summary
40+
echo "=== Test Results Summary ==="
41+
if [ -f test-results.xml ]; then
42+
echo "Test results file generated"
43+
# Count total tests
44+
total_tests=$(grep -c "<testcase" test-results.xml)
45+
# Count failed tests
46+
failed_tests=$(grep -c "<failure" test-results.xml)
47+
echo "Total tests: $total_tests"
48+
echo "Failed tests: $failed_tests"
49+
echo "Passed tests: $((total_tests - failed_tests))"
50+
else
51+
echo "No test results file generated"
52+
fi
53+
54+
- name: Upload coverage to Codecov
55+
if: matrix.python-version == '3.12'
56+
uses: codecov/codecov-action@v3
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN }}
59+
file: ./coverage.xml
60+
flags: unittests
61+
name: Python Coverage
62+
fail_ci_if_error: false
63+
verbose: true
64+
65+
- name: Publish Test Results
66+
if: always()
67+
uses: mikepenz/action-junit-report@v4
68+
with:
69+
report_paths: 'test-results.xml'
70+
check_name: 'Python Unit Tests (${{ matrix.python-version }})'
71+
fail_on_failure: false
72+
require_tests: false
73+
74+
smoke-install:
75+
# Validates that `pip install .` (non-editable) succeeds and that the
76+
# installed package can run the test suite. Catches packaging bugs the
77+
# editable-install coverage job hides — missing files in the wheel,
78+
# broken pyproject.toml metadata, dependency-resolution failures.
79+
# Gating: a failed clean install must block the PR.
80+
runs-on: ubuntu-latest
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
python-version: ['3.12', '3.13']
85+
86+
steps:
87+
- uses: actions/checkout@v4
88+
89+
- name: Set up Python ${{ matrix.python-version }}
90+
uses: actions/setup-python@v4
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
94+
- name: Clean install (non-editable)
95+
run: |
96+
python -m pip install --upgrade pip
97+
pip install .
98+
99+
- name: Run level-1 tests against installed package
100+
run: |
101+
# Override pytest.ini's addopts to disable coverage measurement here.
102+
# Coverage is the editable-install job's responsibility; in the smoke
103+
# job, the installed-package paths can't be reconciled with the
104+
# `source = mesohops` setting in .coveragerc, so --cov-fail-under=70
105+
# would always trip on a 0% reading.
106+
pytest tests/ --level 1 -v -o addopts=""

codecov.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
comment:
2+
layout: "diff, flags, files" # Shows coverage diff, flags, and file list
3+
behavior: default
4+
require_changes: false # Always post comment, even if no coverage changes
5+
require_base: false # Don't require base report
6+
require_head: true # Require head report
7+
hide_project_coverage: false # Show project coverage
8+
9+
coverage:
10+
status:
11+
project:
12+
default:
13+
target: auto # Compare to previous base commit
14+
threshold: 0% # No threshold requirement
15+
informational: true # Don't block PRs
16+
patch:
17+
default:
18+
target: auto
19+
threshold: 0%
20+
informational: true # Don't block PRs
21+
22+
codecov:
23+
require_ci_to_pass: false # Show coverage even if CI fails
24+
notify:
25+
wait_for_ci: false # Send notifications immediately

0 commit comments

Comments
 (0)