Compare commits

..

No commits in common. "61efcfa697b62735ea8affef205e85209761e7d9" and "2dde3cfe05c51d5ab0e67d468e5422f501330243" have entirely different histories.

11 changed files with 31 additions and 94 deletions

View File

@ -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

View File

@ -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

View File

@ -1,54 +1,41 @@
# =====CONFIG=====
PYTHON := python3.9
# This can't contain spaces (I think)
VENV := .venv
# Minimum % coverage for tests to succeed
MIN_COV := 10
VENV := venv
# By default, just create the venv when needed
all: venv
# =====RECIPES=====
## VENV
### Create the venv
$(VENV)/bin/activate: setup.py setup.cfg
# Create the venv
$(VENV)/bin/activate: requirements.txt requirements-dev.txt
@ '$(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
.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
clean:
@ rm -rf '$(VENV)'
.PHONY: clean
# Run the Flask server
# TODO
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

View File

View File

View File

@ -1,2 +0,0 @@
[tool.black]
line-length = 79

View File

@ -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

2
requirements.txt 100644
View File

@ -0,0 +1,2 @@
# Web framework
Flask~=1.1.2

View File

@ -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

View File

@ -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"],
)

View File