Skip to content

Commit

Permalink
Merge pull request #10 from hbcarlos/releaser
Browse files Browse the repository at this point in the history
Adds releaser
  • Loading branch information
hbcarlos authored Jun 1, 2023
2 parents 0da84e1 + 867cdcb commit 31f0d71
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 11 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Release
on:
push:
branches: ["main"]
pull_request:
branches: ["*"]

jobs:
check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install Dependencies
run: |
pip install -e .
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
uses: actions/upload-artifact@v3
with:
name: ipylgbst-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
13 changes: 13 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Enforce PR label

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: enforce-triage-label
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

<!-- <START NEW CHANGELOG ENTRY> -->

## 0.2.0

<!-- <END NEW CHANGELOG ENTRY> -->
19 changes: 13 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,24 @@

# get version from python package:
import os
import json
here = os.path.dirname(__file__)
repo = os.path.join(here, '..', '..')
_version_py = os.path.join(repo, 'ipylgbst', '_version.py')
version_ns = {}
with open(_version_py) as f:
exec(f.read(), version_ns)
package_json = os.path.join(repo, 'package.json')

data = {}
with open(package_json) as f:
data = json.load(f)

#_version_py = os.path.join(repo, 'ipylgbst', '_version.py')
#version_ns = {}
#with open(_version_py) as f:
# exec(f.read(), version_ns)

# The short X.Y version.
version = '%i.%i' % version_ns['version_info'][:2]
version = '%s.%s' % (data["version"][0], data["version"][2])
# The full version, including alpha/beta/rc tags.
release = version_ns['__version__']
release = data["version"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 5 additions & 1 deletion ipylgbst/_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"""
Information about the frontend package of the widgets.
"""
from packaging import version
from ._version import __version__ # noqa

v = version.parse(__version__)

module_name = "ipylgbst"
module_version = "^0.2.0"
module_version = f"^{v.major}.{v.minor}"
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,10 @@ build_dir = "ipylgbst/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"

[tool.jupyter-releaser.hooks]
before-build-npm = ["python -m pip install jupyterlab~=3.0", "jlpm", "jlpm build:prod"]
before-build-python = ["jlpm clean"]

[tool.check-wheel-contents]
ignore = ["W002"]
10 changes: 6 additions & 4 deletions src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,24 +250,26 @@ export class LegoBoostView extends DOMWidgetView {
meter_distance: HTMLMeterElement;
color_color: HTMLDivElement;

isWebBluetoothSupported : boolean = navigator.bluetooth ? true : false;
isWebBluetoothSupported: boolean = navigator.bluetooth ? true : false;

render() {
this.el.classList.add('custom-widget');

// checking if Web Bluetooth API is supported
if (!this.isWebBluetoothSupported) {

// bluetooth error box
const bluetooth_box = document.createElement('div');
bluetooth_box.classList.add('error-box');
this.el.appendChild(bluetooth_box);

this.txt_bluetooth = document.createElement('div');
this.txt_bluetooth.textContent = "Your device doesn't support Web Bluetooth API. Try to turn on Experimental Platform Features from Chrome, by accessing the following link and turning it on: chrome://flags/#enable-experimental-web-platform-features";
this.txt_bluetooth.textContent =
"Your device doesn't support Web Bluetooth API. Try to turn on Experimental Platform Features from Chrome, by accessing the following link and turning it on: chrome://flags/#enable-experimental-web-platform-features";
bluetooth_box.appendChild(this.txt_bluetooth);

console.log( "Your device doesn't support Web Bluetooth API. Try to turn on Experimental Platform Features from Chrome, by accessing the following link and turning it on: chrome://flags/#enable-experimental-web-platform-features");
console.log(
"Your device doesn't support Web Bluetooth API. Try to turn on Experimental Platform Features from Chrome, by accessing the following link and turning it on: chrome://flags/#enable-experimental-web-platform-features"
);
}

// connection box
Expand Down

0 comments on commit 31f0d71

Please sign in to comment.