Skip to content
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

common commands #59

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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