Compare commits
No commits in common. "61efcfa697b62735ea8affef205e85209761e7d9" and "2dde3cfe05c51d5ab0e67d468e5422f501330243" have entirely different histories.
61efcfa697
...
2dde3cfe05
7
.flake8
7
.flake8
|
|
@ -1,7 +0,0 @@
|
||||||
# vim: ft=cfg
|
|
||||||
[flake8]
|
|
||||||
max-complexity = 7
|
|
||||||
docstring-convention=google
|
|
||||||
inline-quotes = double
|
|
||||||
# Required to be compatible with black
|
|
||||||
extend-ignore = E203,W503
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
matrix:
|
|
||||||
PYTHON_VERSION:
|
|
||||||
- 3.8
|
|
||||||
- 3.9
|
|
||||||
|
|
||||||
pipeline:
|
|
||||||
test:
|
|
||||||
# Alpine version doesn't have make
|
|
||||||
image: python:${PYTHON_VERSION}
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- make test
|
|
||||||
|
|
||||||
lint:
|
|
||||||
image: python:${PYTHON_VERSION}
|
|
||||||
commands:
|
|
||||||
- make lint
|
|
||||||
49
Makefile
49
Makefile
|
|
@ -1,54 +1,41 @@
|
||||||
# =====CONFIG=====
|
# =====CONFIG=====
|
||||||
PYTHON := python3.9
|
PYTHON := python3.9
|
||||||
# This can't contain spaces (I think)
|
# This can't contain spaces (I think)
|
||||||
VENV := .venv
|
VENV := venv
|
||||||
# Minimum % coverage for tests to succeed
|
|
||||||
MIN_COV := 10
|
|
||||||
|
|
||||||
|
|
||||||
# By default, just create the venv when needed
|
# By default, just create the venv when needed
|
||||||
all: venv
|
all: venv
|
||||||
|
|
||||||
|
|
||||||
# =====RECIPES=====
|
# Create the venv
|
||||||
## VENV
|
$(VENV)/bin/activate: requirements.txt requirements-dev.txt
|
||||||
### Create the venv
|
|
||||||
$(VENV)/bin/activate: setup.py setup.cfg
|
|
||||||
@ '$(PYTHON)' -m venv '$(VENV)'
|
@ '$(PYTHON)' -m venv '$(VENV)'
|
||||||
@ '$(VENV)'/bin/pip install -e .[develop]
|
@ '$(VENV)'/bin/pip install -r requirements.txt -r requirements-dev.txt
|
||||||
|
|
||||||
|
# Convenient alias for the venv
|
||||||
### Convenient alias for the venv
|
|
||||||
venv: $(VENV)/bin/activate
|
venv: $(VENV)/bin/activate
|
||||||
.PHONY: venv
|
.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
|
|
||||||
|
|
||||||
|
|
||||||
## Cleaning
|
|
||||||
# Remove the venv
|
# Remove the venv
|
||||||
clean:
|
clean:
|
||||||
@ rm -rf '$(VENV)'
|
@ rm -rf '$(VENV)'
|
||||||
.PHONY: clean
|
|
||||||
|
|
||||||
|
|
||||||
# Run the Flask server
|
# Run the Flask server
|
||||||
# TODO
|
# TODO
|
||||||
run: venv
|
run: venv
|
||||||
|
|
||||||
|
|
||||||
|
# Format the codebase using black
|
||||||
|
format: venv
|
||||||
|
@ '$(VENV)/bin/python' -m black src
|
||||||
|
|
||||||
|
# Lint the codebase using flake8
|
||||||
|
lint: venv
|
||||||
|
@ '$(VENV)/bin/python' -m flake8 src
|
||||||
|
|
||||||
|
# Run rests using pytest
|
||||||
|
# TODO
|
||||||
|
test: venv
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[tool.black]
|
|
||||||
line-length = 79
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Formatter
|
||||||
|
black~=20.8b1
|
||||||
|
|
||||||
|
# Linter
|
||||||
|
flake8~=3.9.0
|
||||||
|
|
||||||
|
# Testing suite
|
||||||
|
pytest~=6.2.2
|
||||||
|
|
||||||
|
# Language server
|
||||||
|
jedi~=0.18.0
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Web framework
|
||||||
|
Flask~=1.1.2
|
||||||
25
setup.cfg
25
setup.cfg
|
|
@ -1,25 +0,0 @@
|
||||||
[options]
|
|
||||||
install_requires =
|
|
||||||
flask==2.0.0
|
|
||||||
|
|
||||||
[options.extras_require]
|
|
||||||
# Used inside Tox for running tests
|
|
||||||
test =
|
|
||||||
pytest==6.2.3
|
|
||||||
pytest-cov==2.11.1
|
|
||||||
|
|
||||||
# Used inside tox for linting
|
|
||||||
lint =
|
|
||||||
black==20.8b1
|
|
||||||
flake8==3.9.1
|
|
||||||
flake8-bugbear==21.4.3
|
|
||||||
flake8-comprehensions==3.4.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
|
|
||||||
12
setup.py
12
setup.py
|
|
@ -1,12 +0,0 @@
|
||||||
"""Setup file for installing the application."""
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="jos",
|
|
||||||
version="0.1.0",
|
|
||||||
author="Jef Roosens",
|
|
||||||
description="Simplify downloading music.",
|
|
||||||
# TODO add license
|
|
||||||
packages=["app", "tests"],
|
|
||||||
)
|
|
||||||
Reference in New Issue