Skip to content

Commit

Permalink
[NEW] Py Pkg Gen v2.3.0 Release
Browse files Browse the repository at this point in the history
Release Version '' into 'master' Branch
  • Loading branch information
boromir674 authored Mar 13, 2024
2 parents b7ec981 + aa53eba commit 1ebe0b2
Show file tree
Hide file tree
Showing 27 changed files with 975 additions and 571 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-to-boarding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: boromir674/automated-workflows/.github/workflows/go-pr-to-boarding.yml@test
with:
# pass tag to PR from <user_branch> --> <github.ref>-<user_branch>
board_tag: "${{ github.ref }}"
board_tag: "${{ github.ref_name }}"
main_branch: ${{ vars.MAIN_BRANCH || 'main' }}
secrets:
github_pat: ${{ secrets.GH_TOKEN }}
38 changes: 19 additions & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: CI/CD Pipeline
# Continuous Integration / Continuous Delivery

# Triggers on all branches and tags starting with v
# Triggers on all Branches and v* Tags

### Full Job Matrix for Stress Testing on: ###
### Stress-Testing, with Multi-Factor Job Matrix, on: ###
# - tags v*
# - the 'stress-test' branch (GITHUB_REF_NAME == 'stress-test')


### PyPI publish on: ###
### Production PyPI Publish, pypi.org, on: ###
# - v* tags on 'master' branch only

### Staging/Test PyPI Publish, test.pypi.org, on: ###
## Test PyPI publish on: ##
# - v*-rc 'pre-release' tags on 'release' branch

Expand All @@ -32,7 +33,7 @@ env:
UBUNTU_PY310_STRATEGY: "{\"platform\": [\"ubuntu-latest\"], \"python-version\": [\"3.10\"]}"
TEST_STRATEGY: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\", \"windows-latest\"], \"python-version\":[\"3.10\"]}"

##### JOB ON/OFF SWITCHES - 1st level overrides #####
##### JOB ON/OFF SWITCHES - Top/1st level overrides #####
RUN_UNIT_TESTS: "true"
RUN_LINT_CHECKS: "true"
DOCKER_JOB_ON: "true"
Expand Down Expand Up @@ -297,6 +298,7 @@ jobs:
done
## DOCKER BUILD and PUBLISH ON DOCKERHUB ##
# Ref Page: https://automated-workflows.readthedocs.io/en/main/ref_docker/
docker_build:
needs: [set_github_outputs, test_suite]
uses: boromir674/automated-workflows/.github/workflows/docker.yml@v1.1.0
Expand Down Expand Up @@ -354,7 +356,6 @@ jobs:
outputs:
ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.ENVIRONMENT_NAME }}
AUTOMATED_DEPLOY: ${{ steps.set_environment_name.outputs.AUTOMATED_DEPLOY }}
TAG_ON_MASTER: ${{ steps.main_contains_tag.outputs.retval }}

## JOB: PYPI UPLOAD ##
pypi_publish:
Expand All @@ -372,18 +373,6 @@ jobs:
secrets:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

### DOCS BUILD/TEST - DOCUMENTATION SITE ###
docs:
name: Build Documentation
needs: set_github_outputs
# bafaa2c2a014758a4421fe9b5c02ba66dbfdbef6
uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@test
with:
run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}'
python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }}
command: "tox -e docs --sitepackages -vv -s false"
# command: "tox -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false"

### STATIC CODE ANALYSIS & LINTING ###
lint:
name: Static Code Analysis
Expand All @@ -396,19 +385,30 @@ jobs:
python_version: ${{ needs.set_github_outputs.outputs.PIPE_SQA_PY }}
pylint_threshold: ${{ needs.set_github_outputs.outputs.PIPE_SQA_PYLINT_PASS_SCORE }}

### DOCS BUILD/TEST - DOCUMENTATION SITE ###
docs:
name: Build Documentation
needs: set_github_outputs
# bafaa2c2a014758a4421fe9b5c02ba66dbfdbef6
uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@test
with:
run_policy: '${{ needs.set_github_outputs.outputs.PIPE_DOCS_POLICY }}'
python_version: ${{ needs.set_github_outputs.outputs.PIPE_DOCS_PY }}
command: "tox -e docs --sitepackages -vv -s false"
# command: "tox -e pin-deps -- -E docs && tox -e docs --sitepackages -vv -s false"

### DRAW PYTHON DEPENDENCY GRAPHS ###
code_visualization:
needs: set_github_outputs
name: Code Visualization of Python Imports as Graphs, in .svg
uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@test
uses: boromir674/automated-workflows/.github/workflows/python_imports.yml@v1.3.0
with:
run_policy: '${{ needs.set_github_outputs.outputs.PIPE_CODE_VIZ_POLICY }}'
branches: 'main, master, dev'
source_code_targets: 'src'
python_version: '3.10'
artifacts_dir: 'dependency-graphs'


### Make a Github Release ###
gh_release:
needs: [test_suite, check_which_git_branch_we_are_on]
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
Changelog
=========

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

Changes
^^^^^^^

feature
"""""""
- cover most source code areas, when PR labeling: src, tests, ci, data, config
- add Job that makes a Github Release on v* tags on Main Branch

fix
"""
- expect interpreters to be loaded as dict by cookiecutter in intereactive mode

test
""""
- update Gold Standard Snapshot
- update biskotaki-interactive Snapshot, used in Regression Testing
- update biskotaki-no-input Snapshot, used in Regression Testing

