Skip to content

Commit

Permalink
release-2.2.0
Browse files Browse the repository at this point in the history
Enhance Packaging, Testing, and Infrastructure with Modern Tools and Features
  • Loading branch information
jacksonpradolima authored Dec 28, 2024
2 parents 46eca97 + 4e01379 commit 03a9db5
Show file tree
Hide file tree
Showing 31 changed files with 856 additions and 328 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
insert_final_newline = true

[*.yml]
indent_size = 2
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is used to automatically assign reviewers to PRs
# For more information see: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

* @jacksonpradolima
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Bug report
description: Report an issue or bug with this library
labels: ['bug']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
id: non_api
attributes:
label: Confirm this is an issue with the gsp-py library.
description: Issues relevant to other tools should be directed to their respective repositories.
options:
- label: This is an issue with the gsp-py library
required: true
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is, and any additional context.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Fetch a '...'
2. Update the '....'
3. See error
validations:
required: true
- type: textarea
id: code-snippets
attributes:
label: Code snippets
description: If applicable, add code snippets to help explain your problem.
render: Python
validations:
required: false
- type: input
id: os
attributes:
label: OS
placeholder: macOS
validations:
required: true
- type: input
id: language-version
attributes:
label: Python version
placeholder: Python v3.11.4
validations:
required: true
- type: input
id: lib-version
attributes:
label: Library version
placeholder: gsp-py v1.0.0
validations:
required: true
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: gsp-py Support
url: https://github.com/jacksonpradolima/gsp-py
about: |
Please only file issues here if they relate to actual bugs or feature requests for the gsp-py project.
For more general discussions or questions, open an issue and select the appropriate template.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature request
description: Suggest an idea for this library
labels: ['feature-request']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: checkboxes
id: non_api
attributes:
label: Confirm this is a feature request for the gsp-py library.
description: Feature requests relevant to other tools should be directed to the correct repository.
options:
- label: This is a feature request for the gsp-py library
required: true
- type: textarea
id: feature
attributes:
label: Describe the feature or improvement you're requesting
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the feature request here.
51 changes: 51 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Code Quality

on:
pull_request:
types: [ opened, synchronize, reopened, edited, ready_for_review ]

jobs:
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Install Rye (via Curl)
- name: Install Rye
uses: eifinger/setup-rye@v4
with:
version: '0.43.0'
enable-cache: 'true'

# Step 3: Sync dependencies
- name: Sync dependencies
run: rye sync

