-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Apply linting throughout project (#137)
* Apply linting throughout project * Fix typo * Add pre-commit Ruff and Prettier * Fix CI issues
- Loading branch information
Showing
33 changed files
with
2,178 additions
and
1,882 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: code-quality | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Conda environment with Micromamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-name: ipywebrtc-dev | ||
environment-file: dev_environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
mamba-version: "*" | ||
auto-activate-base: false | ||
channels: conda-forge | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install ".[dev]" | ||
pre-commit install | ||
- name: run pre-commit | ||
run: | | ||
pre-commit run --all-files |
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,14 @@ | ||
repos: | ||
- repo: "https://github.com/pre-commit/mirrors-prettier" | ||
rev: "v3.1.0" | ||
hooks: | ||
- id: prettier | ||
types: [javascript] | ||
stages: [commit] | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.1.9" | ||
hooks: | ||
- id: ruff | ||
stages: [commit] | ||
- id: ruff-format | ||
stages: [commit] |
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,4 @@ | ||
node_modules | ||
**/node_modules | ||
**/lib | ||
**/package.json |
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,40 +1,50 @@ | ||
from releash import * | ||
import glob | ||
|
||
from releash import * | ||
|
||
# these objects only tag when they are exe | ||
gitpush = ReleaseTargetGitPush() | ||
|
||
|
||
filenames_python = glob.glob('*') | ||
filenames_python.remove('js') | ||
filenames_python = glob.glob("*") | ||
filenames_python.remove("js") | ||
# filenames_python.remove('notebooks') | ||
package_python = add_package(".", "py", distribution_name='ipywebrtc', filenames=filenames_python) | ||
package_python = add_package(".", "py", distribution_name="ipywebrtc", filenames=filenames_python) | ||
|
||
version_python = VersionSource(package_python, '{path}/ipywebrtc/_version.py') | ||
version_python = VersionSource(package_python, "{path}/ipywebrtc/_version.py") | ||
gittag = ReleaseTargetGitTagVersion(version_source=version_python) | ||
|
||
package_python.version_source = version_python | ||
package_python.version_targets.append(VersionTarget(package_python, '{path}/ipywebrtc/_version.py')) | ||
package_python.version_targets.append(VersionTarget(package_python, "{path}/ipywebrtc/_version.py")) | ||
|
||
package_python.release_targets.append(gittag) | ||
package_python.release_targets.append(ReleaseTargetSourceDist(package_python)) | ||
#core.release_targets.append(gitpush) | ||
#package_python.release_targets.append(ReleaseTargetCondaForge(package_python, '../feedstocks/ipywebrtc-feedstock')) | ||
# core.release_targets.append(gitpush) | ||
# package_python.release_targets.append(ReleaseTargetCondaForge(package_python, '../feedstocks/ipywebrtc-feedstock')) | ||
|
||
|
||
# js part | ||
package_js = add_package("js", "js", distribution_name='ipywebrtc') | ||
package_js = add_package("js", "js", distribution_name="ipywebrtc") | ||
|
||
version_js = VersionSource(package_js, '{path}/../ipywebrtc/_version.py', tuple_variable_name='__version_tuple_js__') | ||
version_js = VersionSource( | ||
package_js, | ||
"{path}/../ipywebrtc/_version.py", | ||
tuple_variable_name="__version_tuple_js__", | ||
) | ||
|
||
package_js.version_source = version_js | ||
package_js.version_targets.append(VersionTarget(package_js, '{path}/../ipywebrtc/_version.py', | ||
tuple_variable_name='__version_tuple_js__', | ||
string_variable_name='__version_js__')) | ||
package_js.version_targets.append(VersionTargetJson(package_js, '{path}/package.json')) | ||
|
||
gittag_js = ReleaseTargetGitTagVersion(version_source=version_js, postfix='_js') | ||
package_js.version_targets.append( | ||
VersionTarget( | ||
package_js, | ||
"{path}/../ipywebrtc/_version.py", | ||
tuple_variable_name="__version_tuple_js__", | ||
string_variable_name="__version_js__", | ||
) | ||
) | ||
package_js.version_targets.append(VersionTargetJson(package_js, "{path}/package.json")) | ||
|
||
gittag_js = ReleaseTargetGitTagVersion(version_source=version_js, postfix="_js") | ||
package_js.release_targets.append(gittag_js) | ||
package_js.release_targets.append(ReleaseTargetNpm(package_js)) | ||
#core.release_targets.append(gitpush) | ||
#package_python.release_targets.append(ReleaseTargetCondaForge(package_python, '../feedstocks/ipyvolume-feedstock')) | ||
|
||
# core.release_targets.append(gitpush) | ||
# package_python.release_targets.append(ReleaseTargetCondaForge(package_python, '../feedstocks/ipyvolume-feedstock')) |
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,18 +1,19 @@ | ||
- To release a new version of ipywebrtc on PyPI: | ||
|
||
Update _version.py (set release version, remove 'dev') | ||
Update \_version.py (set release version, remove 'dev') | ||
git add and git commit | ||
python setup.py sdist upload | ||
python setup.py bdist_wheel upload | ||
git tag -a X.X.X -m 'comment' | ||
Update _version.py (add 'dev' and increment minor) | ||
Update \_version.py (add 'dev' and increment minor) | ||
git add and git commit | ||
git push | ||
git push --tags | ||
|
||
- To release a new version of jupyter-webrtc on NPM: | ||
|
||
# nuke the `dist` and `node_modules` | ||
# nuke the `dist` and `node_modules` | ||
|
||
git clean -fdx | ||
npm install | ||
npm publish |
Oops, something went wrong.