Skip to content

Commit cb1540e

Browse files
prep 0.20.3 release (#254)
* 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]>
1 parent 626b7b8 commit cb1540e

File tree

228 files changed

+3691
-2019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+3691
-2019
lines changed

.bandit.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
skips: ["B101", "B107"]
3-
# No need to check for security issues in test scripts
2+
skips: []
3+
# No need to check for security issues in the test scripts!
44
exclude_dirs:
5-
- "./test/"
5+
- "./tests/"
6+
- "./.venv/"

.dockerignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Docker related
2+
development/Dockerfile
3+
development/docker-compose*.yml
4+
development/*.env
5+
*.env
6+
environments/
7+
8+
# Python
9+
**/*.pyc
10+
**/*.pyo
11+
**/__pycache__/
12+
**/.pytest_cache/
13+
**/.venv/
14+
15+
16+
# Other
17+
docs/_build
18+
FAQ.md
19+
.git/
20+
.gitignore
21+
.github
22+
tasks.py
23+
LICENSE
24+
**/*.log
25+
**/.vscode/
26+
invoke*.yml
27+
tasks.py

.flake8

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[flake8]
2-
ignore = E203, E266, E501, W503
3-
# line length is intentionally set to 80 here because black uses Bugbear
4-
# See https://github.com/psf/black/blob/master/README.md\#line-length for more details
5-
max-line-length = 80
6-
max-complexity = 18
7-
select = B,C,E,F,W,T4,B9
2+
# E501: Line length is enforced by Black, so flake8 doesn't need to check it
3+
# W503: Black disagrees with this rule, as does PEP 8; Black wins
4+
ignore = E501, W503
5+
exclude =
6+
.venv

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Default owner(s) of all files in this repository
2-
* @jeffkala @pszulczewski @pke11y
2+
* @jeffkala @pszulczewski @pke11y

.github/ISSUE_TEMPLATE/bug_report.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: Report a reproducible bug in the current release of pyntc
4+
---
5+
6+
### Environment
7+
* Python version: <!-- Example: 3.7.7 -->
8+
* pyntc version: <!-- Example: 1.0.0 -->
9+
10+
<!-- What did you expect to happen? -->
11+
### Expected Behavior
12+
13+
14+
<!-- What happened instead? -->
15+
### Observed Behavior
16+
17+
<!--
18+
Describe in detail the exact steps that someone else can take to reproduce
19+
this bug using the current release.
20+
-->
21+
### Steps to Reproduce
22+
1.
23+
2.
24+
3.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: ✨ Feature Request
3+
about: Propose a new feature or enhancement
4+
5+
---
6+
7+
### Environment
8+
* pyntc version: <!-- Example: 1.0.0 -->
9+
10+
<!--
11+
Describe in detail the new functionality you are proposing.
12+
-->
13+
### Proposed Functionality
14+
15+
<!--
16+
Convey an example use case for your proposed feature. Write from the
17+
perspective of a user who would benefit from the proposed
18+
functionality and describe how.
19+
--->
20+
### Use Case
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## New Pull Request
2+
3+
Have you:
4+
- [ ] Updated the README if necessary?
5+
- [ ] Updated any configuration settings?
6+
- [ ] Written a unit test?
7+
8+
## Change Notes
9+
10+
## Justification

.github/styles/dummy.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
I am a placeholder file to make Vale function.
2+
3+
Please do not delete me.
4+
5+
K thanx bai!

.github/workflows/ci.yml

