forked from ploomber/jupysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (47 loc) · 1.31 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
SHELL := /bin/bash
VENV := venv
ACTIVATE_VENV := source $(VENV)/bin/activate
PACKAGE := jupysql
VERSION := $(shell bin/print-version)
.PHONY: all
all: clean launch
# Virtual Environments
.make.install:
rm -rf $(VENV) .make.install*
python3 -m venv $(VENV)
$(ACTIVATE_VENV) && pip install build 'jupyterlab>=4.0.0,<5'
$(ACTIVATE_VENV) && pip install -e .
touch $@
.make.install.dev:
rm -rf $(VENV) .make.install*
python3 -m venv $(VENV)
$(ACTIVATE_VENV) && pip install -e .[DEV]
touch $@
# Development
.PHONY: wheel
wheel: dist/$(PACKAGE)-$(VERSION)-py3-none-any.whl
dist/$(PACKAGE)-$(VERSION)-py3-none-any.whl dist/$(PACKAGE)-$(VERSION).tar.gz: .make.install
$(ACTIVATE_VENV) && python3 -m build
mv dist/$(PACKAGE)-*-py3-none-any.whl dist/$(PACKAGE)-$(VERSION)-py3-none-any.whl
mv dist/$(PACKAGE)-*.tar.gz dist/$(PACKAGE)-$(VERSION).tar.gz
.PHONY: launch
launch: .make.install
$(ACTIVATE_VENV) && jupyter-lab
# Testing
.PHONY: tests
tests: test-lint test-unit
.PHONY: test-unit
test-unit: .make.install.dev
$(ACTIVATE_VENV) && pytest --ignore=src/tests/integration
.PHONY: test-lint
test-lint: .make.install.dev
$(ACTIVATE_VENV) && pkgmt lint src/
# Cleaning
.PHONY: clean
clean: clean-venv clean-build
.PHONY: clean-venv
clean-venv:
rm -rf $(VENV) .make.install*
.PHONY: clean-build
clean-build:
rm -rf dist/