Skip to content

Commit

Permalink
Merge 99d1a37 into 4b7888e
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonnnj committed Apr 6, 2021
2 parents 4b7888e + 99d1a37 commit 8013317
Show file tree
Hide file tree
Showing 21 changed files with 574 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ tests:
# - B102

skips:
- B101 # skip "assert used" check since assertions are required in pytests
- B101 # skip "assert used" check since assertions are required in pytests
13 changes: 8 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these owners will be requested for review when someone
# opens a pull request.
* @dav3r @felddy @jsf9k @mcdonnnj @cisagov/team-ois
# These owners will be the default owners for everything in the
# repo. Unless a later match takes precedence, these owners will be
# requested for review when someone opens a pull request.
* @dav3r @felddy @hillaryj @jsf9k @mcdonnnj

# These folks own any files in the .github directory at the root of
# the repository and any of its subdirectories.
/.github/ @dav3r @felddy @hillaryj @jsf9k @mcdonnnj
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
6 changes: 6 additions & 0 deletions .github/lineage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
version: "1"

lineage:
skeleton:
remote-url: https://github.com/cisagov/skeleton-python-library.git
100 changes: 57 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: build

on: [
push,
pull_request
]
on:
push:
pull_request:
repository_dispatch:
types: [apb]

env:
PIP_CACHE_DIR: ~/.cache/pip
Expand All @@ -14,51 +15,59 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache pip test requirements
uses: actions/cache@v1
with:
path: ${{ env.PIP_CACHE_DIR }}
key: "${{ runner.os }}-pip-test-\
${{ hashFiles('**/requirements-test.txt') }}"
restore-keys: |
${{ runner.os }}-pip-test-
${{ runner.os }}-pip-
- name: Cache pre-commit hooks
uses: actions/cache@v1
python-version: 3.9
- uses: actions/cache@v2
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-"
with:
path: ${{ env.PRE_COMMIT_CACHE_DIR }}
key: "${{ runner.os }}-pre-commit-\
path: |
${{ env.PIP_CACHE_DIR }}
${{ env.PRE_COMMIT_CACHE_DIR }}
key: "${{ env.BASE_CACHE_KEY }}\
${{ hashFiles('**/requirements-test.txt') }}-\
${{ hashFiles('**/requirements.txt') }}-\
${{ hashFiles('**/.pre-commit-config.yaml') }}"
restore-keys: |
${{ env.BASE_CACHE_KEY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -r requirements-test.txt
- name: Run linters on all files
pip install --upgrade --requirement requirements-test.txt
- name: Set up pre-commit hook environments
run: pre-commit install-hooks
- name: Run pre-commit on all files
run: pre-commit run --all-files
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache pip test requirements
uses: actions/cache@v1
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-"
with:
path: ${{ env.PIP_CACHE_DIR }}
key: "${{ runner.os }}-pip-test-\
${{ hashFiles('**/requirements-test.txt') }}"
key: "${{ env.BASE_CACHE_KEY }}\
${{ hashFiles('**/requirements-test.txt') }}-\
${{ hashFiles('**/requirements.txt') }}"
restore-keys: |
${{ runner.os }}-pip-test-
${{ runner.os }}-pip-
${{ env.BASE_CACHE_KEY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade -r requirements-test.txt
pip install --upgrade --requirement requirements-test.txt
- name: Run tests
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
Expand All @@ -71,28 +80,33 @@ jobs:
build:
runs-on: ubuntu-latest
needs: [lint, test]
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v2
- id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache pip build requirements
uses: actions/cache@v1
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-"
with:
path: ${{ env.PIP_CACHE_DIR }}
key: "${{ runner.os }}-pip-build-\
key: "${{ env.BASE_CACHE_KEY }}\
${{ hashFiles('**/requirements.txt') }}"
restore-keys: |
${{ runner.os }}-pip-build-
${{ runner.os }}-pip-
${{ env.BASE_CACHE_KEY }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
pip install --upgrade --requirement requirements.txt
- name: Build artifacts
run: python3 setup.py sdist bdist_wheel
- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: dist
name: dist-${{ matrix.python-version }}
path: dist
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
# Push on all branches
# branches: [develop]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]
schedule:
- cron: '0 14 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript',
# 'python']
language: ['python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a
# config file. By default, queries listed here will override any
# specified in a config file. Prefix the list here with "+" to use
# these queries and those in the config file. queries:
# ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or
# Java). If this step fails, then you should remove it and run the build
# manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

# - run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.egg-info
__pycache__
.python-version
.coverage
.mypy_cache
.pytest_cache
.python-version
*.egg-info
6 changes: 2 additions & 4 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ import_heading_stdlib=Standard Python Libraries
import_heading_thirdparty=Third-Party Libraries
import_heading_firstparty=cisagov Libraries

# Should be auto-populated by seed-isort-config hook
known_third_party=docopt,netaddr,pytest,requests,schema,setuptools,tqdm
# These must be manually set to correctly separate them from third party libraries
known_first_party=vpnconf
# Run isort under the black profile to align with our other Python linting
profile=black
3 changes: 3 additions & 0 deletions .mdl_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"code_blocks": false,
"tables": false
},
"MD024": {
"allow_different_nesting": true
},
"default": true
}

0 comments on commit 8013317

Please sign in to comment.