Skip to content

Commit a184432

Browse files
committed
[NEW] Software Patterns v2.1.0
Merge branch 'release'
2 parents 14e0e0c + cdc4471 commit a184432

27 files changed

Lines changed: 2790 additions & 1087 deletions

.github/labeler.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Pull Request Labeling Rules based on changed files
2+
# https://github.com/actions/labeler
3+
4+
5+
####### LABELS based on FILE CHANGES #######
6+
7+
# Here, we declare Rules for Labeling PR based on the file changes
8+
9+
# Each Label is added, when their Rule(s) are True
10+
# - 'any' block is True, if any of the conditions are True
11+
# - 'all' block is True, if all of the conditions are True
12+
13+
# Typically a Label, only features one of 'any' or 'all' block
14+
15+
# Each label declares Rules that are mutually exclusive, in boolean logic.
16+
# Thus, the set of matching file paths are non-overlapping, across the labels.
17+
18+
19+
### SRC ###
20+
# Add 'business_logic' label to any change within the 'src/software_patterns' dir
21+
business_logic:
22+
- any:
23+
- changed-files:
24+
- any-glob-to-any-file:
25+
- 'src/software_patterns/*'
26+
- 'src/software_patterns/*'
27+
28+
stubs:
29+
- any:
30+
- changed-files:
31+
- any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*']
32+
33+
### TESTS ###
34+
## Add 'test' label to any change within the 'tests' dir #
35+
test:
36+
- any:
37+
- changed-files:
38+
- any-glob-to-any-file:
39+
- 'tests/*'
40+
- 'tests/**/*'
41+
42+
# exclude any changes within the 'tests/data/' dir
43+
- all:
44+
- changed-files:
45+
- all-globs-to-all-files:
46+
- '!tests/data/*'
47+
- '!tests/data/**/*'
48+
49+
test_data:
50+
- any:
51+
- changed-files:
52+
- any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*']
53+
54+
### DOCS ###
55+
# Any change within the 'docs' dir, or the '.readthedocs.yml' file
56+
docs:
57+
- any:
58+
- changed-files:
59+
- any-glob-to-any-file:
60+
- 'docs/*'
61+
- 'docs/**/*'
62+
- 'mkdocs.yml'
63+
- '.readthedocs.yml'
64+
- 'README.rst'
65+
- 'README.md'
66+
67+
### SCRIPTS ###
68+
scripts:
69+
- any:
70+
- changed-files:
71+
- any-glob-to-any-file:
72+
- 'scripts/**'
73+
74+
### CI ###
75+
# Add 'ci' label to any change within the '.github' dir
76+
ci:
77+
- any:
78+
- changed-files:
79+
- any-glob-to-any-file: ['.github/*', '.github/**/*']
80+
81+
### DOCKER ###
82+
docker:
83+
- any:
84+
- changed-files:
85+
- any-glob-to-any-file:
86+
- 'Dockerfile'
87+
- 'docker-compose.yml'
88+
- 'docker-compose.*.yml'
89+
- '.dockerignore'
90+
91+
### BUILD ###
92+
build:
93+
- any:
94+
- changed-files:
95+
- any-glob-to-any-file:
96+
- 'uv.lock'
97+
# - 'pyproject.toml'
98+
99+
### TOX ###
100+
tox:
101+
- any:
102+
- changed-files:
103+
- any-glob-to-any-file:
104+
- 'tox.ini'
105+
106+
config:
107+
- any:
108+
- changed-files:
109+
- any-glob-to-any-file:
110+
- '.bettercodehub.yml'
111+
- '.coveragerc'
112+
- '.gitignore'
113+
- '.prospector.yml'
114+
- '.pylintrc'
115+
116+
117+
####### LABELS based on BRANCH NAME #######
118+
119+
## Pull Request Labeling Rules based Base Branch
120+
121+
# Add 'release' label to any PR that is opened against the `main` branch
122+
release:
123+
- base-branch: 'main'
124+
125+
# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch
126+
# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR
127+
boarding_auto:
128+
- base-branch: ['^boarding-auto', 'boarding-auto']
129+
- base-branch: ['^board-n-release', 'board-n-release']
130+
131+
132+
# Add 'feature' label to any PR where the head branch name starts with
133+
# `feature` or has a `feature` section in the name
134+
feature:
135+
- head-branch: ['^feature', 'feature']

.github/workflows/cicd.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,22 @@ jobs:
1717
# RUN TEST SUITE ON ALL PLATFORMS
1818
test_n_build:
1919
if: ${{ vars.TEST_JOB_ON != 'false' && !contains(github.event.head_commit.message, '_CI_SKIP_') }}
20-
uses: boromir674/automated-workflows/.github/workflows/test_build.yml@develop
20+
uses: boromir674/automated-workflows/.github/workflows/python-build.yml@develop
2121
with:
22-
# Spawn Job per combination of factors in JOB_MATRIX
23-
# Python 3.7 has reached End of Life (EOL) on June 27th, 2023
24-
# Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
25-
job_matrix: '{"platform": ["ubuntu-latest"], "python-version": ["3.10", "3.11", "3.12"]}'
26-
build_installation: 'wheel' # Verify sdist and wheel installations/"builds" against Tests
27-
# typecheck_policy: '1' # {0: Skip, 1: Run, 2: Run and allow failures}
28-
# run_policy: '0' # Force skip of downstream 'test_build' Test Job
29-
# artifact_name: 'BUILD_ARTIFACT'
22+
job_matrix: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\"], \"python-version\": [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
23+
distribute_tests: false # avoid perf decrease due to test distribution overhead
24+
# tests are too fast so cpu distribution overhead increases total test execution time
25+
26+
# uses: boromir674/automated-workflows/.github/workflows/test_build.yml@develop
27+
# with:
28+
# # Spawn Job per combination of factors in JOB_MATRIX
29+
# # Python 3.7 has reached End of Life (EOL) on June 27th, 2023
30+
# # Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
31+
# job_matrix: '{"platform": ["ubuntu-latest"], "python-version": ["3.10", "3.11", "3.12"]}'
32+
# build_installation: 'wheel' # Verify sdist and wheel installations/"builds" against Tests
33+
# # typecheck_policy: '1' # {0: Skip, 1: Run, 2: Run and allow failures}
34+
# # run_policy: '0' # Force skip of downstream 'test_build' Test Job
35+
# # artifact_name: 'BUILD_ARTIFACT'
3036

