Files
pyscript/pyscriptjs/Makefile
Fabio Pliger b7d748c96a Moves Python code out of interpreter file (#207)
* make copy of .py files part of build process

* move code out ofinterpreter file and make it download and load code during initialization

* fix double ; in interpreter

* remove debugging print

* update dependencies

* fix project name and version

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change fmt-py

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove extra content

* define missing strict type

* create build folder if doesn't exist

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-05 23:12:54 -05:00

86 lines
1.8 KiB
Makefile

tag := latest
git_hash ?= $(shell git log -1 --pretty=format:%h)
base_dir ?= $(shell git rev-parse --show-toplevel)
src_dir ?= $(base_dir)/src
examples ?= $(base_dir)/examples
app_dir ?= $(shell git rev-parse --show-prefix)
CONDA_ENV ?= ./env
env := $(CONDA_ENV)
conda_run := conda run -p $(env)
.PHONY: setup
setup:
@if [ -z "$${CONDA_SHLVL:+x}" ]; then echo "Conda is not installed." && exit 1; fi
$(CONDA_EXE) env $(shell [ -d $(env) ] && echo update || echo create) -p $(env) --file environment.yml
.PHONY: clean
clean:
find . -name \*.py[cod] -delete
rm -rf .pytest_cache .coverage coverage.xml
clean-all: clean
rm -rf $(env) *.egg-info
.PHONY: shell
shell:
@export CONDA_ENV_PROMPT='<{name}>'
@echo 'conda activate $(env)'
.PHONY: dev
dev:
npm run dev
.PHONY: build
build:
npm run build
.PHONY: test
test:
@echo "Tests are coming :( this is a placeholder and it's meant to fail!"
$(conda_run) pytest -vv $(ARGS) tests/ --log-cli-level=warning
.PHONY: test-py
test-py:
@echo "Tests are coming :( this is a placeholder and it's meant to fail!"
$(conda_run) pytest -vv $(ARGS) tests/ --log-cli-level=warning
.PHONY: test-ts
test-ts:
@echo "Tests are coming :( this is a placeholder and it's meant to fail!"
npm run tests
.PHONY: fmt
fmt: fmt-py fmt-ts
@echo "Format completed"
.PHONY: fmt-check
fmt-check: fmt-ts-check fmt-py-check
@echo "Format check completed"
.PHONY: fmt-ts
fmt-ts:
npm run format
.PHONY: fmt-ts-check
fmt-ts-check:
npm run format:check
.PHONY: fmt-py
fmt-py:
$(conda_run) black --skip-string-normalization .
$(conda_run) isort --profile black .
.PHONY: fmt-py-check
fmt-py-check:
$(conda_run) black -l 88 --check .
.PHONY: lint
lint: lint-ts
@echo "Format check completed"
.PHONY: lint-ts
lint-ts:
$(conda_run) npm run lint