Skip to content
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/rename kernel package #305

Merged
merged 6 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
changes: # See https://github.com/dorny/paths-filter#examples
runs-on: ubuntu-latest
outputs:
stlite-kernel: ${{ steps.filter.outputs.stlite-kernel }}
kernel: ${{ steps.filter.outputs.kernel }}
tornado-e2e: ${{ steps.filter.outputs.tornado-e2e }}
mountable: ${{ steps.filter.outputs.mountable }}
sharing-common: ${{ steps.filter.outputs.sharing-common }}
Expand All @@ -17,12 +17,12 @@ jobs:
id: filter
with:
filters: |
stlite-kernel:
- 'packages/stlite-kernel/**/*'
# - '!packages/stlite-kernel/py/**/*' # Not supported by paths-filter now: https://github.com/dorny/paths-filter/issues/106
kernel:
- 'packages/kernel/**/*'
# - '!packages/kernel/py/**/*' # Not supported by paths-filter now: https://github.com/dorny/paths-filter/issues/106
tornado-e2e:
- 'packages/stlite-kernel/py/tornado'
- 'packages/stlite-kernel/py/e2etests/**/*'
- 'packages/kernel/py/tornado'
- 'packages/kernel/py/e2etests/**/*'
- 'streamlit/**/*'
mountable:
- 'packages/mountable/**/*'
Expand All @@ -31,9 +31,9 @@ jobs:
desktop:
- 'packages/desktop/**/*'

test-stlite-kernel:
test-kernel:
needs: changes
if: ${{ needs.changes.outputs.stlite-kernel == 'true' }}
if: ${{ needs.changes.outputs.kernel == 'true' }}

runs-on: ubuntu-latest

Expand All @@ -44,7 +44,7 @@ jobs:

defaults:
run:
working-directory: packages/stlite-kernel
working-directory: packages/kernel

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -123,23 +123,23 @@ jobs:
- name: Install dependencies
shell: bash
run: poetry install
working-directory: packages/stlite-kernel/py/e2etests
working-directory: packages/kernel/py/e2etests

- name: Run linter and code formatter to the test code module
working-directory: packages/stlite-kernel/py/e2etests
working-directory: packages/kernel/py/e2etests
run: |
poetry run black . --check
poetry run isort . --check
poetry run flake8

- name: Run mypy
working-directory: packages/stlite-kernel/py/e2etests
working-directory: packages/kernel/py/e2etests
run: poetry run mypy .

- name: Run pytest
shell: bash
run: poetry run python -m pytest -v tests
working-directory: packages/stlite-kernel/py/e2etests
working-directory: packages/kernel/py/e2etests

test-mountable:
needs: changes
Expand Down Expand Up @@ -233,9 +233,9 @@ jobs:
- run: yarn typecheck
- run: yarn test

build-stlite-kernel:
build-kernel:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
needs: [test-stlite-kernel, test-tornado-e2e]
needs: [test-kernel, test-tornado-e2e]

env:
python-version: "3.10.2"
Expand Down Expand Up @@ -303,30 +303,30 @@ jobs:
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
- name: Set PUBLIC_URL
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
- name: Build @stlite/stlite-kernel
run: make stlite-kernel
- name: Build @stlite/kernel
run: make kernel

- name: Package
working-directory: packages/stlite-kernel
working-directory: packages/kernel
run: yarn pack

- name: Upload the built tar ball as an artifact
uses: actions/upload-artifact@v2
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
with:
path: packages/stlite-kernel/stlite-stlite-kernel-v*.tgz
name: stlite-stlite-kernel-${{ github.sha }}.tgz
path: packages/kernel/stlite-kernel-v*.tgz
name: stlite-kernel-${{ github.sha }}.tgz

- name: Upload the built tar ball as an artifact (when pushed with a version tag)
uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
path: packages/stlite-kernel/stlite-stlite-kernel-v*.tgz
name: stlite-stlite-kernel-${{ github.ref_name }}.tgz
path: packages/kernel/stlite-kernel-v*.tgz
name: stlite-kernel-${{ github.ref_name }}.tgz

build-mountable:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
needs: [test-stlite-kernel, test-tornado-e2e, test-mountable]
needs: [test-kernel, test-tornado-e2e, test-mountable]

env:
python-version: "3.10.2"
Expand Down Expand Up @@ -452,7 +452,7 @@ jobs:

build-sharing:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
needs: [test-stlite-kernel, test-tornado-e2e, test-sharing-common]
needs: [test-kernel, test-tornado-e2e, test-sharing-common]

env:
python-version: "3.10.2"
Expand Down Expand Up @@ -562,7 +562,7 @@ jobs:

build-sharing-editor:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
needs: [test-stlite-kernel, test-tornado-e2e, test-sharing-common, deploy-sharing]
needs: [test-kernel, test-tornado-e2e, test-sharing-common, deploy-sharing]

