Skip to content

Commit

Permalink
[NEW] Py Pkg Gen v2.4.0 Release
Browse files Browse the repository at this point in the history
Release Version '' into 'master' Branch
  • Loading branch information
boromir674 authored Mar 14, 2024
2 parents 1ebe0b2 + 65b54ab commit b204de3
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 30 deletions.
67 changes: 51 additions & 16 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ jobs:
cd cloned/biskotaki
echo "PKG_VERSION=$(python scripts/parse_version.py)" >> $GITHUB_ENV
# INSTALL `generate-python` CLI
- name: Install `generate-python` CLI
run: pip install --user -e .

## GENERATE FROM TEMPLATE into gen/ ##
# ROOT : gen/biskotaki/pyproject.toml
- name: Generate Biskotaki from Template
run: |
pip install --user -e .
echo " version: \"${{ env.PKG_VERSION }}\"" >> .github/biskotaki.yaml
generate-python -o gen --config-file ./.github/biskotaki.yaml --no-input -f --offline
Expand All @@ -67,8 +70,8 @@ jobs:
- name: Test distributions 'Source', 'Built' and 'edit' (dev env) mode installation
env:
TOXPYTHON: "python${{ env.PY_VERSION }}"
working-directory: gen/biskotaki
run: |
cd gen/biskotaki
tox -e 'edit,sdist,wheel'
tox -e wheel-test
tox -e coverage
Expand All @@ -77,30 +80,38 @@ jobs:

# Running Type Check, on src and Test code: Passes
- name: 'Mypy: Static Type Checker -> PASS'
working-directory: gen/biskotaki
run: |
cd gen/biskotaki
tox -e pin-deps -- -E typing
tox -e type
- name: 'Ruff: Fast Python Linter -> PASS'
run: |
cd gen/biskotaki
tox -e ruff
working-directory: gen/biskotaki
run: tox -e ruff

# Running Lint Check, on src and Test code: Passes
- name: 'Isort, Black: Code Formatter -> PASS'
run: |
cd gen/biskotaki
tox -e lint
working-directory: gen/biskotaki
run: tox -e lint
# Running the Build script (sdist and wheel): produces Distro Artifacts: Source (.tar.gz) and Wheel (.whl) files
- name: 'Build: sdist, wheel -> PASS'
run: |
cd gen/biskotaki
tox -e build
working-directory: gen/biskotaki
run: tox -e build
# Running Quality Checks against Distro Metadata: Passes with 10/10 score
- name: 'Pyroma: Distro Quality -> PASS'
working-directory: gen/biskotaki
run: tox -e check

# Docs Checks: Run Build Docs command, and verify it succeeds
- name: 'Sphinx: Build Docs Web Site (html/css/js) -> PASS'
working-directory: gen/biskotaki
run: |
cd gen/biskotaki
tox -e check
tox -e pin-deps -- -E docs # poetry export
tox -e docs
- name: Remove requirements file generated with 'poetry export' for Docs
# See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE
run: rm -f gen/biskotaki/reqs.txt

# tox -e graphs

Expand All @@ -120,15 +131,39 @@ jobs:
target-branch: ${{ env.branch }}
commit-message: 'apply Template from https://github.com/boromir674/cookiecutter-python-package'

## GENERATE Python Gold Standard FROM TEMPLATE into gen/ ##
# ROOT : gen/biskotaki/pyproject.toml
## GENERATE Python GOLD STANDARD from TEMPLATE into gen/ ##
# ROOT : gen-gold/biskotaki-gold-standard/pyproject.toml
- name: Generate Python Gold Standard Biskotaki from Template
env:
USER_CONFIG: tests/data/gold-standard.yml
run: |
echo " version: \"${{ env.PKG_VERSION }}\"" >> ${{ env.USER_CONFIG }}
generate-python -o gen-gold --config-file "${{ env.USER_CONFIG }}" --no-input -f --offline
# Generate poetry.lock to include in the Pushed Files
- name: Generate Poetry.lock
run: |
pip install pipx
pipx install poetry
poetry lock
working-directory: gen-gold/biskotaki-gold-standard

## MKDOCS Checks: Run Build Docs command, and verify it succeeds ##
- name: 'Mkdocs: Build Docs Web Site (html/css/js) -> PASS'
working-directory: gen-gold/biskotaki-gold-standard
run: |
tox -e pin-deps -- -E docs # poetry export
tox -e docs
# exlude 'site' dir from pushing to biskotaki repo
- name: Exclude 'site' folder, built with Mkdocs, from 'git push'
run: rm -rf gen-gold/biskotaki-gold-standard/site