# Step 4: Get changed Python files
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/changed-files@v45
with:
files: |
*.py
**/*.py
# Step 5: Run Ruff for only changed files
- name: Run Ruff (Lint)
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
echo "Running Ruff on changed files..."
echo "Changed files: ${{ steps.changed-py-files.outputs.all_changed_files }}"
rye run lint ${{ steps.changed-py-files.outputs.all_changed_files }}
# Step 6: Run Pyright for only changed files
- name: Run Pyright (Type Check)
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
echo "Running Pyright on changed files..."
echo "Changed files: ${{ steps.changed-py-files.outputs.all_changed_files }}"
rye run typecheck ${{ steps.changed-py-files.outputs.all_changed_files }}
5 changes: 4 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
python-version: 3.11

- name: Install dependencies
run: pip install -r requirements-dev.txt
run: |
pip install pytest==8.3.4 \
pytest-benchmark==5.1.0 \
pytest-cov==6.0.0
- name: Run tests
run: pytest --cov --cov-branch --junitxml=junit.xml -o junit_family=legacy
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,25 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/gsppy
url: https://pypi.org/project/gsppy/
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install build
- name: Build package
run: |
python setup.py sdist bdist_wheel # Could also be python -m build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.3

54 changes: 0 additions & 54 deletions .github/workflows/pylint.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
3.6.15
3.7.12
3.8.10
3.9.16
3.10.12
3.11.4
3.12.8
3.13.1
77 changes: 73 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## [v2.2.0] - 2024-12-27

### **New Features**
- Added a `.github/CODEOWNERS` file to automatically assign reviewers for pull requests.
- Introduced new issue templates:
- `bug_report.yml` for structured bug reporting.
- `feature_request.yml` for feature suggestions.
- `config.yml` to disable blank issues and provide guidance for issue reporting.

### **Infrastructure Improvements**
- Added `SECURITY.md` to define the project's security policy, including supported versions and responsible disclosure practices.
- Updated `.python-version` to include support for Python versions `3.12.8` and `3.13.1`.
- **Migrated Dependency and Virtual Environment Management to Rye**:
- Introduced [Rye](https://github.com/mitsuhiko/rye) for managing Python dependencies and virtual environments.
- Deprecated the `requirements-dev.txt` file in favor of managing dependencies in `pyproject.toml`.
- Updated documentation to include instructions for using `rye sync` to set up the project environment.
- Updated CI workflows to install and use dependencies directly via Rye.

### **CLI Enhancements**
- Improved `gsppy/cli.py`:
- Enhanced logging setup with verbosity options (`--verbose`).
- Added type annotations for improved readability and maintainability.
- Refined error handling and user feedback for invalid inputs.

### **Algorithm and Utility Enhancements**
- Updated GSP implementation in `gsppy/gsp.py`:
- Added type annotations and clarified logic in methods.
- Improved `_worker_batch` and `_support` functions for better performance and readability.
- Enhanced utility functions in `gsppy/utils.py`:
- Added stricter typing and validation in utilities like `is_subsequence_in_list`.

### **Testing and Quality**
- Reorganized tests:
- Moved test files from `gsppy/tests/` to `tests/` for a cleaner structure.
- Refactored test cases with type annotations and enhanced mock handling.
- Introduced additional dev dependencies in `requirements-dev.txt`:
- `mypy`, `pyright`, and `ruff` for static analysis and linting.
- `cython` for performance optimization in future releases.
- Added `mypy.ini` and updated `pyproject.toml` for stricter type-checking and configuration consistency.

### **Build and Packaging**
- Migrated to `pyproject.toml` for modern Python packaging:
- Removed `setup.py` and `setup.cfg`.
- Introduced `hatch` and `hatchling` for streamlined builds.
- Updated GitHub Actions workflows:
- Fixed PyPI URL in `publish.yml`.
- Updated build steps to use `python -m build` for consistency.

## [v2.1.0] - 2024-12-26

### **Compatibility Updates**
Expand Down Expand Up @@ -98,7 +146,28 @@

## **Summary of Changes**

### From v2.0 to v2.1.0
- Enhanced compatibility with earlier Python versions (3.8+).
- Improved testing and dependency management.
- Updated workflows and documentation for broader support and clarity.
### From v2.1.0 to v2.2.0
- **New Features**:
- Added `.github/CODEOWNERS` and issue templates for better pull request and issue management.
- Introduced a `SECURITY.md` file to define project security policies.

- **Infrastructure Improvements**:
- Added Python 3.12.8 and 3.13.1 compatibility in `.python-version`.
- Migrated to `pyproject.toml` for modern Python packaging, replacing `setup.py` and `setup.cfg`.
- Adopted **Rye** for dependency management and virtual environment setup:
- Deprecated `requirements-dev.txt` in favor of managing all dependencies in `pyproject.toml`.
- Updated workflows and documentation to reflect the use of `rye sync` for environment setu

- **CLI Enhancements**:
- Improved logging, error handling, and added type annotations in the CLI.

- **Algorithm & Utility Enhancements**:
- Refactored the GSP algorithm for better performance and clarity.
- Enhanced utility functions with stricter typing and validation.

- **Testing & Quality**:
- Reorganized tests into a cleaner structure, added static analysis tools, and improved type-checking configurations.

- **Build & Packaging**:
- Streamlined the build process with `hatch` and `hatchling`.
- Updated GitHub Actions workflows for improved consistency and functionality.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors:
given-names: "Jackson Antonio do"
orcid: "https://orcid.org/10.5281/zenodo.3333987"
year: 2024
version: "2.1.0"
version: "2.2.0"
doi: "10.5281/zenodo.3333987"
url: "https://github.com/jacksonpradolima/gsp-py"
repository-code: "https://github.com/jacksonpradolima/gsp-py"
Expand Down
Loading

0 comments on commit 03a9db5

Please sign in to comment.