Skip to content

Commit

Permalink
Create Pipfile and GH Actions workflow to run Makefile
Browse files Browse the repository at this point in the history
* Add Pipfile of dependencies and a custom shortcut
* Add Makefile of test and lint commands
* Add GH Actions workflow to run Makefile
* Add setup.cfg to prevent conflict black with flake8 and isort
* Add dummy test to prevent CI error, will delete once real tests are added
  • Loading branch information
ehanson8 committed Jul 29, 2021
1 parent 1d1c831 commit caccf7e
Show file tree
Hide file tree
Showing 7 changed files with 755 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests
on: push
jobs:
test:
name: Run tests
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64
- name: Install
run: |
python -m pip install --upgrade pip pipenv
pipenv install --dev
- name: Tests
run: make coveralls
linting:
name: Run linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64
- name: Install
run: |
python -m pip install --upgrade pip pipenv
pipenv install --dev
- name: Linting
run: make lint
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@ dmypy.json

# Pyre type checker
.pyre/

*.csv
*.pdf
*.xlsx
.DS_Store
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
lint: bandit black flake8 isort

bandit:
pipenv run bandit -r awd

black:
pipenv run black --check --diff .

coveralls: test
pipenv run coveralls

flake8:
pipenv run flake8 .

isort:
pipenv run isort . --diff

test:
pipenv run pytest --cov=awd
26 changes: 26 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pandas = "*"
openpyxl = "*"
click = "*"
coveralls = "*"

[dev-packages]
black = "==21.7b0"
isort = "*"
flake8 = "*"
pylama = "*"
bandit = "*"
pytest = "*"
requests-mock = "*"
pytest-cov = "*"

[requires]
python_version = "3.9"

[scripts]
awd = "python -c \"from awd.cli import cli; cli()\""
659 changes: 659 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 90
extend-ignore = E203

[isort]
profile = black
3 changes: 3 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_dummy():
"""Dummy test to avoid CI error, will be deleted after real tests are added"""
assert True

0 comments on commit caccf7e

Please sign in to comment.