Skip to content

Commit 5786e8c

Browse files
authored
[NEW] Better Mkdocs Infra
Release Version '1.14.0' into 'master' Branch
2 parents cc0ac90 + f95ba65 commit 5786e8c

Some content is hidden

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

51 files changed

+1368
-941
lines changed

.github/biskotaki.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ default_context:
1111
email: k.lampridis@hotmail.com
1212
author_email: k.lampridis@hotmail.com
1313
github_username: boromir674
14-
project_short_description: Project generated from the https://github.com/boromir674/cookiecutter-python-package/tree/master/src/cookiecutter_python cookiecutter
14+
project_short_description: Project generated using https://github.com/boromir674/cookiecutter-python-package
1515
initialize_git_repo: no
16-
interpreters: {"supported-interpreters": ["3.6", "3.7", "3.8", "3.9", "3.10"]}
16+
interpreters: {"supported-interpreters": ["3.7", "3.8", "3.9", "3.10", "3.11"]}
1717
## Documentation Config ##
1818
docs_builder: "sphinx"
1919
## READ THE DOCS CI Config ##

.github/workflows/generate.yaml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches:
99
- 'master'
1010

11+
env:
12+
PY_VERSION: '3.11'
1113

1214
jobs:
1315
generate:
@@ -17,10 +19,10 @@ jobs:
1719
SUPER_SECRET: ${{ secrets.BISKOTAKI_GH_TOKEN }}
1820
steps:
1921
- uses: actions/checkout@v4
20-
- name: Set up Python 3.10
22+
- name: Set up Python ${{ env.PY_VERSION }}
2123
uses: actions/setup-python@v5
2224
with:
23-
python-version: "3.10"
25+
python-version: "${{ env.PY_VERSION }}"
2426
- name: Install dependencies
2527
run: |
2628
python -m pip install --upgrade pip
@@ -50,7 +52,7 @@ jobs:
5052
run: |
5153
pip install --user -e .
5254
echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml
53-
generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f
55+
generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline
5456
5557
## VALIDATE BISKOTAKI CI CONFIG file is in valid Yaml format ##
5658
- name: "Validate YAML format"
@@ -63,30 +65,44 @@ jobs:
6365
6466
## Run Test Suite against the generated project ##
6567
- name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation
68+
env:
69+
TOXPYTHON: "python${{ env.PY_VERSION }}"
6670
run: |
6771
cd gen/biskotaki
68-
tox -e "py310{-sdist, -wheel, -dev}"
72+
tox -e 'edit,sdist,wheel'
73+
tox -e wheel-test
6974
tox -e coverage
75+
76+
## Verify all Tox Envs PASS, as intented, out of the box ##
77+
78+
# Running Type Check, on src and Test code: Passes
79+
- name: 'Mypy: Static Type Checker -> PASS'
80+
run: |
81+
cd gen/biskotaki
82+
tox -e pin-deps -- -E typing
83+
tox -e type
7084
71-
## Verify Development Scripts operate as intented out of the box
7285
- name: 'Ruff: Fast Python Linter -> PASS'
7386
run: |
7487
cd gen/biskotaki
7588
tox -e ruff
76-
7789
# Running Lint Check, on src and Test code: Passes
78-
# Running Type Check, on src and Test code: Passes
79-
# Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files
80-
# Running Quality Checks against Distro Metadata: Passes with 10/10 score
81-
82-
- name: Run Isort, Black, Mypy, Build, Pyroma and PyDeps commands
90+
- name: 'Isort, Black: Code Formatter -> PASS'
8391
run: |
8492
cd gen/biskotaki
8593
tox -e lint
86-
tox -e type
94+
# Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files
95+
- name: 'Build: sdist, wheel -> PASS'
96+
run: |
97+
cd gen/biskotaki
8798
tox -e build
99+
# Running Quality Checks against Distro Metadata: Passes with 10/10 score
100+
- name: 'Pyroma: Distro Quality -> PASS'
101+
run: |
102+
cd gen/biskotaki
88103
tox -e check
89-
# tox -e graphs
104+
105+
# tox -e graphs
90106

91107
## PUSH to BISKOTAKI REPO ##
92108
- name: Push to dedicated branch in biskotaki repo

CHANGELOG.rst

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

