Skip to content

Commit f531289

Browse files
authored
[NEW] Cookiecutter Python Package v0.10.0
The 'Cookiecutter Python Package v0.10.0 Release' added 'codecov' integration and extra CI 'checks'.
2 parents 25f2758 + 1116ec6 commit f531289

File tree

13 files changed

+278
-42
lines changed

13 files changed

+278
-42
lines changed

.github/biskotaki.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
default_context:
2+
project_name: Biskotaki
3+
project_slug: biskotaki
4+
repo_name: biskotaki
5+
pkg_name: biskotaki
6+
full_name: Konstantinos Lampridis
7+
author: Konstantinos Lampridis
8+
email: k.lampridis@hotmail.com
9+
author_email: k.lampridis@hotmail.com
10+
github_username: boromir674
11+
project_short_description: Project generated from the https://github.com/boromir674/cookiecutter-python-package/tree/master/src/cookiecutter_python cookiecutter
12+
initialize_git_repo: "no"

.github/workflows/generate.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Generate from Template and Commit to Biskotaki
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
pull_request:
8+
branches:
9+
- 'master'
10+
11+
12+
jobs:
13+
generate:
14+
runs-on: ubuntu-latest
15+
env:
16+
branch: apply-cookiecutter-python-package-template
17+
SUPER_SECRET: ${{ secrets.BISKOTAKI_GH_TOKEN }}
18+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
- shell: bash
22+
run: |
23+
if ! [[ "$SUPER_SECRET" ]]
24+
then
25+
echo "No BISKOTAKI_GH_TOKEN!"
26+
echo "Shall NOT authorize access to the biskotaki repo!"
27+
echo "Exiting .."
28+
exit 1
29+
else
30+
echo "BISKOTAKI_GH_TOKEN found :)"
31+
fi
32+
33+
- run: |
34+
if ! [[ ${{ secrets.GITHUB_TOKEN }} ]]
35+
then
36+
echo "No GITHUB_TOKEN!"
37+
echo "Shall NOT authorize access to this repo!"
38+
exit 1
39+
else
40+
echo "GITHUB_TOKEN found :)"
41+
fi
42+
43+
if ! [[ "${{ secrets.BISKOTAKI_GH_TOKEN }}" ]]
44+
then
45+
echo "No BISKOTAKI_GH_TOKEN!"
46+
echo "Shall NOT authorize access to the biskotaki repo!"
47+
echo "Exiting .."
48+
exit 1
49+
else
50+
echo "BISKOTAKI_GH_TOKEN found :)"
51+
fi
52+
53+
echo "GG=V1" >> $GITHUB_ENV
54+
55+
- run: |
56+
if ! [[ ${{ env.GG }} ]]
57+
then
58+
echo "Failed to read GG var, exported in previous step!"
59+
echo "Exiting .."
60+
exit 1
61+
else
62+
echo "Able to read the GG var exported from the previous step :)"
63+
fi
64+
65+
- name: Set up Python 3.8
66+
uses: actions/setup-python@v2
67+
with:
68+
python-version: "3.8"
69+
- name: Install dependencies
70+
run: |
71+
sudo apt update -y && sudo apt install -y aptitude
72+
sudo aptitude install -y graphviz
73+
python -m pip install --upgrade pip
74+
python -m pip install cookiecutter tox
75+
76+
- name: Clone Biskotaki repo
77+
uses: actions/checkout@v3
78+
with:
79+
repository: boromir674/biskotaki
80+
path: 'cloned/biskotaki'
81+
82+
- name: Find Biskotaki version
83+
run: |
84+
cd cloned/biskotaki
85+
chmod +x ./scripts/parse_version.py
86+
echo "BISKOTAKI_VERSION=$(scripts/parse_version.py)" >> $GITHUB_ENV
87+
88+
- name: Generate Biskotaki from Template
89+
run: |
90+
echo " version: \"${{ env.BISKOTAKI_VERSION }}\"" >> .github/biskotaki.yaml
91+
cookiecutter ./src/cookiecutter_python -o gen --config-file ./.github/biskotaki.yaml --no-input
92+
93+
# - name: Test against multiple 'installation' scenarios
94+
# run: |
95+
# cd gen/biskotaki
96+
# tox -e "py38{, -path, -sdist, -wheel, -dev}"
97+
# env:
98+
# PKG_VERSION: ${{ env.BISKOTAKI_VERSION }}
99+
# - name: Test Operations such as 'build process' and 'linting'
100+
# run: |
101+
# cd gen/biskotaki
102+
# tox -e check
103+
# tox -e build
104+
# tox -e lint
105+
# tox -e graphs
106+
107+
- name: Push to dedicated branch in biskotaki repo
108+
uses: cpina/github-action-push-to-another-repository@main
109+
env:
110+
API_TOKEN_GITHUB: ${{ secrets.BISKOTAKI_GH_TOKEN }}
111+
with:
112+
source-directory: 'gen/biskotaki'
113+
destination-github-username: 'boromir674'
114+
destination-repository-name: 'biskotaki'
115+
user-email: k.lampridis@hotmail.com
116+
user-name: 'Konstantinos'
117+
destination-repository-username: 'boromir674'
118+
target-branch: ${{ env.branch }}
119+
commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package'

