-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix windows build CI #152
Merged
Merged
fix windows build CI #152
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ jobs: | |
- name: Install ninja | ||
run: pipx install ninja | ||
|
||
- name: Install alsa deps | ||
run: sudo apt-get install libasound2-dev | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
|
@@ -44,6 +47,9 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,9 @@ jobs: | |
- name: Install ninja | ||
run: pipx install ninja | ||
|
||
- name: Install alsa deps | ||
run: sudo apt-get install libasound2-dev | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
|
@@ -44,6 +47,9 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ name: Build sdist and wheel for testing purposes | |
on: | ||
push: | ||
branches: | ||
- rtmidi-5.0.0 | ||
- improve-build | ||
pull_request: | ||
branches: | ||
- rtmidi-5.0.0 | ||
- improve-build | ||
|
||
jobs: | ||
build_sdist: | ||
|
@@ -21,6 +21,9 @@ jobs: | |
- name: Install ninja | ||
run: pipx install ninja | ||
|
||
- name: Install alsa deps | ||
run: sudo apt-get install libasound2-dev | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
|
@@ -44,6 +47,9 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
if: matrix.os == 'windows-latest' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,9 @@ used to specify the low-level MIDI backend API to use when creating a | |
Windows MultiMedia | ||
``API_RTMIDI_DUMMY`` | ||
RtMidi Dummy API (used when no suitable API was found) | ||
``API_RWEB_MIDI`` | ||
W3C Web MIDI API | ||
|
||
|
||
|
||
Error types | ||
|
@@ -113,7 +116,7 @@ from libcpp.vector cimport vector | |
|
||
__all__ = ( | ||
'API_UNSPECIFIED', 'API_MACOSX_CORE', 'API_LINUX_ALSA', 'API_UNIX_JACK', | ||
'API_WINDOWS_MM', 'API_RTMIDI_DUMMY', 'ERRORTYPE_DEBUG_WARNING', | ||
'API_WINDOWS_MM', 'API_RTMIDI_DUMMY', 'API_WEB_MIDI', 'ERRORTYPE_DEBUG_WARNING', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change should warrant a minor version number increase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure it's actually usable 'tho |
||
'ERRORTYPE_DRIVER_ERROR', 'ERRORTYPE_INVALID_DEVICE', | ||
'ERRORTYPE_INVALID_PARAMETER', 'ERRORTYPE_INVALID_USE', | ||
'ERRORTYPE_MEMORY_ERROR', 'ERRORTYPE_NO_DEVICES_FOUND', | ||
|
@@ -148,6 +151,7 @@ cdef extern from "RtMidi.h": | |
UNIX_JACK "RtMidi::UNIX_JACK" | ||
WINDOWS_MM "RtMidi::WINDOWS_MM" | ||
RTMIDI_DUMMY "RtMidi::RTMIDI_DUMMY" | ||
WEB_MIDI "RtMidi::WEB_MIDI_API" | ||
|
||
cdef enum ErrorType "RtMidiError::Type": | ||
ERR_WARNING "RtMidiError::WARNING" | ||
|
@@ -244,6 +248,7 @@ API_LINUX_ALSA = LINUX_ALSA | |
API_UNIX_JACK = UNIX_JACK | ||
API_WINDOWS_MM = WINDOWS_MM | ||
API_RTMIDI_DUMMY = RTMIDI_DUMMY | ||
API_WEB_MIDI = WEB_MIDI | ||
|
||
# export error values to Python | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" Basic tests that don't need midi ports""" | ||
|
||
import unittest | ||
import rtmidi | ||
|
||
|
||
if bytes is str: | ||
string_types = (str, unicode) # noqa:F821 | ||
else: | ||
string_types = (str,) | ||
|
||
|
||
class BasicTest(unittest.TestCase): | ||
def test_get_api_display_name(self): | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_LINUX_ALSA), 'ALSA') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_MACOSX_CORE), 'CoreMidi') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_RTMIDI_DUMMY), 'Dummy') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_UNIX_JACK), 'Jack') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_UNSPECIFIED), 'Unknown') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_WINDOWS_MM), 'Windows MultiMedia') | ||
self.assertEqual(rtmidi.get_api_display_name(rtmidi.API_WEB_MIDI), 'Web MIDI API') | ||
|
||
def test_get_api_name(self): | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_LINUX_ALSA), 'alsa') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_MACOSX_CORE), 'core') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_RTMIDI_DUMMY), 'dummy') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_UNIX_JACK), 'jack') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_UNSPECIFIED), 'unspecified') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_WINDOWS_MM), 'winmm') | ||
self.assertEqual(rtmidi.get_api_name(rtmidi.API_WEB_MIDI), 'web') | ||
|
||
def test_get_compiled_api(self): | ||
apilist = rtmidi.get_compiled_api() | ||
self.assertTrue(isinstance(apilist, list)) | ||
self.assertTrue(len(apilist) >= 1) | ||
for api in apilist: | ||
self.assertTrue(api <= rtmidi.API_RTMIDI_DUMMY) | ||
|
||
def test_get_compiled_api_by_name(self): | ||
for api, name in ( | ||
(rtmidi.API_LINUX_ALSA, 'alsa'), | ||
(rtmidi.API_MACOSX_CORE, 'core'), | ||
(rtmidi.API_RTMIDI_DUMMY, 'dummy'), | ||
(rtmidi.API_UNIX_JACK, 'jack'), | ||
(rtmidi.API_WINDOWS_MM, 'winmm'), | ||
(rtmidi.API_WEB_MIDI, 'web'),): | ||
|
||
res = rtmidi.get_compiled_api_by_name(name) | ||
|
||
if api in rtmidi.get_compiled_api(): | ||
self.assertEqual(res, api) | ||
else: | ||
self.assertEqual(res, rtmidi.API_UNSPECIFIED) | ||
|
||
def test_get_rtmidi_version(self): | ||
version = rtmidi.get_rtmidi_version() | ||
self.assertTrue(isinstance(version, string_types)) | ||
self.assertEqual(version, '5.0.0') | ||
|
||
def test_nondummy_api_present(self): | ||
# Make sure at least one actual API has been compiled | ||
apilist = rtmidi.get_compiled_api() | ||
apiFound = False | ||
for api in apilist: | ||
if api != rtmidi.API_RTMIDI_DUMMY: | ||
apiFound = True | ||
self.assertTrue(apiFound) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something doesn't seem right here. Does this belong in the master branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this file to test workflow changes. I guess we can delete it now.