diff --git a/.flake8 b/.flake8 deleted file mode 100644 index e64ee7d..0000000 --- a/.flake8 +++ /dev/null @@ -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 diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index dd78ca4..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -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 diff --git a/Makefile b/Makefile index 18e7628..da1e6ec 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/app/__init__.py b/app/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/__main__.py b/app/__main__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index a8f43fe..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tool.black] -line-length = 79 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..d4647f1 --- /dev/null +++ b/requirements-dev.txt @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dc4b804 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# Web framework +Flask~=1.1.2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4646fe8..0000000 --- a/setup.cfg +++ /dev/null @@ -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 diff --git a/setup.py b/setup.py deleted file mode 100644 index f70bbe5..0000000 --- a/setup.py +++ /dev/null @@ -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"], -) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000