diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 548ae51b..43a0fa49 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -11,6 +11,15 @@ concurrency: cancel-in-progress: true jobs: + get-pr: + # https://dev.to/suzukishunsuke/secure-github-actions-by-pullrequesttarget-641 + outputs: + merge_commit_sha: ${{steps.pr.outputs.merge_commit_sha}} + runs-on: ubuntu-latest + steps: + - uses: suzuki-shunsuke/get-pr-action@v0.1.0 + id: pr + test-utils: runs-on: ubuntu-latest steps: @@ -51,3 +60,53 @@ jobs: npm install npm run build working-directory: ./aiida-registry-app + + preview: + # This job is triggered by from PR from the aiida-registry repo, the developer of aiida-registry need to see the preview page of the PR + needs: [test-webpage-build, get-pr] + if: github.repository == 'aiidateam/aiida-registry' + runs-on: ubuntu-latest + strategy: + fail-fast: false + timeout-minutes: 180 + env: + COMMIT_AUTHOR: Deploy Action + COMMIT_AUTHOR_EMAIL: action@github.com + VITE_PR_PREVIEW_PATH: "/aiida-registry/pr-preview/pr-${{ github.event.number }}/" + + steps: + - name: Checkout Repo ⚡️ + uses: actions/checkout@v4 + with: + ref: ${{needs.get-pr.outputs.merge_commit_sha}} + - name: Create dev environment + uses: ./.github/actions/create-dev-env + + - name: Generate metadata + uses: ./.github/actions/generate-metadata + with: + gh_token: ${{ secrets.GITHUB_TOKEN }} + cache: false + + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install npm dependencies and build + run: | + echo $VITE_PR_PREVIEW_PATH + npm install + npm run build + working-directory: ./aiida-registry-app + + - name: Add plugins file to the build folder + run: cp plugins_metadata.json aiida-registry-app/dist/ + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./aiida-registry-app/dist + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto + custom-url: + token: ${{ secrets.BOT_COMMENT_TOKEN }} # use aiida-bot token to deploy the preview diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fda870f3..667aa6ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: end-of-file-fixer - id: fix-encoding-pragma @@ -13,7 +13,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.3.3 + rev: v0.4.2 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] diff --git a/aiida_registry/test_install.py b/aiida_registry/test_install.py index 22708921..1001c3da 100644 --- a/aiida_registry/test_install.py +++ b/aiida_registry/test_install.py @@ -120,7 +120,7 @@ def test_install_one_docker(container_image, plugin): user=user, ) install_package = container.exec_run( - f'pip install --constraint /tmp/pip-constraint.txt --pre {plugin["pip_url"]}', + f'pip install --constraint /tmp/pip-constraint.txt {plugin["pip_url"]}', user=user, ) diff --git a/bin/analyze_entrypoints.py b/bin/analyze_entrypoints.py index 0ce76097..f49f88ab 100644 --- a/bin/analyze_entrypoints.py +++ b/bin/analyze_entrypoints.py @@ -15,6 +15,12 @@ from typing import Dict, List import click +from aiida import load_profile +from aiida.storage.sqlite_temp import SqliteTempBackend + +# Load AiiDA profile +temp_profile = SqliteTempBackend.create_profile("temp-profile") +load_profile(temp_profile, allow_switch=True) ENTRY_POINT_GROUPS = [ "aiida.calculations", diff --git a/plugins.yaml b/plugins.yaml index 38f9e471..54e9be40 100644 --- a/plugins.yaml +++ b/plugins.yaml @@ -105,7 +105,7 @@ aiida-ddec: code_home: https://github.com/lsmo-epfl/aiida-ddec entry_point_prefix: ddec pip_url: git+https://github.com/yakutovicha/aiida-ddec - plugin_info: https://raw.githubusercontent.com/lsmo-epfl/aiida-ddec/master/setup.json + plugin_info: https://raw.githubusercontent.com/lsmo-epfl/aiida-ddec/master/pyproject.toml aiida-defects: code_home: https://github.com/epfl-theos/aiida-defects entry_point_prefix: defects @@ -129,7 +129,7 @@ aiida-environ: code_home: https://github.com/environ-developers/aiida-environ entry_point_prefix: environ pip_url: git+https://github.com/environ-developers/aiida-environ - plugin_info: https://raw.github.com/environ-developers/aiida-environ/master/setup.json + plugin_info: https://raw.github.com/environ-developers/aiida-environ/master/pyproject.toml aiida-eon: code_home: https://github.com/HaoZeke/aiida-eon entry_point_prefix: eon @@ -137,10 +137,10 @@ aiida-eonclient: code_home: https://github.com/HaoZeke/aiida-eonclient entry_point_prefix: eonclient aiida-fenics: - code_home: https://github.com/sphuber/aiida-fenics/tree/master + code_home: https://github.com/broeder-j/aiida-fenics/tree/master entry_point_prefix: fenics - pip_url: git+https://github.com/sphuber/aiida-fenics - plugin_info: https://raw.github.com/sphuber/aiida-fenics/master/setup.json + pip_url: git+https://github.com/broeder-j/aiida-fenics + plugin_info: https://raw.github.com/broeder-j/aiida-fenics/master/setup.json aiida-firecrest: code_home: https://github.com/aiidateam/aiida-firecrest entry_point_prefix: firecrest @@ -164,7 +164,7 @@ aiida-flexpart: code_home: https://github.com/aiidaplugins/aiida-flexpart entry_point_prefix: flexpart pip_url: git+https://github.com/aiidaplugins/aiida-flexpart - plugin_info: https://raw.githubusercontent.com/aiidaplugins/aiida-flexpart/main/setup.json + plugin_info: https://raw.githubusercontent.com/aiidaplugins/aiida-flexpart/main/pyproject.toml aiida-gaussian: code_home: https://github.com/nanotech-empa/aiida-gaussian entry_point_prefix: gaussian @@ -218,7 +218,7 @@ aiida-lammps: development_status: beta entry_point_prefix: lammps pip_url: git+https://github.com/aiidaplugins/aiida-lammps - plugin_info: https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/master/setup.json + plugin_info: https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/master/pyproject.toml aiida-lsmo: code_home: https://github.com/lsmo-epfl/aiida-lsmo development_status: stable @@ -243,14 +243,14 @@ aiida-nanotech-empa: development_status: beta entry_point_prefix: nanotech_empa pip_url: git+https://github.com/nanotech-empa/aiida-nanotech-empa - plugin_info: https://raw.githubusercontent.com/nanotech-empa/aiida-nanotech-empa/master/setup.json + plugin_info: https://raw.githubusercontent.com/nanotech-empa/aiida-nanotech-empa/master/pyproject.toml aiida-nims-scheduler: code_home: https://github.com/atztogo/aiida-nims-scheduler development_status: stable documentation_url: https://github.com/atztogo/aiida-nims-scheduler entry_point_prefix: nims_scheduler pip_url: git+https://github.com/atztogo/aiida-nims-scheduler - plugin_info: https://raw.githubusercontent.com/atztogo/aiida-nims-scheduler/master/setup.json + plugin_info: https://raw.githubusercontent.com/atztogo/aiida-nims-scheduler/master/pyproject.toml aiida-nwchem: code_home: https://github.com/aiidateam/aiida-nwchem documentation_url: https://aiida-nwchem.readthedocs.io/ @@ -332,10 +332,10 @@ aiida-quantumespresso: pip_url: aiida-quantumespresso plugin_info: https://raw.github.com/aiidateam/aiida-quantumespresso/master/setup.json aiida-quantumespresso-hp: - code_home: https://github.com/sphuber/aiida-quantumespresso-hp + code_home: https://github.com/aiidateam/aiida-quantumespresso-hp entry_point_prefix: quantumespresso.hp - pip_url: git+https://github.com/sphuber/aiida-quantumespresso-hp - plugin_info: https://raw.githubusercontent.com/sphuber/aiida-quantumespresso-hp/master/setup.json + pip_url: git+https://github.com/aiidateam/aiida-quantumespresso-hp + plugin_info: https://raw.githubusercontent.com/aiidateam/aiida-quantumespresso-hp/master/pyproject.toml aiida-raspa: code_home: https://github.com/yakutovicha/aiida-raspa entry_point_prefix: raspa @@ -451,12 +451,12 @@ aiida-yascheduler: documentation_url: https://github.com/tilde-lab/yascheduler entry_point_prefix: yascheduler pip_url: yascheduler - plugin_info: https://raw.githubusercontent.com/tilde-lab/yascheduler/master/setup.json + plugin_info: https://raw.githubusercontent.com/tilde-lab/yascheduler/master/pyproject.toml aiida-z2pack: code_home: https://github.com/AntimoMarrazzo/aiida-z2pack entry_point_prefix: z2pack pip_url: git+https://github.com/AntimoMarrazzo/aiida-z2pack - plugin_info: https://raw.githubusercontent.com/antimomarrazzo/aiida-z2pack/master/setup.json + plugin_info: https://raw.githubusercontent.com/antimomarrazzo/aiida-z2pack/master/pyproject.toml aiida-zeopp: code_home: https://github.com/lsmo-epfl/aiida-zeopp development_status: stable