-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
65 lines (52 loc) · 1.72 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
ORG ?= $(shell jq -r .org meta.json)
PRODUCT ?= $(shell jq -r .product meta.json)
VERSION ?= $(shell grep __version__ src/pymarshal/__init__.py | grep -oE "([0-9]+\.[0-9]+\.[0-9]+)")
DESTDIR ?=
PREFIX ?= /usr
DOCKER ?= podman
LINUX_APPLICATIONS_DIR ?= $(DESTDIR)/usr/share/applications
UI ?= qt
.PHONY: test venv
clean:
# Remove temporary build files
rm -rf build/ dist/ htmlcov/ ./*.egg-info ./*.nsi .pytest_cache/ \
./.build/ ./*. ./*.
find test/ src/ -name __pycache__ -type d \
-exec rm -rf {} \; 2>/dev/null \
|| true
git-hooks:
# Install git hooks for this repository to enable running tests before
# committing, etc...
cp -f tools/git-hooks/* .git/hooks/
pypi: test type-check
# Upload your package to PyPi so that anybody can install using pip.
# Requires `twine` to be installed, and a local twine config with your
# pypi username and password
rm -rf dist/*.tar.gz dist/*.whl
python3 -m build
twine upload dist/*
test:
# Run the unit tests
#tox -e $(shell python3 -c "import sys; v = sys.version_info; print(f'py{v[0]}{v[1]}')")
python3 -m pytest
test-all-docker:
# Test against all versions of Python supported by this code using Docker
tools/test-all-py-versions.sh $(DOCKER)
test-all-tox:
# Test against all versions of Python supported by this code using tox
# This only works if every supported version of Python is installed on
# this computer
tox
test-pdb:
# Debug unit tests that raise Exceptions with PDB
python3 -m pytest --pdb
type-check:
# Check typing of Python type hints
mypy --ignore-missing-imports \
src/pymarshal \
venv:
# Create a Python "virtual environment" aka venv
# Run this target before running:
# source venv/bin/activate
# pip3 install -e .
python3 -m venv venv