Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Create initial project layout
Browse files Browse the repository at this point in the history
This adds a bunch of boilerplate project layout. The included Makefile
can be used for most local development tasks. The project has been set
up to use Python 3.8. Several development libraries have been installed:
pytest, mypy, black and flake8. Github Actions and Coveralls have also
been set up.
  • Loading branch information
Mike Graves committed May 29, 2020
1 parent 5afb978 commit 0f10605
Show file tree
Hide file tree
Showing 9 changed files with 597 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,23 @@
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.8'
architecture: x64
- name: Install
run: |
python -m pip install --upgrade pip pipenv
make install
- name: Run tests
run: make coveralls
- name: Run checks
run: make check
138 changes: 138 additions & 0 deletions .gitignore
@@ -0,0 +1,138 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
35 changes: 35 additions & 0 deletions Makefile
@@ -0,0 +1,35 @@
.PHONY: install update test tests mypy flake8 black safety check coveralls
SHELL=/bin/bash

help: ## Print this message
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

install: ## Install all Python dependencies
pipenv install --dev

update: install ## Update all Python dependencies
pipenv clean
pipenv update --dev

test: ## Run tests
pipenv run pytest --cov=hoard

tests: test

mypy:
pipenv run mypy hoard

flake8:
pipenv run flake8 hoard tests

black:
pipenv run black -q --check hoard tests

safety:
pipenv check

check: mypy flake8 black safety ## Run mypy, flake8, black, safety

coveralls: test
pipenv run coveralls
18 changes: 18 additions & 0 deletions Pipfile
@@ -0,0 +1,18 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
mypy = "*"
black = "==19.10b0"
pytest-cov = "*"
coveralls = "*"
flake8 = "*"

[packages]
click = "*"

[requires]
python_version = "3.8"

0 comments on commit 0f10605

Please sign in to comment.