diff --git a/.github/workflows/issue-metrics.yml b/.github/workflows/issue-metrics.yml index 4fbcdc6b066..043bd3ea572 100644 --- a/.github/workflows/issue-metrics.yml +++ b/.github/workflows/issue-metrics.yml @@ -26,7 +26,7 @@ jobs: # Calculate the last day of the previous month last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) - #Set an environment variable with the date range + # Set an environment variable with the date range echo "$first_day..$last_day" echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 271d06eff91..716043d5901 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ -name: Release # makes PyPI releases +# Make PyPI releases +name: Release on: release: @@ -26,12 +27,12 @@ jobs: - name: Check out repo uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - name: Install Python + - name: Install Python + uses: actions/setup-python@v5 with: python-version: "3.12" - - name: Build sdist + - name: Build source distribution run: | pip install build python -m build --sdist @@ -66,7 +67,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest permissions: - # For pypi trusted publishing + # For PyPI trusted publishing id-token: write steps: - name: Set up Python @@ -81,9 +82,12 @@ jobs: merge-multiple: true path: dist - - name: Publish to PyPi or TestPyPI + - name: Publish to PyPI or TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true verbose: true - repository-url: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.task == 'test-release' && 'https://test.pypi.org/legacy/' || '' }} + repository-url: > + ${{ github.event_name == 'workflow_dispatch' && + github.event.inputs.task == 'test-release' && + 'https://test.pypi.org/legacy/' || '' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb481f6270b..eaa84bff708 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,8 @@ jobs: - name: Install ubuntu-only conda dependencies if: matrix.config.os == 'ubuntu-latest' run: | - micromamba install -n pmg -c conda-forge bader enumlib openff-toolkit packmol pygraphviz tblite --yes + micromamba install -n pmg -c conda-forge bader enumlib \ + openff-toolkit packmol pygraphviz tblite --yes - name: Install pymatgen and dependencies via uv run: | @@ -84,7 +85,12 @@ jobs: # see: https://discuss.dgl.ai/t/filenotfounderror-cannot-find-dgl-c-graphbolt-library/4302 pip install torch==2.2.1 - uv pip install --editable '.[${{ matrix.config.extras }}]' --resolution=${{ matrix.config.resolution }} + # Install from wheels to test the content + uv pip install build + python -m build --wheel + + uv pip install dist/*.whl + uv pip install pymatgen[${{ matrix.config.extras }}] --resolution=${{ matrix.config.resolution }} - name: Install optional Ubuntu dependencies if: matrix.config.os == 'ubuntu-latest' @@ -101,6 +107,8 @@ jobs: echo "$(realpath vampire-5.0/)" >> $GITHUB_PATH - name: pytest split ${{ matrix.split }} + env: + PMG_TEST_FILES_DIR: "${{ github.workspace }}/tests/files" run: | micromamba activate pmg pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests diff --git a/tests/transformations/test_advanced_transformations.py b/tests/transformations/test_advanced_transformations.py index f1964cc4f2c..39a58e15f9d 100644 --- a/tests/transformations/test_advanced_transformations.py +++ b/tests/transformations/test_advanced_transformations.py @@ -182,6 +182,7 @@ def test_apply_transformation(self): for struct_trafo in alls: assert "energy" not in struct_trafo + @pytest.mark.skip(reason="dgl don't support torch 2.4.1+, #4073") def test_m3gnet(self): pytest.importorskip("matgl") enum_trans = EnumerateStructureTransformation(refine_structure=True, sort_criteria="m3gnet_relax") @@ -197,6 +198,7 @@ def test_m3gnet(self): # Check ordering of energy/atom assert alls[0]["energy"] / alls[0]["num_sites"] <= alls[-1]["energy"] / alls[-1]["num_sites"] + @pytest.mark.skip(reason="dgl don't support torch 2.4.1+, #4073") def test_callable_sort_criteria(self): matgl = pytest.importorskip("matgl") from matgl.ext.ase import Relaxer