.github/workflows/test.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
name: Test Python Package
2-
# Automated process to run test suite against different platforms and python versions
2+
# Stress Test against different platforms and python versions
33

44
on:
55
push:
66
branches:
7-
- 'master'
8-
- 'dev'
9-
- 'ci'
7+
- master
8+
- dev
9+
- ci
1010
pull_request:
1111
branches:
12-
- 'master'
12+
- master
13+
- dev
14+
tags:
15+
- v*
1316

1417

1518
jobs:
@@ -34,27 +37,29 @@ jobs:
3437
python -m pip install tox tox-gh-actions
3538
3639
- name: Do Lint Checking
37-
run: tox -e lint -vv
40+
run: tox -e lint -vv -s false
3841

3942
- name: Do Type Checking
40-
run: tox -e type -s false -vv
43+
run: tox -e type -vv -s false
4144

4245
- name: Check for compliance with Python Best Practices
43-
run: tox -e check -s false -vv
46+
run: tox -e check -vv -s false
4447

4548
# - name: Specify current package version to assist build tool
4649
# run: echo "PKG_VERSION=$(python scripts/parse_version.py)" >> $GITHUB_ENV
4750

4851
# - name: Run Test Suite
49-
# run: tox -s false -vv
52+
# run: tox -vv -s false
5053
# env:
5154
# PLATFORM: ${{ matrix.platform }}
5255

5356
# - name: Install coverage.py
5457
# run: python -m pip install coverage
5558

5659
# - name: Aggregate Test Suite Coverage Data
57-
# run: tox -e coverage -s false --sitepackages -vv
60+
# run: |
61+
# python -m pip install coverage
62+
# tox -e coverage --sitepackages -vv -s false
5863

5964
# # TODO Delegate uploading to codecov to a another Job
6065
# - name: Upload coverage to Codecov

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ node_modules
2020
dependency-graphs/
2121
test-results/
2222
uml-diagrams/
23+
pydoer-graphs/

CHANGELOG.rst

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,101 @@
1+
=========
12
Changelog
23
=========
34

4-
0.9.1 (2022-05-09)
5-
------------------
5+
0.10.0 (2022-05-11)
6+
===================
7+
8+
Enhance the Template's project generated CI config, by adding extra `checks` in Test Jobs and
9+
automating the `integration` with the `codecov.io` hosting service.
10+
11+
Added `checks`
12+
--------------
13+
14+
- Doing a 'Lint check' on the code
15+
- Doing a 'Compliance check' of the resulting packaged distro against python best practices
16+
- Gathering and sending the Test Suite results to the codecov.io service
17+
18+
Code Coverage
19+
-------------
20+
21+
Include `step` in all Test Jobs to gather and send Code Coverage data resulting from running
22+
the Test Suite.
23+
24+
`Codecov` is to Code Coverage, as `GA` is to Continuous Integration.
625

7-
Added some "juicy" 'code badges' in README, to demonstrate the status reported by
8-
the various CI services that this github repository integrates with.
26+
Upon granting permission, `codecov` will start accepting the accumulated results (such as
27+
Code Coverage data) from all `Test Jobs` during a `build` and provide a web UI featuring
28+
interactive visualization of the python code and its `coverage` on user-defined granularity
29+
level, interactive charts of the `coverage` evolution and more.
30+
31+
ci
32+
--
33+
Apply the same CI additions as the ones added for the Template project (see above)!
34+
Namely:
35+
36+
- extra `checks` in the `Test Jobs`
37+
- `integration` with the `codecov.io` Code Coverage hosting service
938

1039
documentation
11-
^^^^^^^^^^^^^
12-
- add badges demonstrating code coverage percentage & code quality reported CI services
40+
-------------
41+
Add some "juicy" **code badges** in `README`, to demonstrate the `status` reported by
42+
the various `CI services` that this repository integrates with. The badges are updated
43+
automatically, as their respective status reporting (web) service `continuously integrates`
44+
(ie triggers per commit) with the `cookiecutter-python-package` Project.
45+
46+
Changes
47+
^^^^^^^
48+
49+
feature
50+
"""""""
51+
- enable lint, distro packaging QA & test results transimission to codecov.io CI service
52+
53+
fix
54+
"""
55+
- fix generated tox ini that had a hard coded value!
56+
57+
documentation
58+
"""""""""""""
59+
- add the changes introduced in this release
60+
- add Codacy Badge to quickly show the reported Code Quality
61+
62+
ci
63+
""
64+
- enable test workflow for tags matching pattern "v*", pull requests to dev & pushes to ci branch
65+
- add job to generate the Biskotaki Python Package from this Template
1366

1467

1568
0.9.0 (2022-05-09)
16-
------------------
69+
==================
1770

18-
feature
71+
Changes
1972
^^^^^^^
73+
74+
feature
75+
"""""""
2076
- update generated .gitignore
2177
- add lint check and lint apply tox envs in the generated project
2278
- document the project structure, test infra and ci as changelog entry
2379

2480
fix
25-
^^^
81+
"""
2682
- fix the generated tox ini multifactor environments
2783
- add contributing and license rules for generated package
2884

