Files
pyscript/pyscriptjs/Makefile
Peter W ee46b46234 Add testing to CI flow (#418)
* new testing ci flow

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

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

* install conda

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

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

* test conda

* pre-commit fix

* remove if

* makefile fix

* fix pytest install

* argument for test

* restructure

* fix sync

* full path filter

* use setup-condav2

* syntax

* test path

* add binary argument

* remove which

* Update Makefile

* remove arguments

* trigger CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-20 13:45:49 -05:00

73 lines
1.5 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_EXE := conda
CONDA_ENV ?= ./env
env := $(CONDA_ENV)
conda_run := $(CONDA_EXE) run -p $(env)
setup:
$(CONDA_EXE) env $(shell [ -d $(env) ] && echo update || echo create) -p $(env) --file environment.yml
$(conda_run) playwright install
$(CONDA_EXE) install -c anaconda pytest
clean:
find . -name \*.py[cod] -delete
rm -rf .pytest_cache .coverage coverage.xml
clean-all: clean
rm -rf $(env) *.egg-info
shell:
@export CONDA_ENV_PROMPT='<{name}>'
@echo 'conda activate $(env)'
dev:
npm run dev
build:
npm run build
test:
$(conda_run) pytest -vv $(ARGS) tests/ --log-cli-level=warning
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
test-ts:
@echo "Tests are coming :( this is a placeholder and it's meant to fail!"
npm run tests
fmt: fmt-py fmt-ts
@echo "Format completed"
fmt-check: fmt-ts-check fmt-py-check
@echo "Format check completed"
fmt-ts:
npm run format
fmt-ts-check:
npm run format:check
fmt-py:
$(conda_run) black --skip-string-normalization .
$(conda_run) isort --profile black .
fmt-py-check:
$(conda_run) black -l 88 --check .
lint: lint-ts
@echo "Format check completed"
lint-ts:
$(conda_run) npm run lint
.PHONY: $(MAKECMDGOALS)