aiida-jqmc 0.1.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiida_jqmc-0.1.0a1/.github/jqmc_lower_bound.py +48 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-build-distributions.yml +137 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-build-docs.yml +43 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-deploy-gh-pages.yml +44 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-deploy-test.yml +44 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-deploy.yml +72 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-distribution-check.yml +49 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-lint-ruff.yml +35 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-pr-policy-comment.yml +95 -0
- aiida_jqmc-0.1.0a1/.github/workflows/public-verify-index.yml +89 -0
- aiida_jqmc-0.1.0a1/.gitignore +232 -0
- aiida_jqmc-0.1.0a1/LICENSE +28 -0
- aiida_jqmc-0.1.0a1/PKG-INFO +213 -0
- aiida_jqmc-0.1.0a1/README.md +174 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/__init__.py +37 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/_build_info.py +86 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/_version.py +4 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/calculations/__init__.py +33 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/calculations/jqmc.py +427 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/calculations/tool.py +419 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/parsers/__init__.py +33 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/parsers/jqmc.py +177 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/parsers/tool.py +191 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/schemas.py +858 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/statistics.py +222 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/tiling.py +182 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/utils.py +63 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/workflows/__init__.py +33 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc/workflows/restart.py +311 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/PKG-INFO +213 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/SOURCES.txt +155 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/dependency_links.txt +1 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/entry_points.txt +10 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/requires.txt +18 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/scm_file_list.json +150 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/scm_version.json +8 -0
- aiida_jqmc-0.1.0a1/aiida_jqmc.egg-info/top_level.txt +1 -0
- aiida_jqmc-0.1.0a1/doc/Makefile +20 -0
- aiida_jqmc-0.1.0a1/doc/agents.md +130 -0
- aiida_jqmc-0.1.0a1/doc/api_reference.md +60 -0
- aiida_jqmc-0.1.0a1/doc/calculations.md +226 -0
- aiida_jqmc-0.1.0a1/doc/changelog.md +69 -0
- aiida_jqmc-0.1.0a1/doc/conf.py +138 -0
- aiida_jqmc-0.1.0a1/doc/development.md +64 -0
- aiida_jqmc-0.1.0a1/doc/examples.md +62 -0
- aiida_jqmc-0.1.0a1/doc/index.md +64 -0
- aiida_jqmc-0.1.0a1/doc/install.md +116 -0
- aiida_jqmc-0.1.0a1/doc/overview.md +69 -0
- aiida_jqmc-0.1.0a1/doc/quickstart.md +140 -0
- aiida_jqmc-0.1.0a1/doc/tools.md +181 -0
- aiida_jqmc-0.1.0a1/doc/workflows.md +135 -0
- aiida_jqmc-0.1.0a1/examples/README.md +89 -0
- aiida_jqmc-0.1.0a1/examples/_runner.py +234 -0
- aiida_jqmc-0.1.0a1/examples/config.example.toml +56 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example01/run_aiida.py +90 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example02/run_aiida.py +74 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example03/run_aiida.py +57 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example04/run_aiida.py +114 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example05/run_aiida.py +73 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example06/run_aiida.py +89 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example07/run_aiida.py +77 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example08/run_aiida.py +70 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example09/run_aiida.py +124 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example10/run_aiida.py +98 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example14/README.md +16 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-example14/run_aiida.py +138 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example01/run_aiida.py +141 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example02/run_aiida.py +133 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example03/run_aiida.py +111 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example04/run_aiida.py +209 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example05/run_aiida.py +101 -0
- aiida_jqmc-0.1.0a1/examples/jqmc-workflow-example06/run_aiida.py +98 -0
- aiida_jqmc-0.1.0a1/pyproject.toml +88 -0
- aiida_jqmc-0.1.0a1/scripts/check_built_distributions.py +91 -0
- aiida_jqmc-0.1.0a1/scripts/check_installed_aiida_jqmc.py +194 -0
- aiida_jqmc-0.1.0a1/setup.cfg +4 -0
- aiida_jqmc-0.1.0a1/tests/__init__.py +31 -0
- aiida_jqmc-0.1.0a1/tests/_test_data_cache.py +228 -0
- aiida_jqmc-0.1.0a1/tests/conftest.py +206 -0
- aiida_jqmc-0.1.0a1/tests/data/H2_ecp_ccpvdz_cart.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/H2_ecp_ccpvdz_jsd.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/lrdmc_bra_high.out +569 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/lrdmc_bra_max_time_low.out +400 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/lrdmc_tau_high.out +463 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/mcmc_high.out +326 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/mcmc_mixed_mpc_high.out +255 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/mcmc_twist_stopped_by_max_time.out +340 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/mcmc_twist_stress_mpc_high.out +377 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/vmc_bspline_dtn_high.out +971 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/vmc_high.out +833 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/vmc_jagp_low.out +883 -0
- aiida_jqmc-0.1.0a1/tests/data/cluster/vmc_restart_low.out +564 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/README.md +43 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/mcmc_pbc_pgto_forces_stress_mpc_high.out +427 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/mcmc_twist_stopped_8_twists.out +143 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/vmc_lm_high.out +546 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/vmc_lm_low.out +445 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/vmc_mo_high.out +576 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/vmc_sr_high.out +533 -0
- aiida_jqmc-0.1.0a1/tests/data/localhost/vmc_twist_8_twists_low.out +178 -0
- aiida_jqmc-0.1.0a1/tests/data/lrdmc_bra_invalid.err +13 -0
- aiida_jqmc-0.1.0a1/tests/data/lrdmc_bra_invalid.out +68 -0
- aiida_jqmc-0.1.0a1/tests/data/mcmc.out +250 -0
- aiida_jqmc-0.1.0a1/tests/data/mcmc_max_time.out +255 -0
- aiida_jqmc-0.1.0a1/tests/data/pseudopotentials.toml +20 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_gamma/li_scf.in +50 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_gamma/out/li.save/data-file-schema.xml +1111 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_gamma/out/li.save/wfc1.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/li_scf.in +61 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/data-file-schema.xml +939 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc1.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc2.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc3.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc4.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc5.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc6.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc7.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/qe/Li_k_twist/out/li_twist.save/wfc8.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/README.md +21 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/hamiltonian/lithium_tiled_211_gamma.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/hamiltonian/lithium_tiled_211_twist_average.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/li_nscf.in +64 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/li_scf.in +59 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/out/li_tiling.save/data-file-schema.xml +847 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/out/li_tiling.save/wfc1.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/out/li_tiling.save/wfc2.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/out/li_tiling.save/wfc3.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/qe/out/li_tiling.save/wfc4.hdf5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/trexio/lithium_tiling_sectors.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tiling/trexio/lithium_tiling_sectors_cart.h5 +0 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/convert.err +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/convert.out +5 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/extrapolate_one.err +46 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/extrapolate_one.out +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/lrdmc_energy.err +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/lrdmc_energy.out +4 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/mcmc_energy.err +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/mcmc_energy.out +4 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/mcmc_force_disabled.err +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/mcmc_force_disabled.out +5 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/qe.err +2 -0
- aiida_jqmc-0.1.0a1/tests/data/tool/qe.out +14 -0
- aiida_jqmc-0.1.0a1/tests/data/vmc.out +540 -0
- aiida_jqmc-0.1.0a1/tests/test_calculations.py +271 -0
- aiida_jqmc-0.1.0a1/tests/test_docs.py +126 -0
- aiida_jqmc-0.1.0a1/tests/test_parsers.py +278 -0
- aiida_jqmc-0.1.0a1/tests/test_restart.py +129 -0
- aiida_jqmc-0.1.0a1/tests/test_run_localhost.py +199 -0
- aiida_jqmc-0.1.0a1/tests/test_run_periodic_localhost.py +217 -0
- aiida_jqmc-0.1.0a1/tests/test_run_tools_localhost.py +207 -0
- aiida_jqmc-0.1.0a1/tests/test_schemas.py +205 -0
- aiida_jqmc-0.1.0a1/tests/test_statistics.py +166 -0
- aiida_jqmc-0.1.0a1/tests/test_tiling.py +339 -0
- aiida_jqmc-0.1.0a1/tests/test_tool.py +412 -0
- aiida_jqmc-0.1.0a1/tests/test_tool_parser.py +192 -0
- aiida_jqmc-0.1.0a1/tests/test_utils.py +79 -0
- aiida_jqmc-0.1.0a1/tests/test_workflows.py +318 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Print the jqmc lower bound X.Y.Z of pyproject.toml (`jqmc>=X.Y.Z`, a public jqmc release).
|
|
2
|
+
|
|
3
|
+
Used by the CI that tests the plugin with that release; needs `packaging`.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# Copyright (C) 2024- Kosuke Nakano
|
|
7
|
+
# All rights reserved.
|
|
8
|
+
#
|
|
9
|
+
# Redistribution and use in source and binary forms, with or without
|
|
10
|
+
# modification, are permitted provided that the following conditions
|
|
11
|
+
# are met:
|
|
12
|
+
#
|
|
13
|
+
# * Redistributions of source code must retain the above copyright
|
|
14
|
+
# notice, this list of conditions and the following disclaimer.
|
|
15
|
+
#
|
|
16
|
+
# * Redistributions in binary form must reproduce the above copyright
|
|
17
|
+
# notice, this list of conditions and the following disclaimer in
|
|
18
|
+
# the documentation and/or other materials provided with the
|
|
19
|
+
# distribution.
|
|
20
|
+
#
|
|
21
|
+
# * Neither the name of the jqmc project nor the names of its
|
|
22
|
+
# contributors may be used to endorse or promote products derived
|
|
23
|
+
# from this software without specific prior written permission.
|
|
24
|
+
#
|
|
25
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
27
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
28
|
+
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
29
|
+
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
30
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
31
|
+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
32
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
33
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
34
|
+
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
35
|
+
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
36
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
37
|
+
|
|
38
|
+
import tomllib
|
|
39
|
+
from pathlib import Path
|
|
40
|
+
|
|
41
|
+
from packaging.requirements import Requirement
|
|
42
|
+
|
|
43
|
+
with (Path(__file__).resolve().parents[1] / "pyproject.toml").open("rb") as handle:
|
|
44
|
+
dependencies = [Requirement(item) for item in tomllib.load(handle)["project"]["dependencies"]]
|
|
45
|
+
bounds = [spec.version for item in dependencies if item.name == "jqmc" for spec in item.specifier if spec.operator == ">="]
|
|
46
|
+
if len(bounds) != 1:
|
|
47
|
+
raise SystemExit("pyproject.toml must declare exactly one jqmc lower bound, jqmc>=X.Y.Z (a public jqmc release)")
|
|
48
|
+
print(bounds[0])
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
name: aiida-jQMC public distribution build
|
|
2
|
+
|
|
3
|
+
# One build-and-check recipe for the public distribution check, TestPyPI, PyPI
|
|
4
|
+
# and the wheel CI of forge, as jQMC's public-build-distributions.yml. No
|
|
5
|
+
# publishing credentials enter this workflow. It runs no plugin tests: the plugin is
|
|
6
|
+
# tested in forge.
|
|
7
|
+
#
|
|
8
|
+
# One sdist, then the one pure-Python wheel built FROM that sdist. The wheel is
|
|
9
|
+
# installed with its dependencies on every supported Python, with the lowest
|
|
10
|
+
# supported jqmc release (`jqmc>=X.Y.Z`, pinned) and with what a plain
|
|
11
|
+
# `pip install aiida-jqmc` resolves today, and the installed package is checked
|
|
12
|
+
# as a user runs it (scripts/check_installed_aiida_jqmc.py). `public-distributions`
|
|
13
|
+
# (what the deploy jobs publish) is assembled only after every check passed.
|
|
14
|
+
# A caller can name an artifact of the same run that holds one jqmc wheel: the
|
|
15
|
+
# wheel is then checked with that jqmc instead of the PyPI releases, on every
|
|
16
|
+
# supported Python.
|
|
17
|
+
on:
|
|
18
|
+
workflow_call:
|
|
19
|
+
inputs:
|
|
20
|
+
jqmc-wheel-artifact:
|
|
21
|
+
description: Artifact of this run with one jqmc wheel to install instead of jqmc from PyPI
|
|
22
|
+
type: string
|
|
23
|
+
default: ''
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
env:
|
|
29
|
+
OMP_NUM_THREADS: '1'
|
|
30
|
+
OPENBLAS_NUM_THREADS: '1'
|
|
31
|
+
|
|
32
|
+
jobs:
|
|
33
|
+
build:
|
|
34
|
+
name: Source distribution and wheel
|
|
35
|
+
if: contains(fromJSON('["jqmc-project/aiida-jQMC", "jqmc-project/aiida-jQMC-forge"]'), github.repository)
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
timeout-minutes: 15
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
- uses: actions/setup-python@v6
|
|
44
|
+
with:
|
|
45
|
+
python-version: '3.12'
|
|
46
|
+
- name: Install distribution tools
|
|
47
|
+
run: python -m pip install --upgrade build twine packaging
|
|
48
|
+
- name: Build the source distribution, then the wheel from it
|
|
49
|
+
# Without --sdist/--wheel, build makes the sdist and builds the wheel
|
|
50
|
+
# from the unpacked sdist, not from the checkout.
|
|
51
|
+
run: |
|
|
52
|
+
python -m build
|
|
53
|
+
python -m twine check --strict dist/*
|
|
54
|
+
- name: Validate the wheel against the source distribution
|
|
55
|
+
run: python scripts/check_built_distributions.py
|
|
56
|
+
- uses: actions/upload-artifact@v7
|
|
57
|
+
with:
|
|
58
|
+
name: built-distributions
|
|
59
|
+
path: dist/*
|
|
60
|
+
if-no-files-found: error
|
|
61
|
+
retention-days: 7
|
|
62
|
+
|
|
63
|
+
verify:
|
|
64
|
+
name: Wheel Python ${{ matrix.python }} jqmc ${{ matrix.jqmc }}
|
|
65
|
+
if: contains(fromJSON('["jqmc-project/aiida-jQMC", "jqmc-project/aiida-jQMC-forge"]'), github.repository)
|
|
66
|
+
needs: build
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
timeout-minutes: 30
|
|
69
|
+
strategy:
|
|
70
|
+
fail-fast: false
|
|
71
|
+
matrix:
|
|
72
|
+
# minimum: the lower bound of `jqmc>=X.Y.Z`, pinned. newest: what a
|
|
73
|
+
# plain `pip install aiida-jqmc` resolves today. wheel: the jqmc wheel
|
|
74
|
+
# of the jqmc-wheel-artifact input.
|
|
75
|
+
include: >-
|
|
76
|
+
${{ fromJSON(inputs.jqmc-wheel-artifact == ''
|
|
77
|
+
&& '[{"python": "3.11", "jqmc": "minimum"}, {"python": "3.12", "jqmc": "minimum"}, {"python": "3.12", "jqmc": "newest"}]'
|
|
78
|
+
|| '[{"python": "3.11", "jqmc": "wheel"}, {"python": "3.12", "jqmc": "wheel"}]') }}
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/checkout@v7
|
|
81
|
+
with:
|
|
82
|
+
persist-credentials: false
|
|
83
|
+
- uses: actions/setup-python@v6
|
|
84
|
+
with:
|
|
85
|
+
python-version: ${{ matrix.python }}
|
|
86
|
+
- uses: actions/download-artifact@v8
|
|
87
|
+
with:
|
|
88
|
+
name: built-distributions
|
|
89
|
+
path: dist
|
|
90
|
+
- if: matrix.jqmc == 'wheel'
|
|
91
|
+
uses: actions/download-artifact@v8
|
|
92
|
+
with:
|
|
93
|
+
name: ${{ inputs.jqmc-wheel-artifact }}
|
|
94
|
+
path: jqmc-wheel
|
|
95
|
+
- name: Install the wheel with its runtime dependencies
|
|
96
|
+
env:
|
|
97
|
+
JQMC_VERSIONS: ${{ matrix.jqmc }}
|
|
98
|
+
run: |
|
|
99
|
+
python -m pip install --upgrade pip
|
|
100
|
+
if [ "$JQMC_VERSIONS" = minimum ]; then
|
|
101
|
+
python -m pip install packaging
|
|
102
|
+
python -m pip install dist/*.whl "jqmc==$(python .github/jqmc_lower_bound.py)"
|
|
103
|
+
elif [ "$JQMC_VERSIONS" = wheel ]; then
|
|
104
|
+
test "$(ls jqmc-wheel/jqmc-*.whl | wc -l)" -eq 1
|
|
105
|
+
python -m pip install dist/*.whl jqmc-wheel/jqmc-*.whl
|
|
106
|
+
else
|
|
107
|
+
python -m pip install dist/*.whl
|
|
108
|
+
fi
|
|
109
|
+
python -m pip check
|
|
110
|
+
python -m pip show aiida-jqmc jqmc aiida-core | grep -E '^(Name|Version):'
|
|
111
|
+
- name: Check the installed plugin (entry points, input files, parser)
|
|
112
|
+
run: |
|
|
113
|
+
python -I scripts/check_installed_aiida_jqmc.py --commit "$GITHUB_SHA" \
|
|
114
|
+
tests/data/H2_ecp_ccpvdz_jsd.h5 tests/data/mcmc.out
|
|
115
|
+
|
|
116
|
+
collect:
|
|
117
|
+
name: Collect the tested distributions
|
|
118
|
+
if: contains(fromJSON('["jqmc-project/aiida-jQMC", "jqmc-project/aiida-jQMC-forge"]'), github.repository)
|
|
119
|
+
needs: verify
|
|
120
|
+
runs-on: ubuntu-latest
|
|
121
|
+
timeout-minutes: 5
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/download-artifact@v8
|
|
124
|
+
with:
|
|
125
|
+
name: built-distributions
|
|
126
|
+
path: dist
|
|
127
|
+
- name: Require the sdist and the wheel
|
|
128
|
+
run: |
|
|
129
|
+
ls -l dist
|
|
130
|
+
test "$(ls dist/*.tar.gz | wc -l)" -eq 1
|
|
131
|
+
test "$(ls dist/*.whl | wc -l)" -eq 1
|
|
132
|
+
- uses: actions/upload-artifact@v7
|
|
133
|
+
with:
|
|
134
|
+
name: public-distributions
|
|
135
|
+
path: dist/*
|
|
136
|
+
if-no-files-found: error
|
|
137
|
+
retention-days: 7
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: aiida-jQMC public docs build
|
|
2
|
+
|
|
3
|
+
# The Sphinx manual, built as doc/Makefile builds it (warnings are errors), for
|
|
4
|
+
# the public distribution check and the GitHub Pages deploy, in public
|
|
5
|
+
# aiida-jQMC only. The process pages are rendered from the process specs
|
|
6
|
+
# (aiida.sphinxext), which needs an AiiDA profile: a throwaway SQLite one, no
|
|
7
|
+
# broker (`verdi presto`).
|
|
8
|
+
on:
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
docs:
|
|
16
|
+
name: Sphinx documentation
|
|
17
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 30
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v7
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.12'
|
|
28
|
+
- name: Install the package and its documented Sphinx dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
python -m pip install '.[docs]'
|
|
32
|
+
python -m pip check
|
|
33
|
+
- name: Build the current documentation
|
|
34
|
+
run: |
|
|
35
|
+
verdi presto
|
|
36
|
+
make -C doc html
|
|
37
|
+
test -s doc/_build/html/index.html
|
|
38
|
+
- uses: actions/upload-artifact@v7
|
|
39
|
+
with:
|
|
40
|
+
name: public-docs
|
|
41
|
+
path: doc/_build/html/
|
|
42
|
+
if-no-files-found: error
|
|
43
|
+
retention-days: 7
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: aiida-jQMC public docs deploy
|
|
2
|
+
|
|
3
|
+
# As jQMC: a push to rc-gh-pages builds the manual and publishes it to GitHub
|
|
4
|
+
# Pages with the GitHub Actions source: no branch is written, and the
|
|
5
|
+
# github-pages environment admits deployments from rc-gh-pages only.
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [rc-gh-pages]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: public-gh-pages
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
20
|
+
uses: ./.github/workflows/public-build-docs.yml
|
|
21
|
+
|
|
22
|
+
docs:
|
|
23
|
+
name: publish aiida-jqmc docs to GitHub Pages
|
|
24
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && github.ref == 'refs/heads/rc-gh-pages'
|
|
25
|
+
needs: build
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
timeout-minutes: 10
|
|
28
|
+
permissions:
|
|
29
|
+
pages: write
|
|
30
|
+
id-token: write
|
|
31
|
+
environment:
|
|
32
|
+
name: github-pages
|
|
33
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/download-artifact@v8
|
|
36
|
+
with:
|
|
37
|
+
name: public-docs
|
|
38
|
+
path: docs_build
|
|
39
|
+
- uses: actions/upload-pages-artifact@v5
|
|
40
|
+
with:
|
|
41
|
+
path: docs_build/
|
|
42
|
+
retention-days: 7
|
|
43
|
+
- id: deployment
|
|
44
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: aiida-jQMC public TestPyPI deploy
|
|
2
|
+
|
|
3
|
+
# The release-candidate policy of jQMC: a push to rc (not main) publishes to TestPyPI.
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [rc]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: public-testpypi
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
package:
|
|
17
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
18
|
+
uses: ./.github/workflows/public-build-distributions.yml
|
|
19
|
+
|
|
20
|
+
deploy-test-pypi:
|
|
21
|
+
name: publish aiida-jqmc to test-pypi
|
|
22
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && github.ref == 'refs/heads/rc'
|
|
23
|
+
needs: package
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 10
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/download-artifact@v8
|
|
28
|
+
with:
|
|
29
|
+
name: public-distributions
|
|
30
|
+
path: dist
|
|
31
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
32
|
+
with:
|
|
33
|
+
user: __token__
|
|
34
|
+
password: ${{ secrets.TEST_PYPI_JQMC_TOKEN }}
|
|
35
|
+
repository-url: https://test.pypi.org/legacy/
|
|
36
|
+
skip-existing: true
|
|
37
|
+
verbose: true
|
|
38
|
+
|
|
39
|
+
verify-test-pypi:
|
|
40
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && github.ref == 'refs/heads/rc'
|
|
41
|
+
needs: deploy-test-pypi
|
|
42
|
+
uses: ./.github/workflows/public-verify-index.yml
|
|
43
|
+
with:
|
|
44
|
+
index: https://test.pypi.org/simple/
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: aiida-jQMC public PyPI deploy
|
|
2
|
+
|
|
3
|
+
# As jQMC: tag-triggered releases, and the tagged commit must be on rc.
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
tags: ['v*']
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: public-pypi-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
validate_tag:
|
|
17
|
+
name: validate aiida-jqmc tag
|
|
18
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && startsWith(github.ref, 'refs/tags/v')
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 5
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
- uses: actions/setup-python@v6
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.12'
|
|
29
|
+
- run: python -m pip install packaging
|
|
30
|
+
- name: Require a canonical PEP 440 tag on rc
|
|
31
|
+
run: |
|
|
32
|
+
git fetch origin rc:refs/remotes/origin/rc
|
|
33
|
+
git merge-base --is-ancestor "$GITHUB_SHA" origin/rc
|
|
34
|
+
python - <<'PY'
|
|
35
|
+
import os
|
|
36
|
+
from packaging.version import Version
|
|
37
|
+
|
|
38
|
+
tag = os.environ["GITHUB_REF_NAME"]
|
|
39
|
+
version = Version(tag.removeprefix("v"))
|
|
40
|
+
if tag != "v" + version.public:
|
|
41
|
+
raise SystemExit(f"Tag must be canonical: expected v{version.public}, got {tag}")
|
|
42
|
+
PY
|
|
43
|
+
|
|
44
|
+
package:
|
|
45
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
46
|
+
needs: validate_tag
|
|
47
|
+
uses: ./.github/workflows/public-build-distributions.yml
|
|
48
|
+
|
|
49
|
+
deploy-pypi:
|
|
50
|
+
name: publish aiida-jqmc to pypi
|
|
51
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && startsWith(github.ref, 'refs/tags/v')
|
|
52
|
+
needs: package
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
timeout-minutes: 10
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/download-artifact@v8
|
|
57
|
+
with:
|
|
58
|
+
name: public-distributions
|
|
59
|
+
path: dist
|
|
60
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
61
|
+
with:
|
|
62
|
+
user: __token__
|
|
63
|
+
password: ${{ secrets.PYPI_JQMC_TOKEN }}
|
|
64
|
+
skip-existing: true
|
|
65
|
+
verbose: true
|
|
66
|
+
|
|
67
|
+
verify-pypi:
|
|
68
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && startsWith(github.ref, 'refs/tags/v')
|
|
69
|
+
needs: deploy-pypi
|
|
70
|
+
uses: ./.github/workflows/public-verify-index.yml
|
|
71
|
+
with:
|
|
72
|
+
index: https://pypi.org/simple/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: aiida-jQMC public distribution check
|
|
2
|
+
|
|
3
|
+
# The public CI of aiida-jQMC, as jQMC's: the distributions are built, checked
|
|
4
|
+
# and installed, and the installed plugin is checked as a user runs it
|
|
5
|
+
# (public-build-distributions.yml); the documentation is built with warnings as
|
|
6
|
+
# errors (public-build-docs.yml). The plugin is tested in forge.
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
# rc pushes already run the identical distribution check before TestPyPI.
|
|
10
|
+
branches: [main]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [main, rc]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: public-distribution-${{ github.event.pull_request.number || github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
package:
|
|
24
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
25
|
+
uses: ./.github/workflows/public-build-distributions.yml
|
|
26
|
+
|
|
27
|
+
docs:
|
|
28
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
29
|
+
uses: ./.github/workflows/public-build-docs.yml
|
|
30
|
+
|
|
31
|
+
distribution-result:
|
|
32
|
+
name: public-distribution-check
|
|
33
|
+
if: github.repository == 'jqmc-project/aiida-jQMC' && always()
|
|
34
|
+
needs: [package, docs]
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
timeout-minutes: 5
|
|
37
|
+
steps:
|
|
38
|
+
- name: Require the distribution build, every wheel check and the documentation to pass
|
|
39
|
+
env:
|
|
40
|
+
JOB_RESULTS: ${{ toJSON(needs) }}
|
|
41
|
+
run: |
|
|
42
|
+
python3 - <<'PY'
|
|
43
|
+
import json
|
|
44
|
+
import os
|
|
45
|
+
|
|
46
|
+
results = json.loads(os.environ["JOB_RESULTS"])
|
|
47
|
+
if set(results) != {"package", "docs"} or any(job["result"] != "success" for job in results.values()):
|
|
48
|
+
raise SystemExit(f"The public distribution check is incomplete or failed: {results}")
|
|
49
|
+
PY
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Ruff lint of public aiida-jQMC: needs no jqmc. It runs in jqmc-project/aiida-jQMC
|
|
2
|
+
# only; the same ruff version lints the private development repository.
|
|
3
|
+
|
|
4
|
+
name: aiida-jQMC public ruff lint
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
# As jQMC: the public branches; other branches are checked by pull_request.
|
|
9
|
+
branches: [main, rc, rc-gh-pages]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: ["**"]
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: public-lint-ruff-${{ github.event.pull_request.number || github.ref }}
|
|
18
|
+
cancel-in-progress: true
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
lint:
|
|
22
|
+
name: ruff lint
|
|
23
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 15
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
|
+
with:
|
|
29
|
+
persist-credentials: false
|
|
30
|
+
- uses: actions/setup-python@v6
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.12"
|
|
33
|
+
- run: python -m pip install ruff==0.17.5
|
|
34
|
+
- run: ruff check .
|
|
35
|
+
- run: ruff format --check .
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: aiida-jQMC public PR policy notice
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [opened, reopened]
|
|
6
|
+
|
|
7
|
+
# This privileged event is used only to comment on fork PRs. Never check out,
|
|
8
|
+
# install, or execute PR code here, and never use a self-hosted runner.
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: public-pr-policy-${{ github.event.pull_request.number }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
comment:
|
|
17
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 3
|
|
20
|
+
permissions:
|
|
21
|
+
pull-requests: write
|
|
22
|
+
steps:
|
|
23
|
+
- name: Post the policy notice once on every PR
|
|
24
|
+
env:
|
|
25
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
26
|
+
run: |
|
|
27
|
+
python3 - <<'PY'
|
|
28
|
+
import json
|
|
29
|
+
import os
|
|
30
|
+
import urllib.request
|
|
31
|
+
|
|
32
|
+
def main() -> None:
|
|
33
|
+
repository = "jqmc-project/aiida-jQMC"
|
|
34
|
+
if os.environ["GITHUB_REPOSITORY"] != repository:
|
|
35
|
+
raise RuntimeError("The policy notice is only for public aiida-jQMC")
|
|
36
|
+
with open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8") as stream:
|
|
37
|
+
pr = json.load(stream)["pull_request"]
|
|
38
|
+
if pr["base"]["repo"]["full_name"] != repository:
|
|
39
|
+
raise RuntimeError("Unexpected PR target repository")
|
|
40
|
+
if pr["state"] != "open":
|
|
41
|
+
return
|
|
42
|
+
|
|
43
|
+
marker = "<!-- aiida-jqmc-public-pr-policy:v1 -->"
|
|
44
|
+
endpoint = f"https://api.github.com/repos/{repository}/issues/{int(pr['number'])}/comments"
|
|
45
|
+
headers = {
|
|
46
|
+
"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}",
|
|
47
|
+
"Accept": "application/vnd.github+json",
|
|
48
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
49
|
+
"User-Agent": "aiida-jqmc-pr-policy",
|
|
50
|
+
}
|
|
51
|
+
page = 1
|
|
52
|
+
while True:
|
|
53
|
+
request = urllib.request.Request(f"{endpoint}?per_page=100&page={page}", headers=headers)
|
|
54
|
+
with urllib.request.urlopen(request, timeout=30) as response:
|
|
55
|
+
comments = json.load(response)
|
|
56
|
+
for comment in comments:
|
|
57
|
+
author = comment.get("user") or {}
|
|
58
|
+
if (
|
|
59
|
+
author.get("login") == "github-actions[bot]"
|
|
60
|
+
and author.get("type") == "Bot"
|
|
61
|
+
and marker in (comment.get("body") or "")
|
|
62
|
+
):
|
|
63
|
+
print("The policy notice has already been posted")
|
|
64
|
+
return
|
|
65
|
+
if len(comments) < 100:
|
|
66
|
+
break
|
|
67
|
+
page += 1
|
|
68
|
+
|
|
69
|
+
body = "\n\n".join([
|
|
70
|
+
marker,
|
|
71
|
+
"Thank you for the pull request! We appreciate proposals, reproductions, "
|
|
72
|
+
"and suggested fixes that help us understand the problem.",
|
|
73
|
+
"External pull requests in this public repository are not merged as submitted, "
|
|
74
|
+
"even when their CI checks pass. Development takes place in the private "
|
|
75
|
+
"aiida-jQMC-forge repository: the developers investigate the issue, implement and "
|
|
76
|
+
"test the changes there, and then bring validated changes into public aiida-jQMC "
|
|
77
|
+
"through maintainer-managed promotion.",
|
|
78
|
+
"Your PR remains useful as a reference and a place for discussion; this "
|
|
79
|
+
"automated notice does not close it. Please see our "
|
|
80
|
+
"[contribution policy](https://github.com/jqmc-project/aiida-jQMC/blob/main/"
|
|
81
|
+
"README.md#development-and-contributing).",
|
|
82
|
+
])
|
|
83
|
+
request = urllib.request.Request(
|
|
84
|
+
endpoint,
|
|
85
|
+
data=json.dumps({"body": body}).encode("utf-8"),
|
|
86
|
+
headers={**headers, "Content-Type": "application/json"},
|
|
87
|
+
method="POST",
|
|
88
|
+
)
|
|
89
|
+
with urllib.request.urlopen(request, timeout=30) as response:
|
|
90
|
+
json.load(response)
|
|
91
|
+
print("Posted the public contribution policy notice")
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
main()
|
|
95
|
+
PY
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: aiida-jQMC public wheel index verification
|
|
2
|
+
|
|
3
|
+
# Called by the deploy workflows after an upload, as jQMC's: download the
|
|
4
|
+
# aiida-jqmc wheel from the index, require it to be the file that passed the
|
|
5
|
+
# distribution check (same sha256 as public-distributions), install it with its
|
|
6
|
+
# dependencies from PyPI in a fresh environment and check the installed plugin
|
|
7
|
+
# with it. Dependencies never come from TestPyPI.
|
|
8
|
+
on:
|
|
9
|
+
workflow_call:
|
|
10
|
+
inputs:
|
|
11
|
+
index:
|
|
12
|
+
description: Simple index URL the files were uploaded to
|
|
13
|
+
required: true
|
|
14
|
+
type: string
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
env:
|
|
20
|
+
OMP_NUM_THREADS: '1'
|
|
21
|
+
OPENBLAS_NUM_THREADS: '1'
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
verify-index:
|
|
25
|
+
name: Uploaded wheel
|
|
26
|
+
if: github.repository == 'jqmc-project/aiida-jQMC'
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
timeout-minutes: 45
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v7
|
|
31
|
+
with:
|
|
32
|
+
persist-credentials: false
|
|
33
|
+
- uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: '3.12'
|
|
36
|
+
- uses: actions/download-artifact@v8
|
|
37
|
+
with:
|
|
38
|
+
name: public-distributions
|
|
39
|
+
path: tested
|
|
40
|
+
- name: Download the uploaded wheel and compare it with the tested one
|
|
41
|
+
env:
|
|
42
|
+
INDEX_URL: ${{ inputs.index }}
|
|
43
|
+
run: |
|
|
44
|
+
python -m pip install --upgrade pip packaging
|
|
45
|
+
python - <<'PY'
|
|
46
|
+
import hashlib
|
|
47
|
+
import os
|
|
48
|
+
import subprocess
|
|
49
|
+
import sys
|
|
50
|
+
import time
|
|
51
|
+
from pathlib import Path
|
|
52
|
+
from packaging.utils import parse_wheel_filename
|
|
53
|
+
|
|
54
|
+
tested = list(Path("tested").glob("*.whl"))
|
|
55
|
+
if len(tested) != 1:
|
|
56
|
+
raise SystemExit(f"Expected one tested wheel, got {tested}")
|
|
57
|
+
tested = tested[0]
|
|
58
|
+
version = parse_wheel_filename(tested.name)[1]
|
|
59
|
+
index = Path("index")
|
|
60
|
+
# The index can take minutes to list a new upload.
|
|
61
|
+
for attempt in range(40):
|
|
62
|
+
result = subprocess.run(
|
|
63
|
+
[sys.executable, "-m", "pip", "download", "--no-deps", "--only-binary", ":all:", "--no-cache-dir",
|
|
64
|
+
"--index-url", os.environ["INDEX_URL"], f"aiida-jqmc=={version}", "-d", str(index)],
|
|
65
|
+
capture_output=True, text=True,
|
|
66
|
+
)
|
|
67
|
+
if result.returncode == 0:
|
|
68
|
+
break
|
|
69
|
+
print(f"aiida-jqmc=={version} not available yet ({attempt + 1}/40)", flush=True)
|
|
70
|
+
time.sleep(30)
|
|
71
|
+
else:
|
|
72
|
+
raise SystemExit(f"aiida-jqmc=={version} never became downloadable:\n{result.stderr}")
|
|
73
|
+
downloaded, = index.glob("*.whl")
|
|
74
|
+
digest = {path: hashlib.sha256(path.read_bytes()).hexdigest() for path in (tested, downloaded)}
|
|
75
|
+
print(f"tested {tested.name} {digest[tested]}")
|
|
76
|
+
print(f"downloaded {downloaded.name} {digest[downloaded]}")
|
|
77
|
+
if downloaded.name != tested.name or digest[downloaded] != digest[tested]:
|
|
78
|
+
raise SystemExit("The uploaded wheel is not the tested wheel")
|
|
79
|
+
PY
|
|
80
|
+
- name: Install the uploaded wheel with its dependencies from PyPI
|
|
81
|
+
run: |
|
|
82
|
+
python -m venv "$RUNNER_TEMP/user"
|
|
83
|
+
"$RUNNER_TEMP/user/bin/python" -m pip install --upgrade pip
|
|
84
|
+
"$RUNNER_TEMP/user/bin/python" -m pip install index/*.whl
|
|
85
|
+
"$RUNNER_TEMP/user/bin/python" -m pip check
|
|
86
|
+
- name: Check the installed plugin (entry points, input files, parser)
|
|
87
|
+
run: |
|
|
88
|
+
"$RUNNER_TEMP/user/bin/python" -I scripts/check_installed_aiida_jqmc.py --commit "$GITHUB_SHA" \
|
|
89
|
+
tests/data/H2_ecp_ccpvdz_jsd.h5 tests/data/mcmc.out
|