generated from wayfair-incubator/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dda83e5
commit 7ce4f4a
Showing
33 changed files
with
1,170 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[bandit] | ||
exclude: *venv*,*env*,*scratch* | ||
skips: B101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.github/ | ||
.git/ | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
max-complexity = 8 | ||
ignore = W503,E501 | ||
builtins = unicode | ||
tee = True | ||
exclude = venv,env,.venv,scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: Custom issue template | ||
about: Describe this issue template's purpose here. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set -euo pipefail | ||
|
||
echo "Ensuring pip is up to date" | ||
python -m pip install --upgrade pip | ||
|
||
if [[ "${INSTALL_REQUIREMENTS}" == "true" ]]; then | ||
echo "Installing code requirements" | ||
pip install -r requirements.txt | ||
fi | ||
|
||
if [[ "${INSTALL_TEST_REQUIREMENTS}" == "true" ]]; then | ||
echo "Installing test requirements" | ||
pip install -r requirements-test.txt | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "Install Dependencies" | ||
description: "Install Python dependencies" | ||
inputs: | ||
requirements: | ||
description: "Should requirements.lock be installed" | ||
default: "false" | ||
required: false | ||
test-requirements: | ||
description: "Should requirements-test.txt be installed" | ||
default: "false" | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Install Python dependencies" | ||
run: "$GITHUB_ACTION_PATH/action.sh" | ||
shell: "bash" | ||
env: | ||
INSTALL_REQUIREMENTS: ${{ inputs.requirements }} | ||
INSTALL_TEST_REQUIREMENTS: ${{ inputs.test-requirements }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "docker" | ||
directory: "/docker" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Summary | ||
|
||
*`TODO:` What does this PR do? (Replace with summary!)* | ||
|
||
## Other Information | ||
|
||
`TODO` (if relevant) | ||
|
||
## PR Checklist | ||
|
||
Please run through before submitting for final review: | ||
|
||
- [ ] The PR title is descriptive of what changed. | ||
- [ ] The description sections above are filled out. | ||
- [ ] The CI pipeline is passing | ||
- [ ] Added the `ready-for-review` label to the PR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: "Lint" | ||
on: | ||
pull_request: {} | ||
push: | ||
branches: ["main"] | ||
|
||
env: | ||
PYTHON_VERSION: "3.10.1" | ||
|
||
jobs: | ||
shfmt: | ||
name: Bash shfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- run: docker-compose run --rm shfmt | ||
|
||
lint: | ||
name: Lint bash and markdown | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- run: docker-compose run --rm lint | ||
|
||
bandit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run bandit | ||
run: bandit --ini .bandit -r plugin_scripts tests | ||
|
||
black: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run black | ||
run: black --check plugin_scripts tests | ||
|
||
flake8: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run flake8 | ||
run: flake8 plugin_scripts tests | ||
|
||
isort: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run isort | ||
run: isort --profile black --atomic --check-only plugin_scripts tests | ||
|
||
mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run mypy | ||
run: mypy plugin_scripts tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Unit Tests" | ||
on: | ||
pull_request: {} | ||
push: | ||
branches: ["main"] | ||
|
||
env: | ||
PYTHON_VERSION: "3.10.1" | ||
|
||
jobs: | ||
test: | ||
name: Pytest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
requirements: "true" | ||
test-requirements: "true" | ||
|
||
- name: Run pytest | ||
run: pytest --cov plugin_scripts/ tests --cov-report xml:coverage-${{ env.PYTHON_VERSION }}.xml --junitxml=test-results-${{ env.PYTHON_VERSION }}.xml | ||
|
||
- name: Upload pytest test results artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-results-${{ env.PYTHON_VERSION }} | ||
path: test-results-${{ env.PYTHON_VERSION }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
|
||
- name: Upload coverage results artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-coverage-${{ env.PYTHON_VERSION }} | ||
path: coverage-${{ env.PYTHON_VERSION }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
|
||
- name: Publish coverage results to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: coverage-${{ env.PYTHON_VERSION }}.xml | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# OS junk files | ||
[Tt]humbs.db | ||
*.DS_Store | ||
|
||
# Ignore vim & emacs temp files | ||
*.swp | ||
*.swo | ||
*~ | ||
\#*# | ||
|
||
# Files from testing | ||
.hypothesis | ||
.cache | ||
**/*.csv | ||
*.avro | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
*cov*html* | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Environments | ||
.venv | ||
env/ | ||
venv*/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
scp/ | ||
worker_venv/ | ||
|
||
# PyCharm | ||
.idea | ||
*.iml | ||
|
||
# Cache Directories | ||
.pytest_cache/ | ||
.mypy_cache/ | ||
|
||
# Do not version control these files please | ||
docker/files/secrets/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[settings] | ||
profile=black | ||
atomic=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [v0.1.0] - 2021-12-14 | ||
|
||
### Changed | ||
|
||
* Initial Release |
Oops, something went wrong.