Skip to content

Commit

Permalink
add mixins and some utils (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITProKyle committed Dec 28, 2023
1 parent a38097b commit e0032c2
Show file tree
Hide file tree
Showing 37 changed files with 2,541 additions and 1,125 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defaults:
shell: bash

env:
DEFAULT_PYTHON_VERSION: 3.11
NODE_VERSION: '20'
PYTEST_ADDOPTS: --color=yes


jobs:
pre-commit:
name: pre-commit
Expand All @@ -32,7 +32,7 @@ jobs:
name: Lint Python
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]
python-version: [3.11, 3.12]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11]
python-version: [3.11, 3.12]
steps:
- uses: actions/checkout@v3
- uses: ITProKyle/action-setup-python@v0.4.0
Expand All @@ -68,17 +68,16 @@ jobs:
- lint-python
- test-python
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ITProKyle/action-setup-python@v0.4.0
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
- name: Install Poetry Plugins
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Run Build
run: make build
- name: Upload Distribution Artifact
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Release

on:
release:
types:
- published

env:
DEFAULT_PYTHON_VERSION: 3.11

jobs:
build-pypi:
name: Build PyPi 📦
runs-on: ubuntu-latest
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ITProKyle/action-setup-python@v0.4.0
with:
poetry-install: false
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
- name: Install Poetry Plugins
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Run Build
run: make build
- name: Upload Distribution Artifact
uses: actions/upload-artifact@v4
with:
name: pypi-dist
path: dist
publish-pypi:
name: Publish 📦 To PyPI
needs:
- build-pypi
runs-on: ubuntu-latest
steps:
- name: Checkout Repo (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Distribution Artifact
uses: actions/download-artifact@v4
with:
name: pypi-dist
path: dist
- uses: ITProKyle/action-setup-python@v0.4.0
with:
poetry-install: false
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
- name: Install Poetry Plugins
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Publish Distribution 📦 to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.pypi_password }}
run: poetry publish
2 changes: 1 addition & 1 deletion .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master

jobs:
update_draft_release:
update-draft-release:
name: Draft release
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ name: Spell Check

on: push


env:
NODE_VERSION: '20'


jobs:
spell-check:
runs-on: ubuntu-latest
Expand Down
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-merge-conflict
- id: check-yaml
args:
- --unsafe # needed for parsing CFN
- id: end-of-file-fixer
exclude: .*\.json-result
- id: file-contents-sorter
args: [--unique]
files: |
(?x)^(
\.dockerignore|
\.gitignore
)$
- id: pretty-format-json
Expand All @@ -30,6 +28,14 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
exclude: |
(?x)^(
(.*/)?poetry\.lock
)$
- repo: https://github.com/ITProKyle/pre-commit-hook-yamlfmt
rev: v0.2.1
hooks:
Expand All @@ -44,7 +50,7 @@ repos:
- mdformat-gfm
- mdformat-toc
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
rev: v0.38.0
hooks:
- id: markdownlint
language_version: lts
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry self add "poetry-dynamic-versioning[plugin]"
- poetry install --with docs

# Build documentation in the docs/ directory with Sphinx
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ help: ## show this message
build: ## build the PyPi release
@poetry build

.PHONY: docs
docs: ## delete build artifacts, start sphinx-autobuild server, & open browser window
@if [[ -z "$${CI}" ]]; then \
$(MAKE) --no-print-directory -C docs docs; \
Expand Down Expand Up @@ -93,5 +94,10 @@ spellcheck: ## run cspell
--relative \
--show-context

test: ## run tests
@echo "no tests configured for this project yet"
test: ## run integration and unit tests
@echo "Running integration & unit tests..."
@poetry run pytest $(PYTEST_REPORT_OPTS) \
--cov f_lib \
--cov-report term-missing:skip-covered \
--dist loadfile \
--numprocesses auto
4 changes: 4 additions & 0 deletions docs/source/_static/scripts/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// open external links in new tabs
$(document).ready(function () {
$('a.external').attr('target', '_blank');
});
Loading

0 comments on commit e0032c2

Please sign in to comment.