2985
test
30-
^^^^
86+
""""
3187
- skip test cases needing internet connection for default Test Suite execution
3288
- add test case for running without initializing git repository
3389
- define a test case where we run tox for a newly generated project
3490
- 73% code coverage
3591

3692
documentation
37-
^^^^^^^^^^^^^
93+
"""""""""""""
3894
- document the get_object fixture
3995
- add instructions on how to Check Lint Rules and apply Lint fixes to satisfy them
4096

4197
ci
42-
^^
98+
""
4399
- ignore post_gen_project.py script because the templated vars make black complain
44100
- add lint check in Test Workflow
45101
- add lint environment, which can check & fix code following our Code Style/Linting strategy
@@ -52,17 +108,20 @@ ci
52108

53109

54110
0.8.3 (2022-04-29)
55-
------------------
111+
==================
112+
113+
Changes
114+
^^^^^^^
56115

57116
docs
58-
^^^^
117+
""""
59118
- add CONTRIBUTING.md
60119

61120
dev
62-
^^^
121+
"""
63122
- add configuration for code static analysis with `pylint`
64123
- add configuration for code static analysis with `prospector`
65124

66125
ci
67-
^^
126+
""
68127
- add type checking all CI Jobs

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ git clone git@github.com:boromir674/cookiecutter-python-package.git
7676
3. Install your local copy into a virtualenv. Assuming you have virtualenv installed, this is how you set up your fork for local development:
7777

7878
```bash
79-
cd cookiecutter-python-packge
79+
cd cookiecutter-python-package
8080
virtualenv cookie-pypi --python=python3
8181
source cookie-pypi/bin/activate
8282
pip install -e .

README.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Python Package (pypi) Cookiecutter, with emphasis on CI/CD and automation.
55

66
.. start-badges
77
8-
| |build| |docs| |coverage| |ossf| |maintainability| |better_code_hub| |tech-debt|
8+
| |build| |docs| |coverage| |ossf| |maintainability| |better_code_hub| |codacy| |tech-debt|
99
| |release_version| |wheel| |supported_versions| |gh-lic| |commits_since_specific_tag_on_master| |commits_since_latest_github_release|
1010
1111
|
@@ -187,9 +187,9 @@ For more complex use cases, you can modify the Template and also leverage all of
187187

188188
.. Github Releases & Tags
189189
190-
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v0.9.1/master?color=blue&logo=github
190+
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v0.10.0/master?color=blue&logo=github
191191
:alt: GitHub commits since tagged version (branch)
192-
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v0.9.1..master
192+
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v0.10.0..master
193193

194194
.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
195195
:alt: GitHub commits since latest release (by SemVer)
@@ -221,6 +221,14 @@ For more complex use cases, you can modify the Template and also leverage all of
221221
:target: https://bettercodehub.com/
222222

223223

224+
.. Codacy
225+
.. Code Quality, Style, Security
226+
227+
.. |codacy| image:: https://app.codacy.com/project/badge/Grade/5be4a55ff1d34b98b491dc05e030f2d7
228+
:alt: Codacy
229+
:target: https://www.codacy.com/gh/boromir674/cookiecutter-python-package/dashboard?utm_source=github.com&utm_medium=referral&utm_content=boromir674/cookiecutter-python-package&utm_campaign=Badge_Grade
230+
231+
224232
.. Code Climate CI
225233
.. Code maintainability & Technical Debt
226234

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
## Setuptools specific information
33
name = cookiecutter_python
4-
version = 0.9.1
4+
version = 0.10.0
55
# renders on pypi as subtitle
66
description = Yet another modern Python Package (pypi) with emphasis in CI/CD and automation
77
long_description = file: README.rst
@@ -15,7 +15,7 @@ author_email = k.lampridis@hotmail.com
1515
# represents the web home page of the project
1616
url = https://github.com/boromir674/cookiecutter-python-package
1717

18-
download_url = https://github.com/boromir674/cookiecutter-python-package/archive/v0.9.1.tar.gz
18+
download_url = https://github.com/boromir674/cookiecutter-python-package/archive/v0.10.0.tar.gz
1919

2020
## PyPi specific information
2121
project_urls =

0 commit comments

Comments
 (0)