ci
""
- clean code

gitops
""""""
- pass git tag to Workflow for PR in to a boarding branch


2.2.1-dev1 (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.2.1-dev1/master?color=blue&logo=github
.. |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
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.2.1-dev1..master
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.3.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.2.1-dev1'
release = '2.3.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.2.1-dev1"
version = "2.3.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.2.1-dev1'
__version__ = '2.3.0'

from . import _logging # noqa
9 changes: 8 additions & 1 deletion src/cookiecutter_python/backend/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ def parse_context(config_file: str):
data = get_user_config(config_file, default_config=False)
# data = load_yaml(config_file)
user_context = data['default_context']
c = json.loads(user_context.get('interpreters', '{}'))
_interpreters: t.Mapping[str, t.List[str]] = user_context.get('interpreters', '{}')
if isinstance(_interpreters, str):
logger.warning(
"Interpreters expected to be loaded in a python dict already. Got a string instead."
)
logger.info("Converting interpreters %s to a python dict", _interpreters)
_interpreters = json.loads(_interpreters)
c = _interpreters

context_defaults = dict(cookie_defaults, **user_context)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,134 @@
# Pull Request Labeling Rules based on changed files
# https://github.com/actions/labeler

# Add 'ci' label to any change within the '.github' dir
ci:
- any: ['.github/*', '.github/**/*']

####### LABELS based on FILE CHANGES #######

# Here, we declare Rules for Labeling PR based on the file changes

# Each Label is added, when their Rule(s) are True
# - 'any' block is True, if any of the conditions are True
# - 'all' block is True, if all of the conditions are True

# Typically a Label, only features one of 'any' or 'all' block

# Each label declares Rules that are mutually exclusive, in boolean logic.
# Thus, the set of matching file paths are non-overlapping, across the labels.


# Add 'business_logic' label to any change within the 'src/{{ cookiecutter.pkg_name }}' dir
### SRC ###
# Add 'business_logic' label to any change within the 'src/cookiecutter_python' dir
business_logic:
- any: ['src/{{ cookiecutter.pkg_name }}/*', 'src/{{ cookiecutter.pkg_name }}/**/*']
- any:
- changed-files:
- any-glob-to-any-file:
- 'src/{{ cookiecutter.pkg_name }}/*'
- 'src/{{ cookiecutter.pkg_name }}/*'

stubs:
- any:
- changed-files:
- any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*']

# Add 'docs' label to any change within the 'docs' dir
### TESTS ###
## Add 'test' label to any change within the 'tests' dir #
test:
- any:
- changed-files:
- any-glob-to-any-file:
- 'tests/*'
- 'tests/**/*'

# exclude any changes within the 'tests/data/' dir
- all:
- changed-files:
- all-globs-to-all-files:
- '!tests/data/*'
- '!tests/data/**/*'

test_data:
- any:
- changed-files:
- any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*']

### DOCS ###
# Any change within the 'docs' dir, or the '.readthedocs.yml' file
docs:
- any: ['docs/*', 'docs/**/*']
- any:
- changed-files:
- any-glob-to-any-file:
- 'docs/*'
- 'docs/**/*'
- '.readthedocs.yml'
- 'README.rst'
- 'README.md'

### SCRIPTS ###
scripts:
- any:
- changed-files:
- any-glob-to-any-file:
- 'scripts/**'

# Add 'test' label to any change within the 'tests' dir
test:
- any: ['tests/*', 'tests/**/*']
### CI ###
# Add 'ci' label to any change within the '.github' dir
ci:
- any:
- changed-files:
- any-glob-to-any-file: ['.github/*', '.github/**/*']

### DOCKER ###
docker:
- any:
- changed-files:
- any-glob-to-any-file:
- 'Dockerfile'
- 'docker-compose.yml'
- 'docker-compose.*.yml'
- '.dockerignore'

### POETRY ###
poetry:
- any:
- changed-files:
- any-glob-to-any-file:
- 'pyproject.toml'
- 'poetry.lock'

### TOX ###
tox:
- any:
- changed-files:
- any-glob-to-any-file:
- 'tox.ini'

config:
- any:
- changed-files:
- any-glob-to-any-file:
- '.bettercodehub.yml'
- '.coveragerc'
- '.gitignore'
- '.prospector.yml'
- '.pylintrc'


####### LABELS based on BRANCH NAME #######

## Pull Request Labeling Rules based Base Branch

# Add 'release' label to any PR that is opened against the `main` branch
release:
- base-branch: 'main'

# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch
# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR
boarding_auto:
- base-branch: ['^boarding-auto', 'boarding-auto']
- base-branch: ['^board-n-release', 'board-n-release']


# Add 'feature' label to any PR where the head branch name starts with
# `feature` or has a `feature` section in the name
feature:
- head-branch: ['^feature', 'feature']
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ on:
- pull_request_target

jobs:
triage:
label_PR:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
# This Job behaves as a Listener to PR events, and each step is a Handler
steps:
- uses: actions/labeler@v4
with:
repo-token: ${{ "{{" }} secrets.GITHUB_TOKEN {{ "}}" }}
# HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml'
- uses: actions/labeler@v5
with:
# if you want your labels to trigger other Workflows, pass-in a PAT
# with permission for label creation events to trigger listeners
repo-token: ${{ "{{" }} secrets.GITHUB_TOKEN {{ "}}" }}
Loading

0 comments on commit 1ebe0b2

Please sign in to comment.