runs-on: ubuntu-latest

Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "streamlit"]
path = streamlit
url = https://github.com/whitphx/streamlit.git
[submodule "packages/stlite-kernel/py/tornado"]
path = packages/stlite-kernel/py/tornado
[submodule "packages/kernel/py/tornado"]
path = packages/kernel/py/tornado
url = https://github.com/whitphx/tornado.git
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ mountable := packages/mountable/build/*
sharing := packages/sharing/build/*
sharing-common := packages/sharing-common/dist/*
sharing-editor := packages/sharing-editor/build/*
stlite_kernel := packages/stlite-kernel/dist/*
pyarrow_wheel := packages/stlite-kernel/py/stlite-pyarrow/dist/stlite_pyarrow-0.1.0-py3-none-any.whl
tornado_wheel := packages/stlite-kernel/py/tornado/dist/tornado-6.2-py3-none-any.whl
kernel := packages/kernel/dist/*
pyarrow_wheel := packages/kernel/py/stlite-pyarrow/dist/stlite_pyarrow-0.1.0-py3-none-any.whl
tornado_wheel := packages/kernel/py/tornado/dist/tornado-6.2-py3-none-any.whl
streamlit_proto := streamlit/frontend/src/autogen
streamlit_wheel := packages/stlite-kernel/py/streamlit/lib/dist/streamlit-1.13.0-py2.py3-none-any.whl
streamlit_wheel := packages/kernel/py/streamlit/lib/dist/streamlit-1.13.0-py2.py3-none-any.whl

.PHONY: all
all: init mountable playground sharing sharing-editor
Expand Down Expand Up @@ -45,14 +45,14 @@ $(GIT_SUBMODULES): %/.git: .gitmodules

.PHONY: mountable
mountable: $(mountable)
$(mountable): packages/mountable/src/*.ts packages/mountable/src/*.tsx $(stlite_kernel) $(streamlit_wheel)
$(mountable): packages/mountable/src/*.ts packages/mountable/src/*.tsx $(kernel) $(streamlit_wheel)
cd packages/mountable; \
yarn build
@touch $@

.PHONY: sharing
sharing: $(sharing)
$(sharing): packages/sharing/src/*.ts packages/sharing/src/*.tsx $(stlite_kernel) $(streamlit_wheel) $(sharing-common) yarn_install
$(sharing): packages/sharing/src/*.ts packages/sharing/src/*.tsx $(kernel) $(streamlit_wheel) $(sharing-common) yarn_install
cd packages/sharing; \
yarn build
@touch $@
Expand All @@ -71,26 +71,26 @@ $(sharing-editor): packages/sharing-editor/src/*.ts packages/sharing-editor/src/

.PHONY: playground
playground: $(playground)
$(playground): packages/playground/src/*.ts packages/playground/src/*.tsx packages/playground/public/* $(stlite_kernel) $(streamlit_wheel)
$(playground): packages/playground/src/*.ts packages/playground/src/*.tsx packages/playground/public/* $(kernel) $(streamlit_wheel)
cd packages/playground; \
yarn build
@touch $@

.PHONY: stlite-kernel
stlite-kernel: $(stlite_kernel)
$(stlite_kernel): packages/stlite-kernel/src/*.ts $(pyarrow_wheel) $(tornado_wheel) $(streamlit_wheel) $(streamlit_proto)
cd packages/stlite-kernel; \
.PHONY: kernel
kernel: $(kernel)
$(kernel): packages/kernel/src/*.ts $(pyarrow_wheel) $(tornado_wheel) $(streamlit_wheel) $(streamlit_proto)
cd packages/kernel; \
yarn build
@touch $@

$(pyarrow_wheel): $(VENV) packages/stlite-kernel/py/stlite-pyarrow/pyarrow/*.py
$(pyarrow_wheel): $(VENV) packages/kernel/py/stlite-pyarrow/pyarrow/*.py
. $(VENV)/bin/activate && \
cd packages/stlite-kernel/py/stlite-pyarrow && \
cd packages/kernel/py/stlite-pyarrow && \
poetry build

$(tornado_wheel): $(VENV) packages/stlite-kernel/py/tornado/tornado/*.py
$(tornado_wheel): $(VENV) packages/kernel/py/tornado/tornado/*.py
. $(VENV)/bin/activate && \
cd packages/stlite-kernel/py/tornado && \
cd packages/kernel/py/tornado && \
TORNADO_EXTENSION=0 python -m build --wheel
@touch $@

Expand Down
6 changes: 2 additions & 4 deletions packages/desktop/bin/dump_snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ yargs(hideBin(process.argv))
})
.parseAsync()
.then(async (args) => {
const stliteKernelDir = path.dirname(
require.resolve("@stlite/stlite-kernel")
); // -> /path/to/stlite-kernel/dist
const stliteKernelPyDir = path.resolve(stliteKernelDir, "../py"); // -> /path/to/stlite-kernel/py
const stliteKernelDir = path.dirname(require.resolve("@stlite/kernel")); // -> /path/to/kernel/dist
const stliteKernelPyDir = path.resolve(stliteKernelDir, "../py"); // -> /path/to/kernel/py
await createSitePackagesSnapshot({
localWheelPaths: {
pyarrow: path.join(
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@craco/craco": "^6.1.2",
"@stlite/stlite-kernel": "^0.9.0",
"@stlite/kernel": "^0.9.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^13.1.9",
"@types/jest": "^26.0.19",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { StliteKernel, StliteKernelOptions } from "@stlite/stlite-kernel";
import { StliteKernel, StliteKernelOptions } from "@stlite/kernel";
import StreamlitApp from "./StreamlitApp";

let pyodideEntrypointUrl: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/src/StreamlitApp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { StliteKernel, StliteKernelProvider } from "@stlite/stlite-kernel";
import { StliteKernel, StliteKernelProvider } from "@stlite/kernel";

import ThemedApp from "streamlit-browser/src/ThemedApp";
import { Client as Styletron } from "styletron-engine-atomic";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stlite/stlite-kernel",
"name": "@stlite/kernel",
"description": "",
"version": "0.9.0",
"license": "Apache-2.0",
Expand Down
File renamed without changes.
Loading