Skip to content

Commit 1e9556a

Browse files
committed
Merge enhancement into master
2 parents 6e8ba4e + 136793d commit 1e9556a

10 files changed

Lines changed: 574 additions & 139 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
tags: '*.*.*'
6+
release:
7+
types: [ published ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version:
15+
- '3.8'
16+
- '3.9'
17+
- '3.10'
18+
- '3.11'
19+
- '3.12'
20+
- '3.13'
21+
- '3.14'
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install -e . --extra-index-url https://source.md.land/python/
35+
python -m pip install pytest pytest-cov
36+
# pip install -e ".[test]"
37+
38+
- name: Run tests
39+
run: |
40+
# python -m pytest tests/ --cov=lib --cov-report=xml
41+
export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH"
42+
python -m pytest tests/unit/md/python/dict.py --cov=lib --cov-report=term
43+
python -m doctest ./lib/md/python/dict.py
44+
45+
# - name: Upload coverage to Codecov
46+
# uses: codecov/codecov-action@v3
47+
# if: matrix.python-version == '3.10'
48+
# with:
49+
# file: ./coverage.xml
50+
# fail_ci_if_error: true
51+
52+
security:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v3
56+
57+
- name: Set up Python
58+
uses: actions/setup-python@v4
59+
with:
60+
python-version: '3.10'
61+
62+
- name: Install safety
63+
run: pip install safety
64+
65+
- name: Check dependencies for vulnerabilities
66+
run: safety check --full-report
67+
68+
- name: Install bandit
69+
run: pip install bandit
70+
71+
- name: Static security analysis
72+
run: bandit -r lib/ -f json -o bandit-report.json --skip B101
73+
74+
type-check:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v3
78+
79+
- name: Set up Python
80+
uses: actions/setup-python@v4
81+
with:
82+
python-version: '3.10'
83+
84+
- name: Install mypy
85+
run: pip install mypy
86+
87+
- name: Type checking
88+
run: |
89+
export PYTHONPATH="$(pwd -P)/lib:$PYTHONPATH"
90+
mypy lib/ --disable-error-code import-untyped
91+
92+
build:
93+
needs: [test, security, type-check]
94+
runs-on: ubuntu-latest
95+
96+
steps:
97+
- uses: actions/checkout@v3
98+
99+
- name: Set up Python
100+
uses: actions/setup-python@v4
101+
with:
102+
python-version: '3.10'
103+
104+
- name: Install build dependencies
105+
run: pip install build wheel
106+
107+
- name: Build wheel package
108+
run: python -m build --wheel
109+
110+
- name: List artifacts
111+
run: ls -la dist/
112+
113+
- name: Upload wheel to GitHub Releases
114+
uses: svenstaro/upload-release-action@v2
115+
with:
116+
repo_token: ${{ secrets.GITHUB_TOKEN }}
117+
file: dist/*.whl
118+
tag: ${{ github.ref }}
119+
overwrite: true
120+
file_glob: true

changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] — 2025-01-01
9+
### Added
10+
11+
- [x] feature: add CI/CD github workflow configuration
12+
13+
### Changed
14+
15+
- [x] fix: module marker exception usage
16+
- [x] enhancement: switch `merge` method from recursion to cycle
17+
- [x] enhancement: switch `flat` method from recursion to cycle
18+
- [x] refactoring: move `CaseInsensitiveDict` tests to other unit tests file
19+
- [x] enhancement: generalize & clarify typing for `CaseInsensitiveDict` classes
20+
- [x] documentation: add `CaseInsensitiveDict` classes documentation
21+
- [x] fix: typing issues in `inline_index` function
22+
- [x] documentation: fix typo, change markup for admonition
23+
824
## [1.0.0] - 2023-01-27
925

1026
- Initial implementation
1127

28+
[1.1.0]: https://github.com/md-py/md.python.dict/releases/compare/1.0.0...1.1.0
1229
[1.0.0]: https://github.com/md-py/md.python.dict/releases/tag/1.0.0
14.1 KB
Loading

docs/_static/architecture-overview.class-diagram.puml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ package builtins {
1414
class builtins.dict {}
1515
}
1616

17+
package md.python {
18+
interface md.python.PythonExceptionInterface {}
19+
}
20+
1721
package md.python.dict {
18-
interface DictExceptionInterface {}
22+
interface DictExceptionInterface extends md.python.PythonExceptionInterface {}
1923
interface MergeDictionaryInterface {
2024
+ merge(left: dict, right: dict) -> dict
2125
}
@@ -24,9 +28,14 @@ package md.python.dict {
2428
}
2529

2630
class CaseInsensitiveDictKey extends builtins.str {}
27-
class CaseInsensitiveDict extends builtins.dict {}
31+
class CaseInsensitiveDict <V of Any> extends builtins.dict {
32+
+ __init__(dict_: Optional[Dict[Hashable, V]] = None, **kwargs: V) -> None
33+
+ __setitem__(key: Any, value: V) -> None
34+
+ __getitem__(key: Any) -> V
35+
+ __delitem__(key: Any) -> None
36+
}
2837

29-
CaseInsensitiveDict *--> CaseInsensitiveDictKey
38+
CaseInsensitiveDict *-right-> CaseInsensitiveDictKey
3039
}
3140

3241
@enduml

0 commit comments

Comments
 (0)