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

Remove generated code #1139

Merged
merged 13 commits into from
Nov 28, 2024
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
19 changes: 11 additions & 8 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build extension

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
Expand All @@ -14,11 +11,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
npm-version: '10.9.0'
node-version: 'lts/*'

- name: Install Yarn
run: corepack enable

- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -37,6 +38,7 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Setup yarn cache
uses: actions/cache@v3
id: yarn-cache
Expand All @@ -48,9 +50,10 @@ jobs:

- name: Install dependencies
run: python -m pip install -U jupyterlab jupyter_packaging jupyterlab_widgets

- name: Use existing lockfile
run: yarn install --frozen-lockfile

- name: Build the extension
working-directory: js
run: |
npm install
run: npm install
15 changes: 14 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Test

on:
push:
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -44,6 +43,20 @@ jobs:
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: false # https://github.com/conda-incubator/setup-miniconda/issues/264

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install Yarn
run: corepack enable

- name: Build labextension
run: |
cd js
npm install
cd ..

- name: Run tests
run: |
python -m pytest -vs tests --cov=nglview --cov-report=html --disable-pytest-warnings
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include nglview/datafiles/*
recursive-include nglview/static *.*
recursive-include nglview/staticlab *.*
recursive-include nglview/nbextension *.*
recursive-include nglview/labextension *.*
include nglview/theme/*
include LICENSE README.md DEVELOPMENT.md CHANGELOG.md
include setup.py
Expand Down
14 changes: 0 additions & 14 deletions devtools/release.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
#!/usr/bin/env python

"""
Steps:
- cd nglview/static
- git rm -rf ./*

- cd nglview/staticlab
- git rm -rf ./*

- cd js
- npm install
- cd ../nglview
- git add static staticlab
"""

import subprocess
import sys
from pathlib import Path
Expand Down
2 changes: 2 additions & 0 deletions js/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn==1.22.19
node==22.11.0
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"scripts": {
"prepublish": "yarn build:prod && webpack && yarn run copy:labextension",
"copy:labextension": "cp -r nglview-js-widgets/labextension/* ../nglview/staticlab/",
"copy:labextension": "mkdir -p ../nglview/labextension && cp -r nglview-js-widgets/labextension/* ../nglview/labextension/",
"build": "yarn run build:lib && yarn run build:labextension:dev",
"build:prod": "yarn run build:lib && yarn run build:labextension",
"build:labextension": "jupyter labextension build .",
Expand Down
4 changes: 2 additions & 2 deletions js/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = [
entry: './lib/extension.js',
output: {
filename: 'extension.js',
path: path.resolve(__dirname, '..', 'nglview', 'static'),
path: path.resolve(__dirname, '..', 'nglview', 'nbextension'),
libraryTarget: 'amd'
},
mode: 'production'
Expand All @@ -44,7 +44,7 @@ module.exports = [
entry: './lib/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, '..', 'nglview', 'static'),
path: path.resolve(__dirname, '..', 'nglview', 'nbextension'),
libraryTarget: 'amd'
},
devtool: 'source-map',
Expand Down
2 changes: 1 addition & 1 deletion nglview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
def _jupyter_nbextension_paths():
return [{
'section': 'notebook',
'src': 'static',
'src': 'nbextension',
'dest': 'nglview-js-widgets',
'require': 'nglview-js-widgets/extension'
}]
Expand Down
Binary file removed nglview/static/35d57320d9df28ec0d0d8bd1b5c75983.png
Binary file not shown.
Binary file removed nglview/static/5cbbd560bcf30acb95dd3b0b0d61645a.png
Binary file not shown.
Binary file removed nglview/static/92bef7e45fed3caba8dc9348edef4df2.png
Binary file not shown.
Binary file removed nglview/static/d1b818587c3bc65058fe43800e4a191c.png
Binary file not shown.
1 change: 0 additions & 1 deletion nglview/static/extension.js

This file was deleted.

Binary file removed nglview/static/f423048bf942a7a33b33b1b982ecdb51.png
Binary file not shown.
Binary file removed nglview/static/f5d5fce2f36b5776eab8b314efc2dfd8.png
Binary file not shown.
3 changes: 0 additions & 3 deletions nglview/static/index.js

This file was deleted.

Loading
Loading