Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2fa4cbe
Make workflow run when a PR is opened, synchronized, or reopened
jsf9k Jan 24, 2020
dbd589d
Improve list formatting
jsf9k Jan 24, 2020
a8e35d0
Merge pull request #29 from cisagov/improvement/better-handle-prs-fro…
jsf9k Jan 27, 2020
5327516
Backported changes to CONTRIBUTING.md from the development guide.
mcdonnnj Feb 10, 2020
3f6d654
Merge pull request #31 from cisagov/improvements/add_wsl_instructions
mcdonnnj Feb 10, 2020
f7a4166
Update Python version used to 3.8
mcdonnnj Feb 11, 2020
8116a89
Merge pull request #32 from cisagov/improvements/update_python_versio…
mcdonnnj Feb 11, 2020
b857939
Run pre-commit autoupdate.
mcdonnnj Feb 12, 2020
d99fd00
Flip cache order to mirror how it is done downstream.
mcdonnnj Feb 12, 2020
16872bf
Merge pull request #33 from cisagov/improvement/update_pre-commit_hooks
mcdonnnj Feb 12, 2020
965c3d9
Merge branch 'develop' of github.com:cisagov/skeleton-generic into im…
mcdonnnj Feb 12, 2020
fd03337
Fix spacing before comment in .bandit.yml (shown with pre-commit run …
mcdonnnj Feb 12, 2020
49f7002
Unpin coverage as coveralls supports coverage 5.0+ as of 1.10.0
mcdonnnj Feb 12, 2020
96675a1
Add --verbose flag to the coveralls call in the test workflow.
mcdonnnj Feb 12, 2020
df8a7eb
Pin coveralls version to see if the service_number addition in 1.11.0…
mcdonnnj Feb 12, 2020
8785abe
Remove --verbose from coveralls call in test workflow.
mcdonnnj Feb 12, 2020
6a7210c
Pin to testing branch per https://github.com/coveralls-clients/covera…
mcdonnnj Feb 14, 2020
d59f5f9
Change coveralls pin to avoid the version with the regression. 1.11.1…
mcdonnnj Feb 16, 2020
e96577b
All references to '-r' for pip calls have been replaced with the more…
mcdonnnj Feb 18, 2020
a17986b
Merge pull request #34 from cisagov/improvements/use_verbose_pip_swit…
mcdonnnj Feb 19, 2020
23425da
Merge branch 'develop' of github.com:cisagov/skeleton-generic into im…
mcdonnnj Feb 19, 2020
0478f94
Adjust language in description of pre-commit step in the GitHub Actio…
mcdonnnj Feb 19, 2020
a06c5ec
Merge pull request #36 from cisagov/improvements/pull_in_upstream_upd…
mcdonnnj Feb 19, 2020
e2972d0
Merge branch 'develop' of github.com:cisagov/skeleton-python-library …
mcdonnnj Feb 19, 2020
5019d01
Update artifact generation in line with work done in the findings-dat…
mcdonnnj Feb 19, 2020
e7cefd2
Update filename to unzip during build action.
mcdonnnj Feb 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
29 changes: 18 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
Expand All @@ -36,13 +36,13 @@ jobs:
- 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: Run pre-commit on all files
run: pre-commit run --all-files
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
Expand All @@ -58,7 +58,7 @@ jobs:
- 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 @@ -72,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
Expand All @@ -88,11 +88,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
- name: Build artifacts
run: python3 setup.py sdist bdist_wheel
pip install --upgrade --requirement requirements.txt
- name: Build environment
run: docker-compose build
- name: Generate lambda zip
run: docker-compose up
# We have to unzip the produced lambda zip because the upload-artifact
# action will compress whatever is at/in the provided path. This results
# in a zipped zip file.
- name: Unzip produced zip
run: unzip skeleton-aws-lambda.zip -d lambda_zip_contents
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
name: skeleton-aws-lambda
path: lambda_zip_contents/
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v2.5.0
hooks:
- id: check-executables-have-shebangs
- id: check-json
Expand All @@ -27,13 +27,13 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.19.0
rev: v0.22.0
hooks:
- id: markdownlint
args:
- --config=.mdl_config.json
- repo: https://github.com/adrienverge/yamllint
rev: v1.18.0
rev: v1.20.0
hooks:
- id: yamllint
- repo: https://github.com/detailyang/pre-commit-shell
Expand All @@ -47,7 +47,7 @@ repos:
additional_dependencies:
- flake8-docstrings
- repo: https://github.com/asottile/pyupgrade
rev: v1.25.1
rev: v1.26.2
hooks:
- id: pyupgrade
# Run bandit on "tests" tree with a configuration
Expand All @@ -71,7 +71,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
rev: v1.9.4
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
Expand All @@ -81,7 +81,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.1a5
rev: v4.2.0
hooks:
- id: ansible-lint
# files: molecule/default/playbook.yml
Expand All @@ -91,7 +91,7 @@ repos:
- id: terraform_fmt
- id: terraform_validate_no_variables
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v1.0.0
rev: v1.0.1
hooks:
- id: docker-compose-check
- repo: https://github.com/prettier/prettier
Expand Down
29 changes: 25 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,31 @@ eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```

For Linux (or on the Mac, if you don't want to use `brew`) you can use
For Linux, Windows Subsystem for Linux (WSL), or on the Mac (if you
don't want to use `brew`) you can use
[pyenv/pyenv-installer](https://github.com/pyenv/pyenv-installer) to
install the necessary tools. When you are finished you will need to
add the same two lines above to your profile.
install the necessary tools. Before running this ensure that you have
installed the prerequisites for your platform according to the
[`pyenv` wiki
page](https://github.com/pyenv/pyenv/wiki/common-build-problems).

On WSL you should treat your platform as whatever Linux distribution
you've chosen to install.

Once you have installed `pyenv` you will need to add the following
lines to your `.bashrc`:

```bash
export PATH="$PATH:$HOME/.pyenv/bin"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```

If you are using a shell other than `bash` you should follow the
instructions that the `pyenv-installer` script outputs.

You will need to reload your shell for these changes to take effect so
you can begin to use `pyenv`.

For a list of Python versions that are already installed and ready to
use with `pyenv`, use the command `pyenv versions`. To see a list of
Expand All @@ -81,7 +102,7 @@ commands:
cd skeleton-python-library
pyenv virtualenv <python_version_to_use> skeleton-python-library
pyenv local skeleton-python-library
pip install -r requirements-dev.txt
pip install --requirement requirements-dev.txt
```

#### Installing the pre-commit hook ####
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-r requirements-test.txt
--requirement requirements-test.txt
ipython
semver
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ def package_vars(version_file):
extras_require={
"test": [
"pre-commit",
"coveralls",
# coveralls does not currently support coverage 5.0
# https://github.com/coveralls-clients/coveralls-python/issues/203
# is the issue for this on the coveralls project
"coverage < 5.0",
# coveralls 1.11.0 added a service number for calls from
# GitHub Actions. This caused a regression which resulted in a 422
# response from the coveralls API with the message:
# Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
# 1.11.1 fixed this issue, but to ensure expected behavior we'll pin
# to never grab the regression version.
"coveralls != 1.11.0",
"coverage",
"pytest-cov",
"pytest",
]
Expand Down