Skip to content

Commit

Permalink
Standardize dev env, build and upload scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
edudobay committed Jan 4, 2020
1 parent e75e434 commit 8b3c4d7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
MANIFEST
build/
dist/
*.egg-info/
*.egg-info/

/venv
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ Project Conventions
* **Source code formatting:** use [black][]. A recipe for running it is provided in the Makefile: just `make format`.


Development Dependencies
------------------------
Development setup
-----------------

After setting up your virtual environment, install development dependencies:
* Set up a Python virtual environment with `python -m venv venv` at the root of this project.
* Run `make dev` to install the project in editable mode and install dependencies.

```shell
$ pip install -r requirements-dev.in
$ python -m venv venv
$ make dev
```

The Makefile is already configured to use Python from the virtual environment `venv`; for running other commands, activate it using `source venv/bin/activate`.


[black]: https://black.readthedocs.io/en/stable/
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
project_dir := $(patsubst %/,%,$(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
PATH := $(project_dir)/venv/bin:$(PATH)

all:

format:
python -m black mingus mingus_examples unittest

dev:
pip install -e '.[fft,fluidsynth]' -r requirements-dev.in

install:
python setup.py install
pip install .

test:
(cd unittest; python run_tests.py)
Expand All @@ -19,13 +26,19 @@ test-all: test test-fluidsynth test-lilypond
clean:
rm -rf build/ dist/

register:
python setup.py register
build:
python setup.py sdist bdist_wheel

upload:
python setup.py sdist upload
twine upload dist/*

tag:
git tag $$(python setup.py --version)

release: clean register upload tag
release: clean build upload tag

.PHONY: format \
dev install \
test test-fluidsynth test-lilypond test-all \
clean build \
upload tag release
2 changes: 2 additions & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
black
twine
wheel

0 comments on commit 8b3c4d7

Please sign in to comment.