Skip to content

Commit b454f14

Browse files
authored
common commands (#59)
1 parent 84a80ff commit b454f14

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Matches multiple files with brace expansion notation
12+
# Set default charset
13+
[*.{js,py}]
14+
charset = utf-8
15+
16+
# 4 space indentation
17+
[*.py]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.sh]
22+
indent_style = space
23+
indent_size = 4
24+
25+
# Tab indentation (no size specified)
26+
[Makefile]
27+
indent_style = tab
28+
29+
[*.nix]
30+
indent_style = space
31+
indent_size = 4

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# https://www.gnu.org/software/make/manual/html_node/Special-Variables.html
2+
# https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_17.html
3+
PROJECT_MKFILE_PATH := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
4+
PROJECT_MKFILE_DIR := $(shell cd $(shell dirname $(PROJECT_MKFILE_PATH)); pwd)
5+
6+
PROJECT_NAME := plim
7+
PROJECT_ROOT := $(PROJECT_MKFILE_DIR)
8+
9+
BUILD_DIR := $(PROJECT_ROOT)/build
10+
DIST_DIR := $(PROJECT_ROOT)/dist
11+
12+
PROJECT=plim
13+
14+
.PHONY: test
15+
test:
16+
pytest -s --cov=plim --cov-report xml $(PROJECT_ROOT)/tests
17+
18+
.PHONY: typecheck
19+
typecheck:
20+
mypy --config-file setup.cfg --package $(PROJECT_NAME)
21+
22+
.PHONY: prepare-dist
23+
prepare-dist:
24+
rm -rf $(BUILD_DIR) $(DIST_DIR)
25+
python $(PROJECT_ROOT)/setup.py sdist bdist_wheel
26+
27+
.PHONY: publish
28+
publish: | test publish
29+
twine upload $(DIST_DIR)/*
30+
31+
.PHONY: shell
32+
shell:
33+
nix-shell $(PROJECT_ROOT)/shell.nix

default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ devEnv = pkgs.mkShellNoCC {
2323
pythonPkgs.twine
2424
pythonPkgs.coveralls
2525

26+
gnumake
2627
nodejs
2728
nodePackages.npm
2829
taglib

requirements-test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
coverage
3-
pytest-cov
3+
pytest-cov
4+
mypy

0 commit comments

Comments
 (0)