-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enhance Packaging, Testing, and Infrastructure with Modern Tools and Features #9
Conversation
- Introduce structured issue templates for bug reports and feature requests, ensuring contributors provide essential details. - Configure the repository to disable blank issues, add contact links, and assign a default code owner for PR reviews.
- Remove old Python versions 3.6 and 3.7 and add 3.12 and 3.13. - Update tox configuration to include the new Python versions in the testing matrix.
Moved test files out of the gsppy module to a dedicated top-level tests directory for better organization.
- Introduce a `mypy.ini` file to enforce strict type-checking rules and manage MyPy configuration. - This includes enabling warnings, disallowing untyped elements, and fine-tuning settings to avoid conflicts with Pyright.
- Replaced setup.py and setup.cfg with pyproject.toml to modernize the build system using Hatch. - Updated dependencies accordingly and aligned configuration for tooling such as pytest, ruff, and pyright.
- Updated the PyPI project URL and replaced `setup.py` usage with `python -m build` for a more modern and reliable build process. - Also refined the dependency installation step to use `pip install build` instead of directly installing `setuptools` and `wheel`.
- Reorganized imports for consistency and readability across modules. - Replaced `print` statements with a centralized logging mechanism in CLI for better output control. - Updated CLI tests to mock logger calls instead of capturing stdout for more robust testing.
- Introduced stricter and more descriptive type hints throughout the codebase to improve readability and type safety. - Removed redundant validation checks for transaction structures, as they are now enforced through type hints.
- Added detailed type hints across various modules to improve code clarity. - Leveraged `lru_cache` for optimization in utility functions. - Updated tests to align with strong type annotations and added linting configurations to suppress specific warnings.
Adjust import order in `test_utils.py`, `test_gsp.py`, and `test_cli.py` for better readability and adherence to coding standards. This change ensures a consistent and logical grouping of imports across the test suite.
- This commit introduces a test to verify that the `setup_logging` function sets the logging level to DEBUG when the `--verbose` flag is provided. - It mocks CLI arguments, file reading, and the GSP algorithm to ensure proper functionality without dependencies. - The new test enhances coverage and ensures logging behavior works as expected.
This release introduces `.github/CODEOWNERS`, issue templates, and a `SECURITY.md` file for enhanced project management and security. Key improvements include Python 3.12/3.13 support, CLI enhancements, GSP algorithm optimizations, and a migration to `pyproject.toml` for modern packaging. Testing, build processes, and workflows have also been restructured for better quality and maintainability.
- Replaced `requirements-dev.txt` with Rye-managed lock files and updated `pyproject.toml` to include all dependencies and scripts. - Updated documentation and CI workflow to reflect the use of Rye, simplifying setup and improving consistency in dependency management.
- Replaced previous dependency management with Rye, updating workflows and documentation accordingly. - Deprecated `requirements-dev.txt` in favor of using `pyproject.toml`. - Updated CI workflows and tools like Ruff, Pyright, and Mypy to align with the new setup.
Corrected an extra space in the pytest version specification within the Codecov workflow file. This ensures the dependencies are installed properly during the CI/CD pipeline execution.
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #9 +/- ##
==========================================
+ Coverage 99.50% 99.75% +0.24%
==========================================
Files 6 6
Lines 405 409 +4
Branches 22 20 -2
==========================================
+ Hits 403 408 +5
+ Partials 2 1 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Replaced manual Rye installation with the `eifinger/setup-rye` action to streamline setup. Simplified dependency synchronization and improved maintainability by specifying Rye version directly.
Updated the error message in the CLI test to use consistent string formatting. This ensures clarity and adherence to the preferred style across the codebase. No functional impact on the test logic.
Replaced specific type hints with more generic annotations (`Any`) for better flexibility when handling unique candidates. This ensures compatibility with a broader range of data types within the GSP implementation.
The Mypy step for type-checking changed files was removed to streamline the code quality workflow. Other steps, like Pylint and type checks using Rye, remain in place to ensure code quality.
Included pylint and its related dependencies (astroid, dill, isort, mccabe, platformdirs, tomli, tomlkit, and typing-extensions) in the development environment. Updated both `requirements-dev.lock` and `pyproject.toml` to reflect these changes.
Eliminated Pylint configuration and its execution steps from the code quality workflow. This streamlines the workflow by focusing on Pyright for type checking, simplifying maintenance and reducing redundancy."
|
Before submitting a pull request make sure you have:
Contents of the Pull Request
This pull request introduces significant updates and new features to the project:
New Features
.github/CODEOWNERS
file for automatic reviewer assignments.SECURITY.md
to outline the security policy, supported versions, and disclosure practices.Infrastructure Enhancements
pyproject.toml
for modern Python packaging, replacingsetup.py
andsetup.cfg
.Rye
for dependency and virtual environment management..python-version
to include Python versions 3.12.8 and 3.13.1.CLI Improvements
gsppy/cli.py
with:--verbose
flag.Testing & Quality
tests
directory.mypy
andpyright
.Stacked PR Chains (Optional)
How Has This Been Tested? (Required)
The following tests and validations were performed:
Unit Tests:
Integration Tests:
Manual Testing:
Rye
for environment setup.Test Configuration:
pytest
,pyright
,ruff
,tox
Other Notes
requirements-dev.txt
and migrates all configurations topyproject.toml
.