-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add initial dev setup automation #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
534a6a6
9e753e2
7ba5dc2
ce19ae6
3dc4d44
769cc28
22e6e14
0810acd
93b539d
f9d2c5e
88e15f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This is the configuration for pre-commit, a local framework for managing pre-commit hooks | ||
# Check out the docs at: https://pre-commit.com/ | ||
|
||
repos: [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
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 | ||
mattkram marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have been unable to coerce this into working in other repos. As-is, this is a no-op echo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if you are + or - on this one :D This specific cmd is not that relevant anymore(and I think I'll remove it) no that we want to default using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was indirectly suggesting we remove it, unless you have a way to make it work :) |
||
|
||
.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 | ||
mattkram marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fmt: fmt-py fmt-ts | ||
@echo "Format completed" | ||
|
||
.PHONY: fmt-check | ||
fmt-check: fmt-ts-check fmt-py | ||
@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 -l 88 . | ||
|
||
.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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
channels: | ||
- defaults | ||
- conda-forge | ||
dependencies: | ||
- python=3.9 | ||
- pip=20.2.2 | ||
- pytest=7 | ||
- nodejs=16 | ||
- black | ||
- isort | ||
- codespell |
Uh oh!
There was an error while loading. Please reload this page.