5+
1.14.0 (2024-02-18)
6+
===================
7+
8+
Changes
9+
^^^^^^^
10+
11+
feature
12+
"""""""
13+
- revamp Mkdocs build Process, and enhance Template Content of Docs Pages
14+
15+
fix
16+
"""
17+
- provide correct env name for Code Visualization CI Job to reference
18+
- fix biskotaki generation with sphinx docs
19+
20+
test
21+
""""
22+
- update tests to match new expectations, given biskotaki.yml updates
23+
- update Gold Standard Biskotatki Snapshot
24+
25+
ci
26+
""
27+
- update Generate Workflow, according to changed tox
28+
29+
chore
30+
"""""
31+
- remove python 3.6 and add python 3.11 from Biskotaki Ref Project
32+
33+
534
1.13.0 (2024-02-15)
635
===================
736

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/v1.13.0/master?color=blue&logo=github
278+
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v1.14.0/master?color=blue&logo=github
279279
:alt: GitHub commits since tagged version (branch)
280-
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.13.0..master
280+
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.14.0..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 = '1.13.0'
33+
release = '1.14.0'
3434

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api"
1010
## Also renders on pypi as 'subtitle'
1111
[tool.poetry]
1212
name = "cookiecutter_python"
13-
version = "1.13.0"
13+
version = "1.14.0"
1414
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
1515
authors = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
1616
maintainers = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '1.13.0'
1+
__version__ = '1.14.0'
22

33
from . import _logging # noqa

src/cookiecutter_python/{{ cookiecutter.project_slug }}/.github/workflows/test.yaml

Lines changed: 67 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -132,62 +132,81 @@ jobs:
132132
if: ${{ "{{" }} needs.set_github_outputs.outputs.TESTS_ENABLED == 'true' {{ "}}" }}
133133
strategy:
134134
matrix: ${{ "{{" }}fromJSON(needs.set_github_outputs.outputs.matrix){{ "}}" }}
135+
env:
136+
WHEELS_PIP_DIR: "wheels-pip"
135137
steps:
136138
- run: echo "Platform -> ${{ "{{" }} matrix.platform {{ "}}" }} , Python -> ${{ "{{" }} matrix.python-version {{ "}}" }}"
137-
- uses: actions/checkout@v3
138139
- name: Set up Python ${{ "{{" }} matrix.python-version {{ "}}" }}
139-
uses: actions/setup-python@v4
140+
uses: actions/setup-python@v5
140141
with:
141142
python-version: ${{ "{{" }} matrix.python-version {{ "}}" }}
142143
- run: python -m pip install --upgrade pip && python -m pip install tox==3.28 tox-gh-actions
143144

145+
- uses: actions/checkout@v4
146+
147+
- name: Pin 'Static Type Checking' Dependencies
148+
run: tox -vv -s false -e pin-deps -- -E typing
149+
144150
- name: Do Type Checking
145151
run: tox -e type -vv -s false
146152

147-
# Steps 'Run Unit Tests' and 'Check for compliance with Python Best Practices'
148-
# require the PKG_VERSION environment variable at runtime
149-
150-
# We want to read the Version value from a file, that is part of the
151-
# Python Distro (.tar.gz, or wheel)
152-
- name: 'Define executable Parser, to read from same Source of Truth that Generator CLI utilizes, at runtime'
153-
run: echo PARSER="./scripts/parse_version.py" >> $GITHUB_ENV
154-
155-
# Note: one Sem Ver is maintained in src/**/__init__.py file
156-
# and the other in the pyproject.toml file
157-
- name: 'Parse Sem Ver, same as `generate-python --version` value returned, at runtime'
158-
run: echo VERSION_FROM_DISTRO_SOURCE_PY_FILE="$(${{ "{{" }} env.PARSER {{ "}}" }})" >> $GITHUB_ENV
159-
160-
# PEP 440 requires that the version string be normalized to a canonical form.
161-
# below should be enough to handle cases: '1.7.4', '1.7.4-rc', and '1.7.4-rc.1'
162-
- name: 'Transform Version (ie 1.7.4-rc.1 -> 1.7.4rc1), to match the name of the wheel produced'
163-
run: echo WHEEL_VERSION="$(echo $VERSION_FROM_DISTRO_SOURCE_PY_FILE | sed -E 's/([^.]*)\.([^.]*)\.([^-]*)-(rc)\.?(.*)/\1.\2.\3\4\5/')" >> $GITHUB_ENV
164-
165-
- name: "If Sem Ver ends with '-rc', append trailing 0 (ie *rc0)"
166-
id: extract_sem_ver_last_two_chars
167-
run: 'echo last_two="${${{ "{{" }} env.WHEEL_VERSION {{ "}}" }}: -2}" >> $GITHUB_OUTPUT'
168-
169-
- name: "Sem Ver ends with 'rc' = ${{ "{{" }} steps.extract_sem_ver_last_two_chars.outputs.last_two == 'rc' {{ "}}" }}"
170-
if: ${{ "{{" }} steps.extract_sem_ver_last_two_chars.outputs.last_two == 'rc' {{ "}}" }}
171-
run: echo WHEEL_VERSION="${WHEEL_VERSION}0" >> $GITHUB_ENV
172-
173-
- name: 'Set Expected PEP 440 Version: ${{ "{{" }} env.WHEEL_VERSION {{ "}}" }}'
174-
id: set_expected_pep_440_version
175-
run: echo "EXPECTED_PEP_440_VERSION=${{ "{{" }} env.WHEEL_VERSION {{ "}}" }}" >> $GITHUB_OUTPUT
176-
177-
##### TEST SUITE / UNIT TESTS #####
178-
# Before Test Suite, must derive expected PEP 440 Sem Ver
179-
- name: Run Unit Tests
180-
run: tox -vv -s false
153+
###### TEST SUITE RUN against Edit and Sdist ######
154+
- name: Build and Test 'Edit' and 'Sdist' & Build Wheel(s)
155+
run: |
156+
set -o pipefail
157+
tox -vv -s false | tee test_output.log
181158
env:
182159
PLATFORM: ${{ "{{" }} matrix.platform {{ "}}" }}
183-
PKG_VERSION: ${{ "{{" }} steps.set_expected_pep_440_version.outputs.EXPECTED_PEP_440_VERSION {{ "}}" }}
160+
BUILD_DEST: ${{ "{{" }} env.WHEELS_PIP_DIR {{ "}}" }}
161+
162+
- name: List Wheel(s) created for Distro and its Requirements
163+
run: ls -l ${{ "{{" }} env.WHEELS_PIP_DIR {{ "}}" }}
164+
165+
### PARSE WHEEL File NAME ###
166+
- name: Extract Wheel Name and Size
167+
id: extract_wheel_info
168+
shell: bash
169+
run: |
170+
WHEEL_INFO=$(grep -E "Created wheel for" test_output.log | sed -E "s/.*filename=([^ ]+) size=([^ ]+) .*/\1 \2/")
171+
172+
# extract file name
173+
WHEEL_NAME=$(echo $WHEEL_INFO | cut -d ' ' -f 1)
174+
echo "WHEEL_NAME=$WHEEL_NAME" >> $GITHUB_ENV
175+
176+
# extract file size
177+
WHEEL_SIZE=$(echo $WHEEL_INFO | cut -d ' ' -f 2)
178+
echo "WHEEL_SIZE=$WHEEL_SIZE" >> $GITHUB_ENV
184179
180+
# extract '1.12.5.dev0' from '{{ cookiecutter.pkg_name }}-1.12.5.dev0-py3-none-any.whl'
181+
PEP_VERSION=$(echo $WHEEL_NAME | sed -E "s/{{ cookiecutter.pkg_name }}-([^ ]+)-py3-none-any.whl/\1/")
182+
183+
echo "PEP_VERSION=${PEP_VERSION}" >> $GITHUB_OUTPUT
184+
185+
- run: 'echo "WHEEL_NAME: $WHEEL_NAME SIZE: $WHEEL_SIZE"'
186+
- run: 'echo "PEP_VERSION: $PEP_VERSION"'
187+
188+
# Crash Workflow if PEP_VERSION is not set
189+
- if: ${{ "{{" }} steps.extract_wheel_info.outputs.PEP_VERSION == '' {{ "}}" }}
190+
run: exit 1
191+
192+
###### TEST SUITE RUN against Wheel ######
193+
- name: Run Test Suite Against Wheel
194+
run: tox -e wheel-test -s false
195+
env:
196+
PLATFORM: ${{ "{{" }} matrix.platform {{ "}}" }}
197+
BUILD_DEST: ${{ "{{" }} env.WHEELS_PIP_DIR {{ "}}" }}
198+
WHEEL: ${{ "{{" }} env.WHEEL_NAME {{ "}}" }}
199+
200+
## Combine Coverage Data from Tests' Results ##
185201
- name: "Combine Coverage (dev, sdist, wheel) & make Reports"
186202
run: tox -e coverage --sitepackages -vv -s false
187203

188204
- name: Rename Coverage Files
189-
run: mv ./.tox/coverage.xml ./coverage-${{ "{{" }} matrix.platform {{ "}}" }}-${{ "{{" }} matrix.python-version {{ "}}" }}.xml
205+
shell: bash
206+
run: |
207+
mv ./.tox/coverage.xml ./coverage-${{ "{{" }} matrix.platform {{ "}}" }}-${{ "{{" }} matrix.python-version {{ "}}" }}.xml
190208
209+
## UPLOAD CI ARTIFACTS - Coverage Reports ##
191210
- name: "Upload Test Coverage as Artifacts"
192211
uses: actions/upload-artifact@v3
193212
with:
@@ -196,25 +215,27 @@ jobs:
196215
if-no-files-found: error
197216

198217
- name: Check for compliance with Python Best Practices
218+
shell: bash
199219
env:
200-
PKG_VERSION: ${{ "{{" }} steps.set_expected_pep_440_version.outputs.EXPECTED_PEP_440_VERSION {{ "}}" }}
220+
PKG_VERSION: ${{ "{{" }} steps.extract_wheel_info.outputs.PEP_VERSION {{ "}}" }}
221+
WHEEL_PATH: ${{ "{{" }} env.WHEELS_PIP_DIR {{ "}}" }}/${{ "{{" }} env.WHEEL_NAME {{ "}}" }}
201222
run: |
202223
DIST_DIR=dist
203-
echo "DIST_DIR=dist" >> $GITHUB_ENV
224+
echo "DIST_DIR=${DIST_DIR}" >> $GITHUB_ENV
204225
mkdir ${DIST_DIR}
205226
mv ".tox/${DIST_DIR}/{{ cookiecutter.pkg_name }}-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
206-
mv ".tox/${DIST_DIR}/{{ cookiecutter.pkg_name }}-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
227+
mv "${{ "{{" }} env.WHEEL_PATH {{ "}}" }}" "${DIST_DIR}"
207228
tox -e check -vv -s false
208229
230+
## UPLOAD CI ARTIFACTS - Distro Build(s), 1 sdist and 1 or more wheels ##
209231
- name: Upload Source & Wheel distributions as Artefacts
210232
uses: actions/upload-artifact@v3
211233
with:
212234
name: dist-${{ "{{" }} matrix.platform {{ "}}" }}-${{ "{{" }} matrix.python-version {{ "}}" }}
213235
path: ${{ "{{" }} env.DIST_DIR {{ "}}" }}
214236
if-no-files-found: error
215237
outputs:
216-
EXPECTED_PEP_440_VERSION: ${{ "{{" }} steps.set_expected_pep_440_version.outputs.EXPECTED_PEP_440_VERSION {{ "}}" }}
217-
238+
PEP_VERSION: ${{ "{{" }} steps.extract_wheel_info.outputs.PEP_VERSION {{ "}}" }}
218239

219240
codecov_coverage_host:
220241
runs-on: ubuntu-latest
@@ -302,7 +323,7 @@ jobs:
302323
name: ${{ "{{" }} needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME {{ "}}" }}
303324
env:
304325
DIST_DIR: dist
305-
PACKAGE_DIST_VERSION: ${{ "{{" }} needs.test_suite.outputs.EXPECTED_PEP_440_VERSION {{ "}}" }}
326+
PACKAGE_DIST_VERSION: ${{ "{{" }} needs.test_suite.outputs.PEP_VERSION {{ "}}" }}
306327
TWINE_USERNAME: ${{ "{{" }} secrets.TWINE_USERNAME {{ "}}" }}
307328
TWINE_PASSWORD: ${{ "{{" }} secrets.TWINE_PASSWORD {{ "}}" }}
308329
PYPI_SERVER: ${{ "{{" }} vars.PYPI_SERVER {{ "}}" }}
@@ -369,10 +390,11 @@ jobs:
369390
docs:
370391
name: Build Documentation
371392
needs: set_github_outputs
372-
uses: ./.github/workflows/policy_docs.yml
393+
uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.3.0
373394
with:
374395
run_policy: ${{ "{{" }} needs.set_github_outputs.outputs.PIPE_DOCS_POLICY {{ "}}" }}
375396
python_version: ${{ "{{" }} needs.set_github_outputs.outputs.PIPE_DOCS_PY {{ "}}" }}
397+
command: 'tox -s false -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false'
376398

377399
### DRAW PYTHON DEPENDENCY GRAPHS ###
378400
code_visualization:

src/cookiecutter_python/{{ cookiecutter.project_slug }}/.readthedocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ build:
1919
- python -m poetry export -o req-docs.txt -E docs
2020
post_install:
2121
- python -m pip install -e .
22+
- python -m pip install pyyaml
2223
pre_build:
2324
- python ./scripts/visualize-ga-workflow.py > ./docs/cicd_mermaid.md
2425
- python ./scripts/visualize-dockerfile.py > ./docs/dockerfile_mermaid.md

src/cookiecutter_python/{{ cookiecutter.project_slug }}/docs-mkdocs/cli.md

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

0 commit comments

Comments
 (0)