Skip to content

Commit

Permalink
prep 0.20.3 release (#254)
Browse files Browse the repository at this point in the history
* update full project to new dev standards (#250)

* update full project to new dev standards part 1

* remove old unused files

* remove old unused files

* disable pylint ci test temporarily

* disable pylint ci test temporarily

* initial new docs build out

* get new docs introduced via mkdocs

* initial few pylint fixes

* get pytest passing

* update all project dependencies and make sure tests still pass

* remove sphinx ci stage and add some needs clauses

* fix install mode and update changelog

* Apply suggestions from code review

Co-authored-by: Ken Celenza <[email protected]>

* readthedocs config file and update changelogs/release notes

* add python stylizer in docs

* newer version in dunder init

* add logo

* fix mkdocs formatting

Co-authored-by: Ken Celenza <[email protected]>

* fix library summary (#253)

* add meta to pyproject and add license (#255)

Co-authored-by: Ken Celenza <[email protected]>
  • Loading branch information
jeffkala and itdependsnetworks authored Oct 26, 2022
1 parent 626b7b8 commit cb1540e
Show file tree
Hide file tree
Showing 228 changed files with 3,691 additions and 2,019 deletions.
7 changes: 4 additions & 3 deletions .bandit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
skips: ["B101", "B107"]
# No need to check for security issues in test scripts
skips: []
# No need to check for security issues in the test scripts!
exclude_dirs:
- "./test/"
- "./tests/"
- "./.venv/"
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Docker related
development/Dockerfile
development/docker-compose*.yml
development/*.env
*.env
environments/

# Python
**/*.pyc
**/*.pyo
**/__pycache__/
**/.pytest_cache/
**/.venv/


# Other
docs/_build
FAQ.md
.git/
.gitignore
.github
tasks.py
LICENSE
**/*.log
**/.vscode/
invoke*.yml
tasks.py
11 changes: 5 additions & 6 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[flake8]
ignore = E203, E266, E501, W503
# line length is intentionally set to 80 here because black uses Bugbear
# See https://github.com/psf/black/blob/master/README.md\#line-length for more details
max-line-length = 80
max-complexity = 18
select = B,C,E,F,W,T4,B9
# E501: Line length is enforced by Black, so flake8 doesn't need to check it
# W503: Black disagrees with this rule, as does PEP 8; Black wins
ignore = E501, W503
exclude =
.venv
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Default owner(s) of all files in this repository
* @jeffkala @pszulczewski @pke11y
* @jeffkala @pszulczewski @pke11y
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: 🐛 Bug Report
about: Report a reproducible bug in the current release of pyntc
---

### Environment
* Python version: <!-- Example: 3.7.7 -->
* pyntc version: <!-- Example: 1.0.0 -->

<!-- What did you expect to happen? -->
### Expected Behavior


<!-- What happened instead? -->
### Observed Behavior

<!--
Describe in detail the exact steps that someone else can take to reproduce
this bug using the current release.
-->
### Steps to Reproduce
1.
2.
3.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: ✨ Feature Request
about: Propose a new feature or enhancement

---

### Environment
* pyntc version: <!-- Example: 1.0.0 -->

<!--
Describe in detail the new functionality you are proposing.
-->
### Proposed Functionality

<!--
Convey an example use case for your proposed feature. Write from the
perspective of a user who would benefit from the proposed
functionality and describe how.
--->
### Use Case

10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## New Pull Request

Have you:
- [ ] Updated the README if necessary?
- [ ] Updated any configuration settings?
- [ ] Written a unit test?

## Change Notes

## Justification
5 changes: 5 additions & 0 deletions .github/styles/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
I am a placeholder file to make Vale function.

Please do not delete me.

K thanx bai!
251 changes: 251 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
---
name: "CI"
concurrency: # Cancel any existing runs of this workflow for this same PR
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on: # yamllint disable-line rule:truthy rule:comments
push:
branches:
- "main"
- "develop"
tags:
- "v*"
pull_request: ~

env:
IMAGE_NAME: "pyntc"

jobs:
black:
runs-on: "ubuntu-20.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
runs-on: "ubuntu-20.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
needs:
- "black"
pydocstyle:
runs-on: "ubuntu-20.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
needs:
- "black"
flake8:
runs-on: "ubuntu-20.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
needs:
- "black"
yamllint:
runs-on: "ubuntu-20.04"
env:
INVOKE_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
needs:
- "black"
build:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
- name: "Build"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "./"
push: false
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
file: "./Dockerfile"
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
PYTHON_VER=${{ env.PYTHON_VER }}
needs:
- "bandit"
- "pydocstyle"
- "flake8"
- "yamllint"
# TODO: Re-enable after initial pylint issue is completed. https://github.com/networktocode/pyntc/issues/249
# pylint:
# runs-on: "ubuntu-20.04"
# strategy:
# fail-fast: true
# matrix:
# python-version: ["3.7"]
# env:
# PYTHON_VER: "${{ matrix.python-version }}"
# steps:
# - name: "Check out repository code"
# uses: "actions/checkout@v2"
# - name: "Setup environment"
# uses: "networktocode/gh-action-setup-poetry-environment@v2"
# - name: "Get image version"
# run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
# - name: "Set up Docker Buildx"
# id: "buildx"
# uses: "docker/setup-buildx-action@v1"
# - name: "Load the image from cache"
# uses: "docker/build-push-action@v2"
# with:
# builder: "${{ steps.buildx.outputs.name }}"
# context: "./"
# push: false
# load: true
# tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
# file: "./Dockerfile"
# cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
# cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
# build-args: |
# PYTHON_VER=${{ env.PYTHON_VER }}
# - name: "Debug: Show docker images"
# run: "docker image ls"
# - name: "Linting: Pylint"
# run: "poetry run invoke pylint"
# needs:
# - "build"
pytest:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
- name: "Load the image from cache"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "./"
push: false
load: true
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
file: "./Dockerfile"
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
build-args: |
PYTHON_VER=${{ env.PYTHON_VER }}
- name: "Debug: Show docker images"
run: "docker image ls"
- name: "Run Tests"
run: "poetry run invoke pytest"
needs:
# Remove everything but pylint once pylint is passing.
# - "pylint"
- "bandit"
- "pydocstyle"
- "flake8"
- "yamllint"
publish_gh:
name: "Publish to GitHub"
runs-on: "ubuntu-20.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Upload binaries to release"
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}"
file: "dist/*"
tag: "${{ github.ref }}"
overwrite: true
file_glob: true
needs:
- "pytest"
publish_pypi:
name: "Push Package to PyPI"
runs-on: "ubuntu-20.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Push to PyPI"
uses: "pypa/gh-action-pypi-publish@release/v1"
with:
user: "__token__"
password: "${{ secrets.PYPI_API_TOKEN }}"
needs:
- "pytest"
Loading

0 comments on commit cb1540e

Please sign in to comment.