-
Notifications
You must be signed in to change notification settings - Fork 15
CI modernization #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bernalde
wants to merge
22
commits into
nasa:main
Choose a base branch
from
SECQUOIA:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CI modernization #32
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Update all workflows to latest GitHub Actions (v4/v5) - Expand Python support from 3.7-3.8 to 3.8-3.12 - Add comprehensive CI workflow (ci.yml) orchestrating all checks - Add dedicated code coverage workflow with Codecov integration - Add PR comment workflow for automated result summaries - Implement pip caching for faster builds - Add parallel test execution with pytest-xdist New Features: - Dependabot configuration for automated dependency updates - CI issue template and PR template for better contributions - Development requirements file (requirements-dev.txt) - Comprehensive CI documentation (docs/CI_INFRASTRUCTURE.md) - CHANGELOG.md for tracking project changes Workflow Improvements: - python-pytest.yml: Python 3.8-3.12, coverage reporting, caching - python-yapf.yml: Updated actions, caching - python-tutorials.yml: Python 3.9-3.11, artifact uploads, error handling - python-example.yml: Python 3.9-3.11, added example_ais.py Documentation: - Added CI status badges to README - Added 'Testing and CI' section with local testing guide - Updated setup.py with Python 3.8-3.12 classifiers Breaking Changes: - Dropped Python 3.7 support (EOL June 2023) - Dropped Python 3.6 support (EOL December 2021)
…ction_post (numpy arrays for numba)
- Add test_ais.py with tests for partition_function_post, get_log_omega, and omegas_to_partition - Test that partition_function_post correctly processes multiple samples (exercises the indentation bug) - Test error handling when beta=0 is not present - Test consistency and determinism of calculations - All tests currently pass with the fixed code
The beta_idx calculation, numpy import, and log_omegas append were incorrectly dedented outside the for loop, causing only the last sample to be processed instead of all samples. Fixed by: - Moving these lines inside the for loop with proper indentation - Moving numpy import to top of function for better code organization This bug would have caused incorrect partition function calculations when processing multiple samples. The new tests in test_ais.py verify the fix works correctly. Addresses critical bug identified in PR #1 review
Added: - .coverage (coverage database) - coverage.xml (coverage report) - htmlcov/ (HTML coverage reports) - .pytest_cache/ (pytest cache directory) These files are generated during testing and should not be committed. Addresses issue identified in PR #1 review where .coverage file was accidentally committed.
Added token parameter to codecov/codecov-action@v4 in all workflows: - python-pytest.yml - ci.yml - coverage.yml The codecov-action@v4 requires a token for reliable uploads, especially for public repositories. Without it, uploads may fail silently due to continue-on-error: true settings. Addresses reviewer nitpick from PR #1
Moved pytest from runtime dependencies to dev-only: - Removed from pyproject.toml dependencies list - Removed from requirements.txt - Already properly listed in requirements-dev.txt pytest is a development/testing tool and should not be installed for all users of the package. It should only be installed when developing or testing the package. Addresses reviewer comment from PR #1
Changed Coverage Summary step to use 'coverage report' instead of re-running pytest, which is more efficient and avoids re-executing all tests just to display the summary. The .coverage file is already generated from the test run on line 30, so we can directly use 'coverage report' to display the summary. Addresses reviewer performance comment from PR #1
Removed the redundant 'import numpy as np' statement inside the partition_function_post function (line 37). Numpy is already imported at the module level (line 20), so this local import is unnecessary. Addresses reviewer comment from PR #1
Changed docstrings to raw strings (r'''...''') in: - uniform_prob_initialization - bernoulli_prob_initialization This fixes DeprecationWarning for invalid escape sequence '\pm' which is used to represent the LaTeX ± symbol. Using raw strings prevents Python from trying to interpret backslash sequences. Fixes pytest warnings from test runs
Fixed typo in conda environment file name in README.md: - Changed 'envinronment.yml' to 'environment.yml' Note: Artifact names with periods (tutorial-outputs-py3.9) work fine in GitHub Actions despite the reviewer's concern. The replace() function is not available in GitHub Actions expressions, and periods in artifact names are commonly used without issues.
Comprehensive CI infrastructure modernization and enhancements
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive overhaul and standardization of the project's continuous integration (CI) and GitHub workflow infrastructure. It adds new workflow files, updates existing ones for better consistency and coverage, and introduces templates and configuration files to improve the development process and issue reporting. The most important changes are grouped below by theme.
CI/CD Infrastructure Overhaul:
ci.yml) that covers linting, testing across multiple Python versions, running examples and tutorials, uploading coverage, and gating PRs on all checks passing. This workflow replaces and consolidates previous individual workflows.coverage.yml), including both XML and HTML reports and summary output.pr-comment.yml) to automatically post or update a summary comment on pull requests with CI results, improving feedback for contributors.Workflow Modernization and Standardization:
python-pytest.yml,python-example.yml,python-tutorials.yml,python-yapf.yml) to use the latest GitHub Actions versions, matrix over more Python versions, cache dependencies, and produce consistent outputs and artifact uploads. [1] [2] [3] [4]Dependency Management Automation:
dependabot.ymlconfiguration to automate updates for GitHub Actions and Python dependencies, with custom labeling, commit message conventions, and rules to ignore major version updates for critical libraries likenumpyandscipy.Templates and Documentation:
PULL_REQUEST_TEMPLATE.md) to standardize PR submissions, including sections for description, testing, and checklists.ci_issue.yml) to improve the quality and consistency of CI-related bug reports.These changes collectively modernize the CI infrastructure, streamline contributor workflows, and automate routine maintenance tasks, making the project easier to maintain and contribute to.