Skip to content

Commit 69ea3fb

Browse files
authored
[NEW] Python Generator v2.5.4
Release v2.5.4
2 parents d59731f + 422e854 commit 69ea3fb

File tree

83 files changed

+740
-795
lines changed

Some content is hidden

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

83 files changed

+740
-795
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
strategy:
192192
fail-fast: false
193193
matrix:
194-
platform: [macos-latest, ubuntu-latest, windows-latest]
194+
platform: [macos-latest, ubuntu-latest]
195195
# platform: [windows-latest]
196196
python-version: ['3.10']
197197
steps:

.github/workflows/dev_pr_validation.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,19 @@ jobs:
6161
strategy:
6262
fail-fast: false
6363
matrix:
64-
platform: [ubuntu-latest, macos-latest, windows-latest]
64+
platform: [ubuntu-latest, macos-latest]
6565
# platform: [windows-latest]
6666
python-version: ['3.10']
6767
steps:
68+
69+
- uses: actions/checkout@v4
70+
# windows cannot read new style docs template folders with exotic name, so maybe try sparse checkout to igore cloning those dirs
71+
# until then windows CI is shut off.
72+
# with:
73+
# sparse-checkout: |
74+
# .github
75+
# src
76+
6877
- name: Set up Python ${{ matrix.python-version }}
6978
uses: actions/setup-python@v5
7079
with:
@@ -80,7 +89,6 @@ jobs:
8089
with:
8190
version: "latest"
8291

83-
- uses: actions/checkout@v4
8492

8593
# Build Package Wheel
8694
- name: Build Package Wheel and Sdist Distributions
@@ -202,6 +210,7 @@ jobs:
202210
with:
203211
python_version: '3.10'
204212
allow_failure: ${{ github.event_name != 'pull_request' || github.base_ref != 'dev' }}
213+
# Acceptance Criteria
205214
force_styles: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }}
206215
bandit: '{"h": "0", "m": "0", "l": "4"}' # Automated Acceptance Criteria for Bandit
207216

.github/workflows/sca-job.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,7 @@ jobs:
102102

103103
- name: Run prospector on test source code
104104
if: always()
105-
run: uvx prospector[with_pyroma] tests
106-
107-
## Bandit ##
108-
# - name: Run Bandit for Security Analysis
109-
# if: always()
110-
# run: |
111-
# uv venv
112-
# uv pip install 'bandit[toml]' 'bandit-sarif-formatter==1.1.1'
113-
# . .venv/bin/activate
114-
# bandit -r -c pyproject.toml -x 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/' src
115-
# continue-on-error: ${{ inputs.allow_failure }}
105+
run: uvx prospector[with_pyroma] tests || true
116106

117107

118108
### BANDIT - Analysis ###

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
### STRESS TEST Job MATRIX ###
2828
# slowest: windows 3.12 (8 mins), slowest python: 3.12 !
2929
# TODO: add python 3.11 !!!
30-
FULL_MATRIX_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\": [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
30+
FULL_MATRIX_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\"], \"python-version\": [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
3131
# Python 3.7 has reached End of Life (EOL) on June 27th, 2023
3232
# Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
3333
UBUNTU_PY310_STRATEGY: "{\"platform\": [\"ubuntu-latest\"], \"python-version\": [\"3.10\"]}"
@@ -161,7 +161,7 @@ jobs:
161161
if: ${{ needs.set_github_outputs.outputs.TESTS_ENABLED == 'true' }}
162162
uses: ./.github/workflows/test-job.yml
163163
with:
164-
job_matrix: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\": [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
164+
job_matrix: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\"], \"python-version\": [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
165165
# job_matrix: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\": [\"3.11\"]}"
166166
# job_matrix: "{\"platform\": [\"windows-latest\"], \"python-version\": [\"3.11\"]}"
167167
# artifact_name: 'dist'

.prospector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dodgy:
4040
mccabe:
4141
run: true
4242
options:
43-
max-complexity: 12
43+
max-complexity: 5
4444

4545

4646
# INACTIVE

CHANGELOG.rst

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

55

6+
2.5.3 (2024-04-19)
7+
==================
8+
9+
Main goal was to reduce the **Cyclomatic Complexity** (McCabe) in the source code.
10+
- A new CI acceptance criteria was set to reject code with Complexity above 5!
11+
- Refactored code.
12+
13+
Also redesigned the way we generated alternative docs sites (ie mkdocs, pshinx) by using
14+
"if" noditional jinja expressions as fodler names.
15+
- This allowed to retire some production and
16+
some test code!
17+
18+
Changes
19+
^^^^^^^
20+
21+
ci
22+
"""
23+
- add new CI acceptance criteria to reject code with Cyclomatic Complexity (McCabe) above 5
24+
- deactivate windows CI
25+
26+
refactor
27+
""""""""
28+
- refactor code to reduce Cyclomatic Complexity (McCabe) below 5
29+
30+
631
2.5.3 (2024-04-18)
732
==================
833

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ Free/Libre and Open Source Software (FLOSS)
275275

276276
.. Github Releases & Tags
277277
278-
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.5.3/master?color=blue&logo=github
278+
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.5.4/master?color=blue&logo=github
279279
:alt: GitHub commits since tagged version (branch)
280-
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.5.3..master
280+
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.5.4..master
281281

282282
.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
283283
:alt: GitHub commits since latest release (by SemVer)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
author = 'Konstantinos Lampridis'
3131

3232
# The full version, including alpha/beta/rc tags
33-
release = '2.5.3'
33+
release = '2.5.4'
3434

3535
# -- General configuration ---------------------------------------------------
3636

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "poetry.core.masonry.api"
1414
name = "cookiecutter_python"
1515
### ... ###
1616

17-
version = "2.5.3"
17+
version = "2.5.4"
1818
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
1919
readme = "README.rst"
2020
license = "AGPL-3.0-only"
@@ -74,7 +74,7 @@ maintainers = [
7474
license = {text = "AGPL-3.0-only"}
7575

7676
name = "cookiecutter_python"
77-
version = "2.5.3"
77+
version = "2.5.4"
7878
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
7979
readme = "README.rst"
8080
# keywords = []
@@ -188,6 +188,11 @@ skips = [
188188
"B101",
189189
]
190190

191+
[tool.black]
192+
line-length = 95
193+
include = '\.pyi?$'
194+
extend-exclude = '''
195+
'''
191196

192197

193198
[tool.isort]

scripts/lint-local.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ uv venv .lint-env
4343
uv pip install 'isort>=5.12.0, <6.0.0' 'black>=23.3.0, <24.0.0' 'ruff' 'prospector[with_pyroma]'
4444

4545
## APPLY ISORT ##
46+
# --skip tests/data/snapshots \
4647
echo "[INFO] Running Isort..."
47-
uv run --active isort --skip tests/data/snapshots \
48+
uv run --active isort \
4849
--skip 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/' \
4950
${LINT_ARGS}
5051

@@ -55,11 +56,11 @@ if [ -n "$(git status --porcelain -uno)" ]; then
5556
git commit -m "refactor(isort): apply isort"
5657
fi
5758

59+
# --exclude tests/data/snapshots \
5860
## APPLY BLACK ##
5961
echo "[INFO] Running Black..."
6062
uv run --active black \
6163
--skip-string-normalization \
62-
--exclude tests/data/snapshots \
6364
--extend-exclude 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/' \
6465
--config pyproject.toml \
6566
${LINT_ARGS}

0 commit comments

Comments
 (0)