Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/publish-uv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to PyPI with uv

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install 3.12

- name: Build package
run: uv build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write # For trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish
31 changes: 0 additions & 31 deletions .github/workflows/publish.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/pytest.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/pytest_27.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/test-uv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tests with uv

on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main, develop ]

jobs:
test-and-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.13"

- name: Install dependencies
run: uv sync --group dev

- name: Run ruff linter
run: uv run ruff check .

- name: Run black formatter check
run: uv run black --check .

- name: Run mypy type checker
run: uv run mypy shconfparser --ignore-missing-imports

- name: Run tests with coverage
run: uv run pytest --cov=shconfparser --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

build:
runs-on: ubuntu-latest
needs: [test-and-lint]
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.13"

- name: Build package
run: uv build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ celerybeat-schedule
.env

# virtualenv
.venv/
venv/
ENV/

Expand All @@ -98,3 +99,19 @@ ENV/

# Vim or Emac
.tags

# uv package manager
.uv/
uv.lock

# Ruff cache
.ruff_cache/

# Mypy cache
.mypy_cache/
.dmypy.json
dmypy.json

# OS files
.DS_Store
Thumbs.db
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Pre-commit hooks configuration
# Install with: pre-commit install

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: debug-statements

- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: []
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.4
3.12.12
80 changes: 75 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,79 @@
# New in 2.2.5
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0] - 2025-12-27

### 🎉 Major Release - Modernization

This is a major release focused on modernizing the project infrastructure and tooling while maintaining API backward compatibility.

### Added
- ✨ **pyproject.toml** - Modern Python packaging configuration
- ✨ **uv support** - Fast, modern package manager integration
- ✨ **ruff** - Fast Python linter (replaces flake8)
- ✨ **black** - Code formatter for consistent style
- ✨ **mypy** - Static type checker
- ✨ **pre-commit hooks** - Automated code quality checks
- ✨ **Makefile** - Convenient development commands
- ✨ **Type hints** - Improved IDE support and type safety
- ✨ **py.typed** marker - PEP 561 compliance
- ✨ **Modern CI/CD** - GitHub Actions with uv
- ✨ **MODERNIZATION_GUIDE.md** - Comprehensive migration guide
- ✨ **BUSINESS_STANDARDS.md** - Enterprise compliance documentation
- ✨ **PYTHON_COMPATIBILITY.md** - Version support documentation

### Changed
- 🔄 **Python version support** - Now requires Python 3.8+ (dropped 2.7, 3.1-3.7)
- 🔄 **Packaging** - Migrated from setup.py to pyproject.toml
- 🔄 **Build backend** - Now uses hatchling
- 🔄 **Logging** - Modernized with better defaults and configuration
- 🔄 **Development workflow** - Simplified with uv and Makefile
- 🔄 **CI/CD** - Updated to use modern GitHub Actions with uv
- 🔄 **Documentation** - Enhanced README with modern installation instructions
- 🔄 **Code quality** - Automated formatting and linting

### Deprecated
- ⚠️ **Python 2.7** - No longer supported (use version 2.2.5 for Python 2.7)
- ⚠️ **Python 3.1-3.7** - No longer supported
- ⚠️ **setup.py** - Replaced by pyproject.toml (archived as setup_old.py)
- ⚠️ **tox.ini** - Replaced by uv matrix testing
- ⚠️ **requirements*.txt** - Dependencies now in pyproject.toml
- ⚠️ **Pipfile** - Replaced by uv

### Removed
- ❌ Support for Python versions < 3.8

### Fixed
- 🐛 Improved error handling in logging setup
- 🐛 Better type safety across the codebase

### Security
- 🔒 Added CodeQL security scanning
- 🔒 Dependency security auditing
- 🔒 Pre-commit security checks

### Migration Notes
- **For Users**: API is fully backward compatible. Just upgrade: `pip install --upgrade shconfparser`
- **For Developers**: See [MODERNIZATION_GUIDE.md](MODERNIZATION_GUIDE.md) for complete migration instructions
- **Python 2.7 Users**: Stay on version 2.2.5: `pip install shconfparser==2.2.5`

---

## [2.2.5] - 2021-07-XX

### Added
- Added #25 Feature: Adding GitHub actions
- Added #23 Create codeql-analysis.yml
- Updated #22 Bump urllib3 from 1.26.4 to 1.26.5
- Moved from travis to GitHub Actions
- Moved from coversall to codecov.io
- Added pytest for 3.x and 2.7.x
- Added GitHub action to upload package to PyPI
- Added GitHub action to upload package to PyPI

### Changed
- Moved from travis to GitHub Actions
- Moved from coveralls to codecov.io

### Fixed
- Updated #22 Bump urllib3 from 1.26.4 to 1.26.5
Loading