Added project skeleton
This commit is contained in:
parent
65e7b506b3
commit
0d8f788c59
8 changed files with 116 additions and 1 deletions
29
.woodpecker.yml
Normal file
29
.woodpecker.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
pipeline:
|
||||
# =====TESTING=====
|
||||
test:
|
||||
# Alpine version doesn't have make
|
||||
image: python:3.9
|
||||
pull: true
|
||||
commands:
|
||||
- make test
|
||||
when:
|
||||
event: push
|
||||
|
||||
|
||||
# =====LINTING=====
|
||||
lint:
|
||||
image: python:3.9
|
||||
commands:
|
||||
- make lint
|
||||
when:
|
||||
event: push
|
||||
|
||||
|
||||
# =====PUBLISHING=====
|
||||
publish:
|
||||
image: python:3.9
|
||||
commands:
|
||||
- make publish
|
||||
when:
|
||||
event: tag
|
||||
branch: master
|
||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
Copyright (c) 2021 Jef Roosens
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
|
|
|||
49
Makefile
Normal file
49
Makefile
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# =====CONFIG=====
|
||||
PYTHON := python3
|
||||
# This can't contain spaces (I think)
|
||||
VENV := .venv
|
||||
# Minimum % coverage for tests to succeed
|
||||
MIN_COV := 50
|
||||
|
||||
|
||||
# =====GENERAL=====
|
||||
## By default, create the venv
|
||||
all: venv
|
||||
.PHONY: all
|
||||
|
||||
## Remove any temporary files
|
||||
clean:
|
||||
@ rm -rf '$(VENV)'
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
# =====BACKEND=====
|
||||
## VENV
|
||||
### Create the venv
|
||||
$(VENV)/bin/activate: setup.cfg
|
||||
@ '$(PYTHON)' -m venv '$(VENV)'
|
||||
@ '$(VENV)'/bin/pip install -e .[develop]
|
||||
|
||||
|
||||
### Convenient alias for the venv
|
||||
venv: $(VENV)/bin/activate
|
||||
.PHONY: venv
|
||||
|
||||
|
||||
## Formatting & linting
|
||||
### Format the codebase using black
|
||||
format: venv
|
||||
@ '$(VENV)'/bin/black setup.py app
|
||||
.PHONY: format
|
||||
|
||||
### Lint using black & flake8
|
||||
lint: venv
|
||||
@ '$(VENV)'/bin/flake8 setup.py app
|
||||
@ '$(VENV)'/bin/black --check setup.py app
|
||||
.PHONY: lint
|
||||
|
||||
|
||||
## Testing
|
||||
test: venv
|
||||
@ '$(VENV)'/bin/pytest --cov=app --cov-fail-under='$(MIN_COV)' tests/
|
||||
.PHONY: test
|
||||
0
app/__init__.py
Normal file
0
app/__init__.py
Normal file
3
pyproject.toml
Normal file
3
pyproject.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
30
setup.cfg
Normal file
30
setup.cfg
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[metadata]
|
||||
name = config-skeleton
|
||||
version = 0.0.1
|
||||
|
||||
[options]
|
||||
packages = app
|
||||
install_requires =
|
||||
|
||||
[options.extras_require]
|
||||
test =
|
||||
pytest==6.2.4
|
||||
pytest-cov==2.12.0
|
||||
# Worth testing out
|
||||
pytest-tldr==0.2.4
|
||||
|
||||
# Used inside tox for linting
|
||||
lint =
|
||||
black==20.8b1
|
||||
flake8==3.9.2
|
||||
flake8-bugbear==21.4.3
|
||||
flake8-comprehensions==3.5.0
|
||||
flake8-docstrings==1.6.0
|
||||
flake8-print==4.0.0
|
||||
flake8-quotes==3.2.0
|
||||
|
||||
# Required for the developer
|
||||
develop =
|
||||
%(test)s
|
||||
%(lint)s
|
||||
jedi==0.18.0
|
||||
4
setup.py
Normal file
4
setup.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import setuptools
|
||||
|
||||
|
||||
setuptools.setup()
|
||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
Reference in a new issue