Skip to content

Commit d96492a

Browse files
authored
Merge pull request #36 from network-tools/refactor-shconfparser
code refactor - version 3.0.0
2 parents b6096c7 + 6298baa commit d96492a

42 files changed

Lines changed: 4341 additions & 1199 deletions

Some content is hidden

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

.github/workflows/publish-uv.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to PyPI with uv
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v4
19+
20+
- name: Set up Python
21+
run: uv python install 3.12
22+
23+
- name: Build package
24+
run: uv build
25+
26+
- name: Upload artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: dist
30+
path: dist/
31+
32+
publish:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
permissions:
36+
id-token: write # For trusted publishing
37+
steps:
38+
- name: Download artifacts
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v4
46+
47+
- name: Publish to PyPI
48+
env:
49+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
50+
run: uv publish

.github/workflows/publish.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/pytest.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/pytest_27.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/test-uv.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Tests with uv
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main, develop ]
8+
9+
jobs:
10+
test-and-lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
with:
19+
python-version: "3.13"
20+
21+
- name: Install dependencies
22+
run: uv sync --group dev
23+
24+
- name: Run ruff linter
25+
run: uv run ruff check .
26+
27+
- name: Run black formatter check
28+
run: uv run black --check .
29+
30+
- name: Run mypy type checker
31+
run: uv run mypy shconfparser --ignore-missing-imports
32+
33+
- name: Run tests with coverage
34+
run: uv run pytest --cov=shconfparser --cov-report=xml --cov-report=term
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v4
38+
with:
39+
file: ./coverage.xml
40+
flags: unittests
41+
name: codecov-umbrella
42+
fail_ci_if_error: false
43+
44+
build:
45+
runs-on: ubuntu-latest
46+
needs: [test-and-lint]
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v4
52+
with:
53+
python-version: "3.13"
54+
55+
- name: Build package
56+
run: uv build
57+
58+
- name: Upload artifacts
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: dist
62+
path: dist/

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ celerybeat-schedule
8484
.env
8585

8686
# virtualenv
87+
.venv/
8788
venv/
8889
ENV/
8990

@@ -98,3 +99,19 @@ ENV/
9899

99100
# Vim or Emac
100101
.tags
102+
103+
# uv package manager
104+
.uv/
105+
uv.lock
106+
107+
# Ruff cache
108+
.ruff_cache/
109+
110+
# Mypy cache
111+
.mypy_cache/
112+
.dmypy.json
113+
dmypy.json
114+
115+
# OS files
116+
.DS_Store
117+
Thumbs.db

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Pre-commit hooks configuration
2+
# Install with: pre-commit install
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.5.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-added-large-files
12+
- id: check-json
13+
- id: check-toml
14+
- id: check-merge-conflict
15+
- id: debug-statements
16+
17+
- repo: https://github.com/psf/black
18+
rev: 24.2.0
19+
hooks:
20+
- id: black
21+
language_version: python3.8
22+
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.3.0
25+
hooks:
26+
- id: ruff
27+
args: [--fix, --exit-non-zero-on-fix]
28+
29+
- repo: https://github.com/pre-commit/mirrors-mypy
30+
rev: v1.8.0
31+
hooks:
32+
- id: mypy
33+
additional_dependencies: []

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.4
1+
3.12.12

CHANGELOG.md

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,79 @@
1-
# New in 2.2.5
1+
# Changelog
22

3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [3.0.0] - 2025-12-27
9+
10+
### 🎉 Major Release - Modernization
11+
12+
This is a major release focused on modernizing the project infrastructure and tooling while maintaining API backward compatibility.
13+
14+
### Added
15+
-**pyproject.toml** - Modern Python packaging configuration
16+
-**uv support** - Fast, modern package manager integration
17+
-**ruff** - Fast Python linter (replaces flake8)
18+
-**black** - Code formatter for consistent style
19+
-**mypy** - Static type checker
20+
-**pre-commit hooks** - Automated code quality checks
21+
-**Makefile** - Convenient development commands
22+
-**Type hints** - Improved IDE support and type safety
23+
-**py.typed** marker - PEP 561 compliance
24+
-**Modern CI/CD** - GitHub Actions with uv
25+
-**MODERNIZATION_GUIDE.md** - Comprehensive migration guide
26+
-**BUSINESS_STANDARDS.md** - Enterprise compliance documentation
27+
-**PYTHON_COMPATIBILITY.md** - Version support documentation
28+
29+
### Changed
30+
- 🔄 **Python version support** - Now requires Python 3.8+ (dropped 2.7, 3.1-3.7)
31+
- 🔄 **Packaging** - Migrated from setup.py to pyproject.toml
32+
- 🔄 **Build backend** - Now uses hatchling
33+
- 🔄 **Logging** - Modernized with better defaults and configuration
34+
- 🔄 **Development workflow** - Simplified with uv and Makefile
35+
- 🔄 **CI/CD** - Updated to use modern GitHub Actions with uv
36+
- 🔄 **Documentation** - Enhanced README with modern installation instructions
37+
- 🔄 **Code quality** - Automated formatting and linting
38+
39+
### Deprecated
40+
- ⚠️ **Python 2.7** - No longer supported (use version 2.2.5 for Python 2.7)
41+
- ⚠️ **Python 3.1-3.7** - No longer supported
42+
- ⚠️ **setup.py** - Replaced by pyproject.toml (archived as setup_old.py)
43+
- ⚠️ **tox.ini** - Replaced by uv matrix testing
44+
- ⚠️ **requirements*.txt** - Dependencies now in pyproject.toml
45+
- ⚠️ **Pipfile** - Replaced by uv
46+
47+
### Removed
48+
- ❌ Support for Python versions < 3.8
49+
50+
### Fixed
51+
- 🐛 Improved error handling in logging setup
52+
- 🐛 Better type safety across the codebase
53+
54+
### Security
55+
- 🔒 Added CodeQL security scanning
56+
- 🔒 Dependency security auditing
57+
- 🔒 Pre-commit security checks
58+
59+
### Migration Notes
60+
- **For Users**: API is fully backward compatible. Just upgrade: `pip install --upgrade shconfparser`
61+
- **For Developers**: See [MODERNIZATION_GUIDE.md](MODERNIZATION_GUIDE.md) for complete migration instructions
62+
- **Python 2.7 Users**: Stay on version 2.2.5: `pip install shconfparser==2.2.5`
63+
64+
---
65+
66+
## [2.2.5] - 2021-07-XX
67+
68+
### Added
369
- Added #25 Feature: Adding GitHub actions
470
- Added #23 Create codeql-analysis.yml
5-
- Updated #22 Bump urllib3 from 1.26.4 to 1.26.5
6-
- Moved from travis to GitHub Actions
7-
- Moved from coversall to codecov.io
871
- Added pytest for 3.x and 2.7.x
9-
- Added GitHub action to upload package to PyPI
72+
- Added GitHub action to upload package to PyPI
73+
74+
### Changed
75+
- Moved from travis to GitHub Actions
76+
- Moved from coveralls to codecov.io
77+
78+
### Fixed
79+
- Updated #22 Bump urllib3 from 1.26.4 to 1.26.5

0 commit comments

Comments
 (0)