Skip to content

Commit

Permalink
Merge pull request #369 from boromir674/test-distro
Browse files Browse the repository at this point in the history
Merging 'test-distro', into 'release-train'
  • Loading branch information
boromir674 authored Mar 14, 2024
2 parents 1ebe0b2 + 7f4aa24 commit 29a1fac
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 24 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
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 29a1fac

Please sign in to comment.