3137
codecov_coverage_host:
3238
needs: test_n_build
@@ -52,11 +58,19 @@ jobs:
5258
### DOCS BUILD/TEST - DOCUMENTATION SITE ###
5359
docs:
5460
name: Build Documentation
55-
uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.15.0
61+
uses: boromir674/automated-workflows/.github/workflows/docs-job.yml@develop
5662
with:
57-
run_policy: '2'
63+
build_tool: 'sphinx'
64+
default_trigger: true
65+
override: '${{ vars.OV_DOCS }}'
5866
python_version: '3.11'
59-
command: 'REQS_FILE=reqs-docs.txt tox -e pin-deps -- -E docs && tox -e docs -vv -s false'
67+
upload_distro: true
68+
69+
# uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.15.0
70+
# with:
71+
# run_policy: '2'
72+
# python_version: '3.11'
73+
# command: 'REQS_FILE=reqs-docs.txt tox -e pin-deps -- -E docs && tox -e docs -vv -s false'
6074

6175
### DRAW PYTHON DEPENDENCY GRAPHS ###
6276
code_visualization:
@@ -77,7 +91,7 @@ jobs:
7791
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
7892
uses: ./.github/workflows/signal-deploy.yml
7993
with:
80-
main_branch: main
94+
main_branch: master
8195
release_branch: release
8296

8397
## JOB: PYPI UPLOAD ##

.github/workflows/codecov-upload.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
- name: Checkout Repository
2222
uses: actions/checkout@v4
2323

24-
# Download the coverage artifact
25-
- name: Download Coverage Artifact
26-
uses: actions/download-artifact@v4
27-
with:
28-
name: ${{ inputs.coverage_artifact }}
29-
3024
# Get the Codecov binary
3125
- name: Get Codecov Binary
3226
run: |

.github/workflows/labeler.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Pull Request Labeler"
2+
3+
on: pull_request_target
4+
5+
jobs:
6+
label_PR:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
# This Job behaves as a Listener to PR events, and each step is a Handler
12+
steps:
13+
# HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml'
14+
- uses: actions/labeler@v5
15+
with:
16+
# if you want your labels to trigger other Workflows, pass-in a PAT
17+
# with permission for label creation events to trigger listeners
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,16 @@ reqs-docs.txt
3737
dist-dir/
3838
wheel-dir/
3939
*\.whl
40+
TODO.md
41+
requirements-poetry.txt
42+
poetry-checksums.txt
43+
poetry-artifacts.txt
44+
45+
extras_requirements/
46+
*.tar.gz.txt
47+
requirements-uv*
48+
uv-artifacts.txt
49+
uv-checksums.txt
50+
d.txt
51+
requirements.txt
52+
p+t.txt

CHANGELOG.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,41 @@ Changelog
33
=========
44

55

6+
2.1.0 (2025-11-17)
7+
==================
8+
9+
Support `async` listeners in the Notification Pattern.
10+
11+
Changes
12+
^^^^^^^
13+
14+
feature
15+
"""""""
16+
- async listener support in 'notification'
17+
- check listener at runtime if is compatible
18+
19+
fix
20+
"""
21+
- satisfy propespector
22+
- verify a listener's failure does not hinder other listeners, with async
23+
- add an event emulation scenario
24+
- more comprehensive consumer code use cases
25+
- add e2e notification listener tests
26+
27+
chore
28+
""""""
29+
- update gitignore
30+
31+
ci
32+
"""
33+
- migrate ci to uv-based workflows
34+
35+
build
36+
"""""
37+
- migrate all dependencies and extras to uv
38+
39+
40+
641
2.0.1 (2025-11-15)
742
==================
843

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ Example code to use the `factory` pattern in the form of a `(sub) class registry
133133
:alt: PyPI - Python Version
134134
:target: https://pypi.org/project/software-patterns
135135

136-
.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/software-patterns/v2.0.1/master?color=blue&logo=Github
136+
.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/software-patterns/v2.1.0/master?color=blue&logo=Github
137137
:alt: GitHub commits since tagged version (branch)
138-
:target: https://github.com/boromir674/software-patterns/compare/v2.0.1..master
138+
:target: https://github.com/boromir674/software-patterns/compare/v2.1.0..master
139139

140140

141141
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/boromir674/software-patterns/master?logo=scrutinizer-ci

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Konstantinos Lampridis'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '2.0.1'
25+
release = '2.1.0'
2626

2727
# -- General configuration ---------------------------------------------------
2828

0 commit comments

Comments
 (0)