-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from versatica/modernize
Modernize
- Loading branch information
Showing
48 changed files
with
12,195 additions
and
2,734 deletions.
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
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,45 @@ | ||
name: mediasoup-client-aiortc | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
# Cancel a currently running workflow from the same PR, branch or tag when a | ||
# new workflow is triggered. | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
matrix: | ||
# Different Node versions on Ubuntu, the latest Node on other platforms. | ||
ci: | ||
- os: ubuntu-22.04 | ||
node: 16 | ||
- os: macos-12 | ||
node: 18 | ||
runs-on: ${{ matrix.ci.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.ci.node }} | ||
|
||
- name: Configure cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.npm | ||
key: ${{ matrix.ci.os }}-node-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ matrix.ci.os }}-node- | ||
- run: npm ci | ||
- run: npm run install-python-dev-deps | ||
# NOTE: Avoid lint:python due to | ||
# https://github.com/versatica/mediasoup-client-aiortc/issues/25 | ||
- run: npm run lint:node | ||
- run: npm run test |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
package-lock=false | ||
# Generate package-lock.json. | ||
package-lock=true | ||
# For bad node/npm version to throw actual error. | ||
engine-strict=true |
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 |
---|---|---|
|
@@ -16,16 +16,16 @@ Once the requirements above are satisfied, install **mediasoup-client-aiortc** w | |
$ npm install --save mediasoup-client-aiortc | ||
``` | ||
|
||
The "postinstall" script in `package.json` will install the Python libraries (including **aiortc**) by using `pip3` command. If such a command is not in the `PATH` or has a different name in your system, you can override its location by setting the `PIP3` environment variable: | ||
The "postinstall" script in `package.json` will install the Python libraries (including **aiortc**) by using `pip3` command. If such a command is not in the `PATH` or has a different name in your system, you can override its location by setting the `PIP` environment variable: | ||
|
||
```bash | ||
$ PIP3=/home/me/bin/pip npm install --save mediasoup-client-aiortc | ||
$ PIP=/home/me/bin/pip npm install --save mediasoup-client-aiortc | ||
``` | ||
|
||
Once you run your Node.js application, **mediasoup-client-aiortc** will eventually spawn Python processes and communicate with them via `UnixSocket`. This module assumes that there is a `python3` executable in your `PATH` to spawn the Python executable. If not, you can override its location by setting the `PYTHON3` environment variable: | ||
Once you run your Node.js application, **mediasoup-client-aiortc** will eventually spawn Python processes and communicate with them via `UnixSocket`. This module assumes that there is a `python3` executable in your `PATH` to spawn the Python executable. If not, you can override its location by setting the `PYTHON` environment variable: | ||
|
||
```bash | ||
$ PYTHON3=/home/me/bin/python-3.7 node my_app.js | ||
$ PYTHON=/home/me/bin/python-3.7 node my_app.js | ||
``` | ||
|
||
|
||
|
@@ -261,12 +261,34 @@ In order to run `npm run lint` task, the following Python dependencies are requi | |
- `flake8` >= 5.0.4 | ||
- `mypy` >= 0.982 | ||
Install them with `pip` command: | ||
```bash | ||
$ pip3 install flake8==5.0.4 mypy==0.982 | ||
$ npm run install-python-dev-deps | ||
``` | ||
### Issue with Python >= 3.11 | ||
See https://github.com/versatica/mediasoup-client-aiortc/issues/22. | ||
As a workaround: | ||
1. Install `python@3.10`. | ||
2. Make `PYTHON` environment variable point to it: | ||
```bash | ||
export PYTHON=python3.10 | ||
``` | ||
3. Make `PIP` environment variable point to `[email protected]`: | ||
```bash | ||
export PIP=pip3.10 | ||
``` | ||
4. Install deps: | ||
```bash | ||
npm ci | ||
``` | ||
5. Run tests: | ||
```bash | ||
npm test | ||
``` | ||
|
||
|
||
## Caveats | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.