Skip to content

Commit af66311

Browse files
authored
Merge pull request #165 from SpotlightKid/feat/update-docs
Update install and contributing documentation
2 parents ea8d1f6 + 1193be0 commit af66311

File tree

6 files changed

+159
-103
lines changed

6 files changed

+159
-103
lines changed

AUTHORS.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@
22

33
## Development Lead
44

5-
- Christopher Arndt <[email protected]>
5+
- Christopher Arndt <[email protected]>
66

77

88
## Release Manager
99

10-
- Bruno Enten
10+
- Bruno Enten
1111

1212

1313
## Contributors
1414

15-
- Michiel Overtoom
16-
- Orhan Kavrakoğlu
17-
- tekHedd
18-
- Maurizio Berti
19-
- Benoit Pierre
20-
- Bruno Enten
15+
- Michiel Overtoom
16+
- Orhan Kavrakoğlu
17+
- tekHedd
18+
- Maurizio Berti
19+
- Benoit Pierre
20+
- Bruno Enten
21+
- Marek Szuba
2122

2223

2324
## Testing
2425

25-
- Martin Tarenskeen
26-
- Pierre Castellotti
26+
- Martin Tarenskeen
27+
- Pierre Castellotti
28+

CHANGELOG.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,41 @@
33
For details and minor changes, please see the [version control log
44
messages](https://github.com/SpotlightKid/python-rtmidi/commits/master).
55

6+
## Development
7+
8+
Changes:
9+
10+
- Updated `rtmidi` submodule (#156).
11+
12+
Documentation:
13+
14+
- Updated installation documentation (#165).
15+
- Updated contributing guide (#165).
16+
- Removed Python 3.7 from meta-data classifiers in `pyproject.toml`(dfb3800).
17+
18+
Project infrastructure:
19+
20+
- Changed the build back-end to meson-python (#161).
21+
- Fixed broken macOS arm64 binary wheels built by CI (#161).
22+
- Fixed missing JACK backend API support in Linux aarch64 binary wheels built
23+
by CI (#161).
24+
- Improved tests for binary wheels built by CI (#162).
25+
- Cleaned up GitHub actions workflow definitions (#163).
26+
- Fixed test coverage report target in Makefile (#164).
27+
28+
29+
## 1.5.2 (2023-06-14)
30+
31+
Changes:
32+
33+
- Updated `rtmidi` submodule (#156).
34+
35+
Project infrastructure:
36+
37+
- Updated `requirements-dev.txt` with `pip-compile` (#153).
38+
- Changed CI to build separate wheels for both macOS architectures (18bbc74, 20f5cdd).
39+
- Improved build dependency selection in meson config (#156).
40+
641

742
## 1.5.1 (2023-06-12)
843

@@ -44,7 +79,7 @@ Changes:
4479

4580
- The SysEx reception buffer size for the Windows MM backend was
4681
changed from 8096 to 8196.
47-
s- Synced with upstream [RtMidi](https://github.com/thestk/rtmidi)
82+
- Synced with upstream [RtMidi](https://github.com/thestk/rtmidi)
4883
(3dc525baf3cac345cdd3511316571c20b47f30b5, fixes #89).
4984

5085

INSTALL-windows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# How to install python-rtmidi from source on Windows
22

33
These instructions should work for installing `python-rtmidi` from source with
4-
Python 3.7+ in the 64-bit or 32-bit versions (you can run the latter on Windows
4+
Python 3.8+ in the 64-bit or 32-bit versions (you can run the latter on Windows
55
64-bit versions with no problems).
66

77
Please follow all the steps below in the exact order.
@@ -11,7 +11,7 @@ Please follow all the steps below in the exact order.
1111
You probably need administrator rights for some or all of the following steps.
1212

1313
1. Install the latest release of Python (3.11 at the time of writing, at least
14-
3.7+) from <https://www.python.org/downloads/windows/> to the default
14+
3.8+) from <https://www.python.org/downloads/windows/> to the default
1515
location (e.g. `C:\Python311`). You can install either or both the 32-bit
1616
and the 64-bit version.
1717

INSTALL.md

Lines changed: 99 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Installation
22

33
**python-rtmidi** uses a modern [PEP 517] compliant Python build system based
4-
on [meson] and [mesonpep517] and can be installed from the Python Package Index
4+
on [meson] and [meson-python] and can be installed from the Python Package Index
55
via [pip]. Since it is a Python C(++)-extension, a C++ compiler and build
66
environment as well as some system-dependent libraries are needed to install,
77
unless wheel packages with pre-compiled binaries are available for your system.
@@ -40,88 +40,96 @@ below for moe information.
4040

4141
## Pre-compiled Binaries
4242

43-
Pre-compiled binary wheels of the latest python-rtmidi version for Windows and
44-
macOS / OS X are available on PyPI for several major Python versions. If you
43+
Pre-compiled binary wheels of the latest python-rtmidi version for Windows,
44+
macOS and Linux are available on PyPI for all supported Python versions. If you
4545
install python-rtmidi via pip (see above), these wheels will be selected by pip
46-
automatically, if you have a compatible Python and Windows or macOS version.
46+
automatically, if you have a compatible Python and OS version and processor
47+
architecture.
4748

48-
The Windows binary wheels are compiled with Windows MultiMedia API support and
49-
are available in 32-bit and 64-bit versions. The macOS / OS X binary wheels are
50-
compiled with CoreMIDI support and are only available in 64-bit versions for OS
51-
X 10.6 and later. If you need JACK support on OS X, you need to compile
52-
python-rtmidi yourself (see the [macOS] section below for details).
49+
* Windows binary wheels are compiled with Windows MultiMedia API support and
50+
are available for x86_64 (aka amd64).
5351

52+
* macOS / OS X binary wheels are compiled with CoreMIDI support and are
53+
available for OS X intel (10.9+) and arm64 (aka M1/M2/Apple silicon, 11.0+).
5454

55-
## From Source
56-
57-
To compile python-rtmidi from source and install it manually without pip, you
58-
can either download a source distribution archive or check out the sources from
59-
the Git repository.
60-
61-
While the steps to get the sources differ, the actual compilation and
62-
installation steps consist of the same standard meson commands in both cases:
55+
If you need JACK support on OS X, you need to compile python-rtmidi yourself
56+
(see the [macOS] section below for details).
6357

64-
```console
65-
meson setup --prefix=/usr --buildtype=plain builddir
66-
meson compile -C builddir
67-
meson install -C builddir
68-
```
58+
* Linux binary wheels are available for x64_64 and aarch64,
6959

70-
The `meson setup` command recognizes several options to control which
71-
OS-dependent MIDI backends will be supported by the python-rtmidi extension
72-
binary it produces, plus other options to control compilation of the RtMidi C++
73-
library:
7460

75-
| Option | Linux | macOS | Windows | Note |
76-
| ------------------ | ----- | ----- | ------- | -------------------------------------------------------- |
77-
| `-Dalsa=false` | x | n/a | n/a | Don't compile in support for ALSA backend. |
78-
| `-Djack=false` | x | x | n/a | Don't compile in support for JACK backend. |
79-
| `-Dcoremidi=false` | n/a | x | n/a | Don't compile in support for CoreMIDI backend. |
80-
| `-Dwinmm=false` | n/a | n/a | x | Don't compile in support for Windows MultiMedia backend. |
81-
| `-Dverbose=true` | x | x | x | Don't suppress RtMidi warnings to stderr. |
61+
## From Source
8262

83-
Support for each OS dependent MIDI backend is only enabled when the required
84-
library and header files are actually present on the system.
63+
To compile python-rtmidi from source and install it manually without pip, you
64+
can either download a source distribution archive or check out the sources from
65+
the Git repository. While the steps to get the sources differ, the actual
66+
compilation and installation steps consist of the same commands in both cases.
8567

8668

8769
### From the Source Distribution
8870

8971
To download the python-rtmidi source distribution archive for the current
90-
version, extract and install it, use the following commands:
72+
version and extract it, use the following commands:
9173

9274
```console
9375
pip download python-rtmidi
9476
tar -xzf python-rtmidi-1.X.Y.tar.gz
9577
cd python-rtmidi-1.X.Y
96-
meson setup --prefix=/usr --buildtype=plain builddir
97-
meson compile -C builddir
98-
meson install -C builddir
9978
```
10079

101-
On Linux or macOS / OS X, if you want to install python-rtmidi into the
102-
system-wide Python library directory, you may have to prefix the last command
103-
with `sudo`, e.g.:
80+
Then follow the commands shown in the section [buildinstall].
81+
82+
83+
### From the Source Code Repository
84+
85+
Alternatively, you can check out the python-rtmidi source code from the Git
86+
repository and then install it from your working copy.
10487

10588
```console
106-
sudo meson install -C builddir
89+
(rtmidi)$ git clone --recursive https://github.com/SpotlightKid/python-rtmidi.git
90+
(rtmidi)$ cd python-rtmidi
10791
```
10892

109-
The recommended way, though, is to install python-rtmidi only for your current
110-
user (which `installer` does by default) or into a virtual environment:
93+
Then follow the commands shown in the section [buildinstall].
94+
95+
96+
(buildinstall)=
97+
### Build and Install
98+
99+
#### Using the PEP 517 build method (recommended)
100+
101+
The recommended way is to build python-rtmidi via the standard PEP 517 build
102+
method and install it only for your current user (which `installer` does by
103+
default) or into a virtual environment.
104+
105+
If you don't already have the `build` and `installer` Python packages
106+
installed, install them with:
111107

112108
```console
109+
pip install build installer
110+
```
111+
112+
Then build and install python-rtmidi:
113+
114+
```console
115+
python -m build --wheel
113116
python -m installer dist/*.whl
114117
```
115118

119+
This will download all the required build tools, install them in a temporary
120+
virtual environment, build a wheel, and install it.
116121

117-
### From the Source Code Repository
118122

119-
Alternatively, you can check out the python-rtmidi source code from the Git
120-
repository and then install it from your working copy. Since the repository
121-
does not include the C++ module source code pre-compiled from the Cython
122-
source, you'll also need to install Cython >= 0.28, either via pip or from its
123-
Git repository. Using virtualenv / virtualenvwrapper is strongly recommended in
124-
this scenario:
123+
### Using meson directly
124+
125+
If you can't or don't want to use the standard PEP 517 build method, you can
126+
also use meson directly, but then you'll need to make sure all the required
127+
build tools are installed.
128+
129+
If you are installing from a Git repository checkout, since this does not
130+
include the C++ module source code pre-compiled from the Cython source, you'll
131+
also need to install Cython >= 0.29, either via pip or from its Git repository.
132+
Using virtualenv / virtualenvwrapper is strongly recommended in this scenario:
125133

126134
Make a virtual environment:
127135

@@ -130,24 +138,46 @@ mkvirtualenv rtmidi
130138
(rtmidi)$ cdvirtualenv
131139
```
132140

133-
Install Cython from PyPI:
141+
Install meson and ninja and, if neccessary, Cython from PyPI:
142+
143+
```console
144+
(rtmidi)$ pip install Cython meson ninja
145+
```
134146

135147
```console
136-
(rtmidi)$ pip install Cython meson ninja wheel
148+
meson setup --prefix=/usr -Dbuildtype=plain builddir
149+
meson compile -C builddir
150+
meson install -C builddir
137151
```
138152

139-
Then install python-rtmidi:
153+
On Linux or macOS, if you want to install python-rtmidi into the system-wide
154+
Python library directory, you may have to prefix the last command with `sudo`,
155+
e.g.:
140156

141157
```console
142-
(rtmidi)$ git clone --recursive https://github.com/SpotlightKid/python-rtmidi.git
143-
(rtmidi)$ cd python-rtmidi
144-
(rtmidi)$ meson setup --prefix=/usr --buildtype=plain builddir
145-
(rtmidi)$ meson compile -C builddir
146-
(rtmidi)$ meson install -C builddir
158+
sudo meson install -C builddir
147159
```
148160

161+
The `meson setup` command recognizes several options to control which
162+
OS-dependent MIDI backends will be supported by the python-rtmidi extension
163+
binary it produces, plus other options to control compilation of the RtMidi C++
164+
library:
165+
166+
| Option | Linux | macOS | Windows | Note |
167+
| ------------------ | ----- | ----- | ------- | -------------------------------------------------------- |
168+
| `-Dalsa=false` | x | n/a | n/a | Don't compile in support for ALSA backend. |
169+
| `-Djack=false` | x | x | n/a | Don't compile in support for JACK backend. |
170+
| `-Dcoremidi=false` | n/a | x | n/a | Don't compile in support for CoreMIDI backend. |
171+
| `-Dwinmm=false` | n/a | n/a | x | Don't compile in support for Windows MultiMedia backend. |
172+
| `-Dverbose=true` | x | x | x | Don't suppress RtMidi warnings to stderr. |
173+
| `-Dpython=python3` | x | x | x | Set name (or path) of Python interpreter. |
174+
175+
Support for each OS dependent MIDI backend is only enabled when the required
176+
library and header files are actually present on the system.
177+
178+
149179
(requirements)=
150-
#### Requirements
180+
## Requirements
151181

152182
Naturally, you'll need a C++ compiler and a build environment. See the
153183
platform-specific hints below.
@@ -166,7 +196,7 @@ appropriate compilations flags automatically.
166196
- Windows: MultiMedia (MM)
167197

168198

169-
## Linux
199+
### Linux
170200

171201
First you need a C++ compiler and the pthread library. Install the
172202
`build-essential` package on debian-based systems to get these.
@@ -182,24 +212,15 @@ you are using Jack2, install `libjack-jackd2-dev`).
182212

183213

184214
(macos)=
185-
## macOS (OS X)
215+
### macOS (OS X)
186216

187217
Install the latest Xcode version or `g++` from MacPorts or homebrew (untested).
188-
CoreMIDI support comes with installing Xcode. For JACK support, install
189-
[JackOSX] with the installer or build JACK from source.
190-
191-
**Note:**
192-
193-
*If you have a very old version of OS X and Xcode which still supports building
194-
binaries for PPC, you'll have to tell distribute to build the package only for
195-
i386 and x86_64 architectures:*
196-
197-
```console
198-
env ARCHFLAGS=\"-arch i386 -arch x86_64\" python setup.py install
199-
```
218+
CoreMIDI support comes with installing Xcode. For JACK support, install JACK
219+
with the [macOS installer] provided on the JACK web site or build JACK from
220+
source.
200221

201222

202-
## Windows
223+
### Windows
203224

204225
Please see the detailed instructions for Windows in `install-windows`.
205226

@@ -212,9 +233,9 @@ installing python-rtmidi in an uncommon or not-yet-covered environment.
212233

213234

214235
[Cython]: http://cython.org/
215-
[JackOSX]: http://jackaudio.org/downloads/
236+
[macOS installer]: http://jackaudio.org/downloads/
216237
[meson]: https://mesonbuild.com/
217-
[mesonpep517]: https://thiblahute.gitlab.io/mesonpep517/
238+
[meson-python]: https://github.com/mesonbuild/meson-python
218239
[pep 517]: https://peps.python.org/pep-0517/
219240
[pip]: https://pypi.python.org/pypi/pip
220241
[PyPI page]: http://python.org/pypi/python-rtmidi#downloads

0 commit comments

Comments
 (0)