Skip to content

Commit

Permalink
Small updates to build and docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Oct 25, 2024
1 parent 3bf0c43 commit 2b91f45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ If you would like to contribute to the code, the process is pretty simple:
1. Familiarise yourself with this package and its dependencies.
2. Fork `the repository on GitHub <https://github.com/alexdlaird/hookee>`_ and start implementing changes.
3. Write a test that plainly validates the changes made.
4. Build and test locally with ``make local test``
5. Submit a `pull requests <https://help.github.com/en/articles/creating-a-pull-request-from-a-fork>`_ to get the changes merged.
4. Build and test locally with ``make local`` and ``make test``
5. Ensure no linting errors were introduced by running ``make check``
6. Submit a `pull requests <https://help.github.com/en/articles/creating-a-pull-request-from-a-fork>`_ to get the changes merged.

Also be sure to review the `Code of Conduct <https://github.com/alexdlaird/hookee/blob/main/CODE_OF_CONDUCT.md>`_ before
submitting issues or pull requests.
Expand Down
31 changes: 15 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
.PHONY: all virtualenv install nopyc clean test docs check local validate-release upload
.PHONY: all install nopyc clean test docs check local validate-release upload

SHELL := /usr/bin/env bash
PYTHON_BIN ?= python
PROJECT_VENV ?= venv

all: virtualenv install
all: local check test

virtualenv:
@if [ ! -d "venv" ]; then \
$(PYTHON_BIN) -m pip install virtualenv --user; \
$(PYTHON_BIN) -m virtualenv venv; \
fi
venv:
$(PYTHON_BIN) -m pip install virtualenv --user
$(PYTHON_BIN) -m virtualenv $(PROJECT_VENV)

install: virtualenv
install: venv
@( \
source venv/bin/activate; \
source $(PROJECT_VENV)/bin/activate; \
python -m pip install .; \
)

Expand All @@ -22,25 +21,25 @@ nopyc:
find . -name __pycache__ | xargs rm -rf || true

clean: nopyc
rm -rf build dist *.egg-info venv
rm -rf build dist *.egg-info $(PROJECT_VENV)

test: virtualenv
test: install
@( \
source venv/bin/activate; \
source $(PROJECT_VENV)/bin/activate; \
python -m pip install ".[dev]"; \
coverage run -m unittest discover -v -b && coverage report && coverage xml && coverage html; \
)

docs: virtualenv
docs: install
@( \
source venv/bin/activate; \
source $(PROJECT_VENV)/bin/activate; \
python -m pip install ".[docs]"; \
sphinx-build -M html docs build/docs; \
)

check: virtualenv
check: install
@( \
source venv/bin/activate; \
source $(PROJECT_VENV)/bin/activate; \
python -m pip install ".[dev,docs]"; \
flake8; \
)
Expand Down

0 comments on commit 2b91f45

Please sign in to comment.