Skip to content

Commit

Permalink
common commands (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
avanov authored Sep 16, 2022
1 parent 84a80ff commit b454f14
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

[*.sh]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

[*.nix]
indent_style = space
indent_size = 4
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://www.gnu.org/software/make/manual/html_node/Special-Variables.html
# https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_17.html
PROJECT_MKFILE_PATH := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
PROJECT_MKFILE_DIR := $(shell cd $(shell dirname $(PROJECT_MKFILE_PATH)); pwd)

PROJECT_NAME := plim
PROJECT_ROOT := $(PROJECT_MKFILE_DIR)

BUILD_DIR := $(PROJECT_ROOT)/build
DIST_DIR := $(PROJECT_ROOT)/dist

PROJECT=plim

.PHONY: test
test:
pytest -s --cov=plim --cov-report xml $(PROJECT_ROOT)/tests

.PHONY: typecheck
typecheck:
mypy --config-file setup.cfg --package $(PROJECT_NAME)

.PHONY: prepare-dist
prepare-dist:
rm -rf $(BUILD_DIR) $(DIST_DIR)
python $(PROJECT_ROOT)/setup.py sdist bdist_wheel

.PHONY: publish
publish: | test publish
twine upload $(DIST_DIR)/*

.PHONY: shell
shell:
nix-shell $(PROJECT_ROOT)/shell.nix
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ devEnv = pkgs.mkShellNoCC {
pythonPkgs.twine
pythonPkgs.coveralls

gnumake
nodejs
nodePackages.npm
taglib
Expand Down
3 changes: 2 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
coverage
pytest-cov
pytest-cov
mypy

0 comments on commit b454f14

Please sign in to comment.