Skip to content

Commit 8b3c4d7

Browse files
committed
Standardize dev env, build and upload scripts
1 parent e75e434 commit 8b3c4d7

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
MANIFEST
44
build/
55
dist/
6-
*.egg-info/
6+
*.egg-info/
7+
8+
/venv

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ Project Conventions
77
* **Source code formatting:** use [black][]. A recipe for running it is provided in the Makefile: just `make format`.
88

99

10-
Development Dependencies
11-
------------------------
10+
Development setup
11+
-----------------
1212

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

1516
```shell
16-
$ pip install -r requirements-dev.in
17+
$ python -m venv venv
18+
$ make dev
1719
```
1820

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

2024
[black]: https://black.readthedocs.io/en/stable/

Makefile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
project_dir := $(patsubst %/,%,$(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
2+
PATH := $(project_dir)/venv/bin:$(PATH)
3+
4+
all:
15

26
format:
37
python -m black mingus mingus_examples unittest
48

9+
dev:
10+
pip install -e '.[fft,fluidsynth]' -r requirements-dev.in
11+
512
install:
6-
python setup.py install
13+
pip install .
714

815
test:
916
(cd unittest; python run_tests.py)
@@ -19,13 +26,19 @@ test-all: test test-fluidsynth test-lilypond
1926
clean:
2027
rm -rf build/ dist/
2128

22-
register:
23-
python setup.py register
29+
build:
30+
python setup.py sdist bdist_wheel
2431

2532
upload:
26-
python setup.py sdist upload
33+
twine upload dist/*
2734

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

31-
release: clean register upload tag
38+
release: clean build upload tag
39+
40+
.PHONY: format \
41+
dev install \
42+
test test-fluidsynth test-lilypond test-all \
43+
clean build \
44+
upload tag release

requirements-dev.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
black
2+
twine
3+
wheel

0 commit comments

Comments
 (0)