Added project skeleton

pull/1/head
Jef Roosens 2021-05-22 18:24:59 +02:00
parent 65e7b506b3
commit 0d8f788c59
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
8 changed files with 116 additions and 1 deletions

29
.woodpecker.yml 100644
View 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

View File

@ -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 100644
View 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 100644
View File

3
pyproject.toml 100644
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

30
setup.cfg 100644
View 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 100644
View File

@ -0,0 +1,4 @@
import setuptools
setuptools.setup()

View File