Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

VENV_NAME ?= venv
VENV_ACTIVATE = . $(VENV_NAME)/bin/activate
PYTHON = ${VENV_NAME}/bin/python3

.DEFAULT_GOAL := help

.PHONY: help
help:
@echo "Targets:"
@echo " requirements Compiles requirements.in into requirements.txt"
@echo " venv Creates a virtual environment and install dependencies"
@echo " test Run pytest on the tests/ directory"
@echo " lint Check code with flake8 and black"
@echo " format Format code with black"

.PHONY: requirements
requirements: ## Compiles requirements.in into requirements.txt
$(VENV_ACTIVATE); pip install pip-tools
$(VENV_ACTIVATE); pip-compile requirements.in

.PHONY: venv
venv: $(VENV_NAME)/bin/activate ## Creates a virtual environment and install dependencies
$(VENV_NAME)/bin/activate: requirements.txt
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
$(VENV_ACTIVATE); pip install -U pip setuptools
$(VENV_ACTIVATE); pip install -r requirements.txt
touch $(VENV_NAME)/bin/activate

.PHONY: test
test: venv ## Run pytest on the tests/ directory
$(VENV_ACTIVATE); pytest tests/

.PHONY: lint
lint: venv ## Check code with flake8 and black
$(VENV_ACTIVATE); flake8 src/
$(VENV_ACTIVATE); black --check src/

.PHONY: format
format: venv ## Format code with black
$(VENV_ACTIVATE); black src/
3 changes: 2 additions & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ black
pip-tools
pre-commit
flake8
pytest-mock
pytest-mock
coverage
39 changes: 6 additions & 33 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements-dev.in
#
astroid==2.11.5
# via pylint
attrs==21.4.0
# via pytest
autopep8==1.6.0
# via -r requirements-dev.in
black==22.3.0
# via -r requirements-dev.in
certifi==2021.10.8
# via requests
cfgv==3.3.1
# via pre-commit
charset-normalizer==2.0.12
# via requests
click==8.1.3
# via
# black
# pip-tools
coverage==7.2.7
# via -r requirements-dev.in
dill==0.3.4
# via pylint
distlib==0.3.4
Expand All @@ -32,8 +28,6 @@ flake8==4.0.1
# via -r requirements-dev.in
identify==2.5.0
# via pre-commit
idna==3.3
# via requests
iniconfig==1.1.1
# via pytest
isort==5.10.1
Expand All @@ -54,8 +48,6 @@ pathspec==0.9.0
# via black
pep517==0.12.0
# via pip-tools
pep8==1.7.1
# via -r requirements-dev.in
pip-tools==6.6.0
# via -r requirements-dev.in
platformdirs==2.5.2
Expand All @@ -70,9 +62,7 @@ pre-commit==2.19.0
py==1.11.0
# via pytest
pycodestyle==2.8.0
# via
# autopep8
# flake8
# via flake8
pyflakes==2.4.0
# via flake8
pylint==2.13.8
Expand All @@ -87,31 +77,14 @@ pytest-mock==3.7.0
# via -r requirements-dev.in
pyyaml==6.0
# via pre-commit
requests==2.27.1
# via responses
responses==0.20.0
# via -r requirements-dev.in
six==1.16.0
# via virtualenv
toml==0.10.2
# via
# autopep8
# pre-commit
# via pre-commit
tomli==2.0.1
# via
# black
# pep517
# pylint
# pytest
typing-extensions==4.2.0
# via
# astroid
# black
# pylint
urllib3==1.26.9
# via
# requests
# responses
virtualenv==20.14.1
# via pre-commit
wheel==0.37.1
Expand Down
2 changes: 2 additions & 0 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_placeholder(): # remove this once we have real tests
pass