# exlude 'reqs.txt' file, generated with 'poetry export' for Docs
- name: Exclude 'reqs.txt' file, generated with 'poetry export' for Docs
# See tox.ini -> testenv.setenv.DEFAULT_REQS_FILE
run: rm -f gen-gold/biskotaki-gold-standard/reqs.txt

## PUSH the Python Gold Standard to BISKOTAKI REPO ##
- name: Push to dedicated branch in biskotaki repo
# Pin to v1.7.2 -> 07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/merge-rt-in-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ jobs:
fetch-depth: 0 # 0 indicates all history for all branches and tags.
set-safe-directory: '' # `git config --global --add safe.directory <path>`
token: '${{ secrets.GH_TOKEN }}'

# track remote master, since this Workflow triggers on push tag or pull request activity
- name: Track Remote Master
run: git branch --track "${{ env.MAIN_BR }}" "origin/${{ env.MAIN_BR }}"

- name: Ensure Release Branch exists and is rebased on Main Branch, before PR
run: |
(git branch --track "${{ env.RELEASE_BR }}" "origin/${{ env.RELEASE_BR }}" && git rebase ${{ env.MAIN_BR }} && git push) || echo "Branch '${{ env.RELEASE_BR }}' does NOT exist in remote Origin"
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
Changelog
=========

2.4.0 (2024-03-14)
==================

Changes
^^^^^^^

feature
"""""""
- make Gold Standard Python Project pass Pylint Job on CI
- comment out the 'verbose' cli flag to make pylint score over 8.2 on fresh project

ci
""
- prevent Mkdocs 'site' folder from being pushed to Biskotaki repo, after 'tox -e docs'
- install 'generate-python' CLI in dedicated step
- install pipx and poetry (using pipx)
- run poetry lock and add poetry.lock file in py-gold branch of biskotaki repo

release
"""""""
- bump version to 2.4.0

gitops
""""""
- handle case where the origin/release branch is not found


2.3.0 (2024-03-13)
==================

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ Free/Libre and Open Source Software (FLOSS)

.. Github Releases & Tags
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.3.0/master?color=blue&logo=github
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.4.0/master?color=blue&logo=github
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.3.0..master
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.4.0..master

.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
:alt: GitHub commits since latest release (by SemVer)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
author = 'Konstantinos Lampridis'

# The full version, including alpha/beta/rc tags
release = '2.3.0'
release = '2.4.0'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api"
## Also renders on pypi as 'subtitle'
[tool.poetry]
name = "cookiecutter_python"
version = "2.3.0"
version = "2.4.0"
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
authors = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
maintainers = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
Expand Down
2 changes: 1 addition & 1 deletion src/cookiecutter_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '2.3.0'
__version__ = '2.4.0'

from . import _logging # noqa
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
from {{ cookiecutter.pkg_name }}.cli import main

if __name__ == "__main__": # pragma: no cover
main(prog_name="{{ cookiecutter.pkg_name|replace('_', '-') }}")
main(prog_name="{{ cookiecutter.pkg_name|replace('_', '-') }}") # pylint: disable=unexpected-keyword-arg
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def version_msg():

@click.command(context_settings=dict(help_option_names=[u'-h', u'--help']))
@click.version_option(__version__, u'-V', u'--version', message=version_msg())
@click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False)
# @click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False)
def main(
verbose,
# verbose,
):
"""TODO Write this content that gets renders when invoking with --help flag!
Expand All @@ -39,7 +39,7 @@ def main(
"""
try:
pass
except Exception as error:
except Exception as error: # pylint: disable=broad-except
click.echo(error)
sys.exit(1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
from biskotakigold.cli import main

if __name__ == "__main__": # pragma: no cover
main(prog_name="biskotakigold")
main(prog_name="biskotakigold") # pylint: disable=unexpected-keyword-arg
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def version_msg():

@click.command(context_settings=dict(help_option_names=[u'-h', u'--help']))
@click.version_option(__version__, u'-V', u'--version', message=version_msg())
@click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False)
# @click.option('-v', '--verbose', is_flag=True, help='Print debug information', default=False)
def main(
verbose,
# verbose,
):
"""TODO Write this content that gets renders when invoking with --help flag!
Expand All @@ -39,7 +39,7 @@ def main(
"""
try:
pass
except Exception as error:
except Exception as error: # pylint: disable=broad-except
click.echo(error)
sys.exit(1)

Expand Down

0 comments on commit b204de3

Please sign in to comment.