Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Nov 16, 2023
1 parent a853399 commit a059d86
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 17 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,29 @@ jobs:
shell: bash -l {0}
run: |
set -eux
python -m pip install . -vvv
jupyter labextension list 2>&1 | grep -ie "jupytercad.*OK"
yarn dev
jupyter labextension list 2>&1 | grep -ie "jupytercad-core.*OK"
jupyter labextension list 2>&1 | grep -ie "jupytercad-lab.*OK"
- name: Test import
shell: bash -l {0}
run: python -c "import jupytercad"
run: python -c "import jupytercad_app"

- name: Package the extension
shell: bash -l {0}
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupytercad" jupyterlab
yarn build:packages
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: extension-artifacts
path: dist/jupytercad*
path: |
python/jupytercad-core/dist/jupytercad*
python/jupytercad-lab/dist/jupytercad*
python/jupytercad-app/dist/jupytercad*
if-no-files-found: error

test_isolated:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install Dependencies
run: |
pip install -e .
yarn dev
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"lint": "jlpm run prettier && jlpm run eslint",
"test": "lerna run test",
"dev": "python scripts/dev-install.py",
"build:packages": "python scripts/build_packages.py",
"watch:lib": "lerna run --stream watch",
"watch": "lerna watch -- lerna run build --scope=\\$LERNA_PACKAGE_NAME --include-dependents",
"build:lab": "lerna run --ignore @jupytercad/jupytercad-app build",
Expand Down
6 changes: 2 additions & 4 deletions python/jupytercad-app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ source = "nodejs"
fields = ["description", "authors", "urls"]

[tool.hatch.build.targets.sdist]
artifacts = ["jupytercad_app/labextension"]
artifacts = ["jupytercad_app/static"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"jupytercad_app/labextension" = "share/jupyter/labextensions/jupytercad-app"
"install.json" = "share/jupyter/labextensions/jupytercad-app/install.json"
"jupyter-config/server-config" = "etc/jupyter/jupyter_server_config.d"

[tool.hatch.build.hooks.version]
Expand Down Expand Up @@ -73,7 +71,7 @@ before-build-npm = [
"jlpm",
"jlpm build:prod",
]
before-build-python = ["jlpm clean:all"]
before-build-python = ["jlpm clean"]

[tool.check-wheel-contents]
ignore = ["W002"]
Expand Down
2 changes: 1 addition & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# minimum needed to build jupytercad.
datamodel-code-generator>=0.23.0
pydantic==2.4
pydantic==2.4.2
24 changes: 24 additions & 0 deletions scripts/build_packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import subprocess
from pathlib import Path


def execute(cmd: str, cwd=None):
subprocess.run(cmd.split(" "), check=True, cwd=cwd)


def build_packages():
root_path = Path(__file__).parents[1]
requirements_build_path = root_path / "requirements-build.txt"
install_build_deps = f"python -m pip install -r {requirements_build_path}"

python_package_prefix = "python"
python_packages = ["jupytercad-core", "jupytercad-lab", "jupytercad-app"]

execute(install_build_deps)

for py_package in python_packages:
execute("python -m build", cwd=root_path / python_package_prefix / py_package)


if __name__ == "__main__":
build_packages()
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12267,21 +12267,21 @@ __metadata:

"typescript@patch:typescript@>=3 < 6#~builtin<compat/typescript>, typescript@patch:typescript@^5#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=f3b441"
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=85af82"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca
checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554
languageName: node
linkType: hard

"typescript@patch:typescript@~5.0.2#~builtin<compat/typescript>":
version: 5.0.4
resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=b5f058"
resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=85af82"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac
checksum: bb309d320c59a26565fb3793dba550576ab861018ff3fd1b7fccabbe46ae4a35546bc45f342c0a0b6f265c801ccdf64ffd68f548f117ceb7f0eac4b805cd52a9
languageName: node
linkType: hard

Expand Down

0 comments on commit a059d86

Please sign in to comment.