+251
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
---
2+
name: "CI"
3+
concurrency: # Cancel any existing runs of this workflow for this same PR
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: true
6+
on: # yamllint disable-line rule:truthy rule:comments
7+
push:
8+
branches:
9+
- "main"
10+
- "develop"
11+
tags:
12+
- "v*"
13+
pull_request: ~
14+
15+
env:
16+
IMAGE_NAME: "pyntc"
17+
18+
jobs:
19+
black:
20+
runs-on: "ubuntu-20.04"
21+
env:
22+
INVOKE_LOCAL: "True"
23+
steps:
24+
- name: "Check out repository code"
25+
uses: "actions/checkout@v2"
26+
- name: "Setup environment"
27+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
28+
- name: "Linting: black"
29+
run: "poetry run invoke black"
30+
bandit:
31+
runs-on: "ubuntu-20.04"
32+
env:
33+
INVOKE_LOCAL: "True"
34+
steps:
35+
- name: "Check out repository code"
36+
uses: "actions/checkout@v2"
37+
- name: "Setup environment"
38+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
39+
- name: "Linting: bandit"
40+
run: "poetry run invoke bandit"
41+
needs:
42+
- "black"
43+
pydocstyle:
44+
runs-on: "ubuntu-20.04"
45+
env:
46+
INVOKE_LOCAL: "True"
47+
steps:
48+
- name: "Check out repository code"
49+
uses: "actions/checkout@v2"
50+
- name: "Setup environment"
51+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
52+
- name: "Linting: pydocstyle"
53+
run: "poetry run invoke pydocstyle"
54+
needs:
55+
- "black"
56+
flake8:
57+
runs-on: "ubuntu-20.04"
58+
env:
59+
INVOKE_LOCAL: "True"
60+
steps:
61+
- name: "Check out repository code"
62+
uses: "actions/checkout@v2"
63+
- name: "Setup environment"
64+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
65+
- name: "Linting: flake8"
66+
run: "poetry run invoke flake8"
67+
needs:
68+
- "black"
69+
yamllint:
70+
runs-on: "ubuntu-20.04"
71+
env:
72+
INVOKE_LOCAL: "True"
73+
steps:
74+
- name: "Check out repository code"
75+
uses: "actions/checkout@v2"
76+
- name: "Setup environment"
77+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
78+
- name: "Linting: yamllint"
79+
run: "poetry run invoke yamllint"
80+
needs:
81+
- "black"
82+
build:
83+
strategy:
84+
fail-fast: true
85+
matrix:
86+
python-version: ["3.7", "3.8", "3.9", "3.10"]
87+
runs-on: "ubuntu-20.04"
88+
env:
89+
PYTHON_VER: "${{ matrix.python-version }}"
90+
steps:
91+
- name: "Check out repository code"
92+
uses: "actions/checkout@v2"
93+
- name: "Setup environment"
94+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
95+
- name: "Get image version"
96+
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
97+
- name: "Set up Docker Buildx"
98+
id: "buildx"
99+
uses: "docker/setup-buildx-action@v1"
100+
- name: "Build"
101+
uses: "docker/build-push-action@v2"
102+
with:
103+
builder: "${{ steps.buildx.outputs.name }}"
104+
context: "./"
105+
push: false
106+
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
107+
file: "./Dockerfile"
108+
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
109+
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
110+
build-args: |
111+
PYTHON_VER=${{ env.PYTHON_VER }}
112+
needs:
113+
- "bandit"
114+
- "pydocstyle"
115+
- "flake8"
116+
- "yamllint"
117+
# TODO: Re-enable after initial pylint issue is completed. https://github.com/networktocode/pyntc/issues/249
118+
# pylint:
119+
# runs-on: "ubuntu-20.04"
120+
# strategy:
121+
# fail-fast: true
122+
# matrix:
123+
# python-version: ["3.7"]
124+
# env:
125+
# PYTHON_VER: "${{ matrix.python-version }}"
126+
# steps:
127+
# - name: "Check out repository code"
128+
# uses: "actions/checkout@v2"
129+
# - name: "Setup environment"
130+
# uses: "networktocode/gh-action-setup-poetry-environment@v2"
131+
# - name: "Get image version"
132+
# run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
133+
# - name: "Set up Docker Buildx"
134+
# id: "buildx"
135+
# uses: "docker/setup-buildx-action@v1"
136+
# - name: "Load the image from cache"
137+
# uses: "docker/build-push-action@v2"
138+
# with:
139+
# builder: "${{ steps.buildx.outputs.name }}"
140+
# context: "./"
141+
# push: false
142+
# load: true
143+
# tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
144+
# file: "./Dockerfile"
145+
# cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
146+
# cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
147+
# build-args: |
148+
# PYTHON_VER=${{ env.PYTHON_VER }}
149+
# - name: "Debug: Show docker images"
150+
# run: "docker image ls"
151+
# - name: "Linting: Pylint"
152+
# run: "poetry run invoke pylint"
153+
# needs:
154+
# - "build"
155+
pytest:
156+
strategy:
157+
fail-fast: true
158+
matrix:
159+
python-version: ["3.7", "3.8", "3.9", "3.10"]
160+
runs-on: "ubuntu-20.04"
161+
env:
162+
PYTHON_VER: "${{ matrix.python-version }}"
163+
steps:
164+
- name: "Check out repository code"
165+
uses: "actions/checkout@v2"
166+
- name: "Setup environment"
167+
uses: "networktocode/gh-action-setup-poetry-environment@v2"
168+
- name: "Get image version"
169+
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
170+
- name: "Set up Docker Buildx"
171+
id: "buildx"
172+
uses: "docker/setup-buildx-action@v1"
173+
- name: "Load the image from cache"
174+
uses: "docker/build-push-action@v2"
175+
with:
176+
builder: "${{ steps.buildx.outputs.name }}"
177+
context: "./"
178+
push: false
179+
load: true
180+
tags: "${{ env.IMAGE_NAME }}:${{ env.IMAGE_VER }}"
181+
file: "./Dockerfile"
182+
cache-from: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
183+
cache-to: "type=gha,scope=${{ env.IMAGE_NAME }}-${{ env.IMAGE_VER }}-py${{ matrix.python-version }}"
184+
build-args: |
185+
PYTHON_VER=${{ env.PYTHON_VER }}
186+
- name: "Debug: Show docker images"
187+
run: "docker image ls"
188+
- name: "Run Tests"
189+
run: "poetry run invoke pytest"
190+
needs:
191+
# Remove everything but pylint once pylint is passing.
192+
# - "pylint"
193+
- "bandit"
194+
- "pydocstyle"
195+
- "flake8"
196+
- "yamllint"
197+
publish_gh:
198+
name: "Publish to GitHub"
199+
runs-on: "ubuntu-20.04"
200+
if: "startsWith(github.ref, 'refs/tags/v')"
201+
steps:
202+
- name: "Check out repository code"
203+
uses: "actions/checkout@v2"
204+
- name: "Set up Python"
205+
uses: "actions/setup-python@v2"
206+
with:
207+
python-version: "3.9"
208+
- name: "Install Python Packages"
209+
run: "pip install poetry"
210+
- name: "Set env"
211+
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
212+
- name: "Run Poetry Version"
213+
run: "poetry version $RELEASE_VERSION"
214+
- name: "Run Poetry Build"
215+
run: "poetry build"
216+
- name: "Upload binaries to release"
217+
uses: "svenstaro/upload-release-action@v2"
218+
with:
219+
repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}"
220+
file: "dist/*"
221+
tag: "${{ github.ref }}"
222+
overwrite: true
223+
file_glob: true
224+
needs:
225+
- "pytest"
226+
publish_pypi:
227+
name: "Push Package to PyPI"
228+
runs-on: "ubuntu-20.04"
229+
if: "startsWith(github.ref, 'refs/tags/v')"
230+
steps:
231+
- name: "Check out repository code"
232+
uses: "actions/checkout@v2"
233+
- name: "Set up Python"
234+
uses: "actions/setup-python@v2"
235+
with:
236+
python-version: "3.9"
237+
- name: "Install Python Packages"
238+
run: "pip install poetry"
239+
- name: "Set env"
240+
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
241+
- name: "Run Poetry Version"
242+
run: "poetry version $RELEASE_VERSION"
243+
- name: "Run Poetry Build"
244+
run: "poetry build"
245+
- name: "Push to PyPI"
246+
uses: "pypa/gh-action-pypi-publish@release/v1"
247+
with:
248+
user: "__token__"
249+
password: "${{ secrets.PYPI_API_TOKEN }}"
250+
needs:
251+
- "pytest"

0 commit comments

Comments
 (0)