diff --git a/.github/workflows/build-change-of-basis.yml b/.github/workflows/build-change-of-basis.yml deleted file mode 100644 index 3b2294c5..00000000 --- a/.github/workflows/build-change-of-basis.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Build change-of-basis - -on: - workflow_dispatch: - -env: - branch_name: change-of-basis - -jobs: - test_and_build: - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - #- { os: ubuntu-latest, py: 3.8, doc: 1 } - - { os: windows-latest, py: 3.9, exe: 1, whl: 1 } - #- { os: macos-latest, py: 3.8, whl: 1 } - # all using to stable abi - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.branch_name }} - - - name: Set up Python ${{ matrix.config.py }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.config.py }} - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install .[dev,webview] - python setup.py build - mkdir unstable - - - name: Run tests - run: | - pytest -v - python check_examples.py --chisq - env: - MPLBACKEND: agg - - - name: Build binary wheel - run: | - python setup.py bdist_wheel - - - name: Build source distribution - run: | - python setup.py sdist --formats=zip - mv dist\*.zip "unstable\Refl1D-$($env:branch_name)-source.zip" - ls - - - name: Build installer - run: | - pwsh -command ".\$GITHUB_WORKSPACE\extra\build_win_installer_unstable.ps1" - mv dist\Refl1D*.zip "unstable\Refl1D-windows-exe-$($env:branch_name).zip" - - # See the following for how to upload to a release - # https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ - - name: Archive artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts - path: | - unstable/* - - updateUnstable: - needs: test_and_build - runs-on: ubuntu-latest - steps: - - name: Retrieve all artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts - - - name: show files - run: | - ls * -l - - - name: repack self-extracting - run: | - sudo apt-get install -y p7zip-full - mkdir self_extracting - curl -L https://www.7-zip.org/a/7z2106-x64.exe --output 7z.exe - 7z e 7z.exe -aoa -oself_extracting 7z.sfx - unzip "Refl1D-windows-exe-$branch_name.zip" -d self_extracting - cd self_extracting && 7z a -mhe=on -mx=1 -sfx7z.sfx "../Refl1D-$branch_name-self-extracting.exe" Refl1D*/ - - - name: Update release assets and text - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs'); - const { owner, repo } = context.repo; - let sid_release = await github.rest.repos.getReleaseByTag({ - owner, - repo, - tag: "sid" - }); - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: sid_release.data.id, - body: "A persistent prerelease where build artifacts for the current tip will be deposited\n\n## Last updated: " + (new Date()).toDateString() - }); - // delete existing release assets (if needed) and upload new ones: - const to_update = ["Refl1D-windows-exe-${{ env.branch_name }}.zip", "Refl1D-${{ env.branch_name }}-source.zip", "Refl1D-${{ env.branch_name }}-self-extracting.exe"]; - for (let fn of to_update) { - let asset_id = (sid_release.data.assets.find((a) => (a.name == fn)) ?? {}).id; - if (asset_id) { - await github.rest.repos.deleteReleaseAsset({ - owner, - repo, - asset_id - }); - } - await github.rest.repos.uploadReleaseAsset({ - owner, - repo, - release_id: sid_release.data.id, - name: fn, - data: await fs.readFileSync(fn) - }); - } diff --git a/.github/workflows/build-webview-jupyter-macos.yml b/.github/workflows/build-webview-jupyter-macos.yml deleted file mode 100644 index 2ec9738c..00000000 --- a/.github/workflows/build-webview-jupyter-macos.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Build webview with Jupyter for macos - -on: - workflow_dispatch: - -env: - branch_name: webview - -jobs: - test_and_build: - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - #- { os: ubuntu-latest, py: 3.8, doc: 1 } - # - { os: windows-latest, py: "3.10", exe: 1, whl: 1 } - - { os: macos-latest, py: "3.10", whl: 1 } - # all using to stable abi - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ env.branch_name }} - - - name: Set up Python ${{ matrix.config.py }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.config.py }} - - - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.config.py }} - - - name: Build installer - run: | - ./extra/build_conda_packed_jupyter.sh - mkdir unstable - pwd - mv refl1d-webview* ./unstable/ - - # See the following for how to upload to a release - # https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ - - name: Archive artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - unstable/* - - updateUnstable: - needs: test_and_build - runs-on: ubuntu-latest - steps: - - name: Retrieve all artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - - - name: show files - run: | - ls * -l - - - name: Update release assets and text - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs'); - const { owner, repo } = context.repo; - let sid_release = await github.rest.repos.getReleaseByTag({ - owner, - repo, - tag: "sid" - }); - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: sid_release.data.id, - body: "A persistent prerelease where build artifacts for the current tip will be deposited\n\n## Last updated: " + (new Date()).toDateString() - }); - // delete existing release assets (if needed) and upload new ones: - const globber = await glob.create("**"); - const to_update = await globber.glob(); - // const to_update = ["refl1d-webview-jupyter-0.8.15-Darwin-arm64.tar.gz", "refl1d-webview-jupyter.pkg"]; - for (let fn of to_update) { - let asset_id = (sid_release.data.assets.find((a) => (a.name == fn)) ?? {}).id; - if (asset_id) { - await github.rest.repos.deleteReleaseAsset({ - owner, - repo, - asset_id - }); - } - await github.rest.repos.uploadReleaseAsset({ - owner, - repo, - release_id: sid_release.data.id, - name: fn, - data: await fs.readFileSync(fn) - }); - } diff --git a/.github/workflows/build-webview-jupyter.yml b/.github/workflows/build-webview-jupyter.yml deleted file mode 100644 index 302f9051..00000000 --- a/.github/workflows/build-webview-jupyter.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build webview with Jupyter - -on: - workflow_dispatch: - -env: - branch_name: webview - -jobs: - test_and_build: - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - - { os: ubuntu-latest, py: 3.11 } - - { os: windows-latest, py: "3.11" } - - { os: macos-latest, py: "3.11" } - - { os: macos-13, py: "3.11" } - # all using to stable abi - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.branch_name }} - - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - python-version: ${{ matrix.config.py }} - shell: bash - - - name: Build webview packed - shell: bash -el {0} - run: | - conda activate base - ./extra/build_conda_packed_jupyter.sh - ls artifacts - - name: Update release assets and text - uses: actions/github-script@v7 - env: - SEARCH_PATTERN: "artifacts/*" - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const script = require('./.github/actions/update_unstable.js'); - const output = await script({github, context, glob}); - console.log(output); \ No newline at end of file diff --git a/.github/workflows/build-webview-linux.yml b/.github/workflows/build-webview-linux.yml deleted file mode 100644 index a11d32db..00000000 --- a/.github/workflows/build-webview-linux.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Build webview for linux - -on: - workflow_dispatch: - -env: - branch_name: webview - -jobs: - test_and_build: - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - - { os: ubuntu-latest, py: 3.11, whl: 1 } - # - { os: windows-latest, py: "3.10", exe: 1, whl: 1 } - # - { os: macos-latest, py: "3.10", whl: 1 } - # all using to stable abi - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ env.branch_name }} - - - name: Set up Python ${{ matrix.config.py }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.config.py }} - - - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.config.py }} - - - name: Build webview packed (linux) - run: | - ./extra/build_conda_packed.sh - mkdir unstable - pwd - mv refl1d-webview* ./unstable/ - - # See the following for how to upload to a release - # https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ - - name: Archive artifacts - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - unstable/* - - updateUnstable: - needs: test_and_build - runs-on: ubuntu-latest - steps: - - name: Retrieve all artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - - - name: show files - run: | - ls * -l - - - name: Update release assets and text - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs'); - const path = require('path'); - const { owner, repo } = context.repo; - let sid_release = await github.rest.repos.getReleaseByTag({ - owner, - repo, - tag: "sid" - }); - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: sid_release.data.id, - body: "A persistent prerelease where build artifacts for the current tip will be deposited\n\n## Last updated: " + (new Date()).toDateString() - }); - // delete existing release assets (if needed) and upload new ones: - const globber = await glob.create("*", {followSymbolicLinks: false}); - const full_paths = await globber.glob(); - const to_update = full_paths.map((f) => path.basename(f)); - console.log({to_update}); - // const to_update = ["refl1d-webview-jupyter-0.8.15-Darwin-arm64.tar.gz", "refl1d-webview-jupyter.pkg"]; - for (let fn of to_update) { - let asset_id = (sid_release.data.assets.find((a) => (a.name == fn)) ?? {}).id; - if (asset_id) { - await github.rest.repos.deleteReleaseAsset({ - owner, - repo, - asset_id - }); - } - await github.rest.repos.uploadReleaseAsset({ - owner, - repo, - release_id: sid_release.data.id, - name: fn, - data: await fs.readFileSync(fn) - }); - } diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml deleted file mode 100644 index 0cd56b35..00000000 --- a/.github/workflows/unstable.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Build_Unstable - -on: - push: - branches: [ master_v0 ] - pull_request: - branches: [ master_v0 ] - release: - types: [ published ] - -env: - branch_name: master_v0 - -jobs: - test_and_build: - runs-on: ${{ matrix.config.os }} - strategy: - matrix: - config: - #- { os: ubuntu-latest, py: 3.8, doc: 1 } - - { os: windows-latest, py: 3.9, exe: 1, whl: 1 } - #- { os: macos-latest, py: 3.8, whl: 1 } - # all using to stable abi - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.branch_name }} - - - name: Set up Python ${{ matrix.config.py }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.config.py }} - - - name: Install Python dependencies - run: | - pip install --upgrade pip - pip install .[dev,webview] - python setup.py build - mkdir unstable - - - name: Run tests - run: | - pytest -v - python check_examples.py --chisq - env: - MPLBACKEND: agg - - - name: Build binary wheel - run: | - python setup.py bdist_wheel - - - name: Build source distribution - run: | - python setup.py sdist --formats=zip - mv dist\*.zip "unstable\Refl1D-$($env:branch_name)-source.zip" - ls - - - name: Build installer - run: | - pwsh -command ".\$GITHUB_WORKSPACE\extra\build_win_installer_unstable.ps1" - mv dist\Refl1D*.zip "unstable\Refl1D-windows-exe-$($env:branch_name).zip" - - # See the following for how to upload to a release - # https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ - - name: Archive artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts - path: | - unstable/* - - updateUnstable: - needs: test_and_build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.branch_name }} - - - name: Retrieve all artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts - path: artifacts - - - name: show files - run: | - ls * -l - - - name: repack self-extracting - run: | - sudo apt-get install -y p7zip-full - mkdir self_extracting - curl -L https://www.7-zip.org/a/7z2106-x64.exe --output 7z.exe - 7z e 7z.exe -aoa -oself_extracting 7z.sfx - unzip "artifacts/Refl1D-windows-exe-$branch_name.zip" -d self_extracting - cd self_extracting && 7z a -mhe=on -mx=1 -sfx7z.sfx "../artifacts/Refl1D-$branch_name-self-extracting.exe" Refl1D*/ - - - name: Update release assets and text - uses: actions/github-script@v7 - env: - SEARCH_PATTERN: "artifacts/*" - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const script = require('./.github/actions/update_unstable.js'); - const output = await script({github, context, glob}); - console.log(output); diff --git a/refl1d/webview/build_client.py b/refl1d/webview/build_client.py index 00768c86..5ae63da6 100644 --- a/refl1d/webview/build_client.py +++ b/refl1d/webview/build_client.py @@ -25,6 +25,7 @@ def build_client( # link to the local version of bumps: if link_bumps: import bumps.webview + bumps_path = Path(bumps.webview.__file__).parent / "client" # install the local version of bumps