Skip to content

Commit

Permalink
Added rules to build and install package
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam-Deacon committed Nov 28, 2018
1 parent 0d5bfaa commit 5c17208
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
.PHONY: test
.PHONY: test install uninstall

PYTHON=python3

all: build dist

test:
@echo "Running Tests using Python3 BlueSky"
@TESTING=true PYEXEC=python3 python3 -m pytest -s bluesky/test
@echo "Running Tests using $(PYTHON) BlueSky"
@TESTING=true PYEXEC=$(PYTHON) $(PYTHON) -m pytest -s bluesky/test

lint:
@autopep8 --in-place -r bluesky/test
# the use of fixtures in pytest causes unused-argument and redefined-outer-name 'issues'
@PYTHONPATH=`pwd`:${PYTHONPATH} pylint3 -d "invalid-name,bare-except,unused-argument,redefined-outer-name,too-many-arguments" bluesky/test || true
@PYTHONPATH=`pwd`:${PYTHONPATH} $(PYTHON) -m pylint -d "invalid-name,bare-except,unused-argument,redefined-outer-name,too-many-arguments" bluesky/test || true

clean:
rm -rf dist/ build/ *egg-info*
find -type d -name '__pycache__' | xargs rm -rf

build: setup.py requirements.txt MANIFEST.in
@"`which $(PYTHON)`" setup.py build

dist:
@"`which $(PYTHON)`" setup.py sdist bdist_wheel

pypi:
twine upload dist/*

install:
@cd dist && "`which $(PYTHON)`" -m pip install bluesky*.whl

uninstall:
@"`which $(PYTHON)`" -m pip uninstall bluesky-simulator

0 comments on commit 5c17208

Please sign in to comment.