From e48be492d0403b7a297669d50e588635dc7d9cdf Mon Sep 17 00:00:00 2001 From: Anthony Onwuli Date: Sun, 1 Dec 2024 11:16:36 -0500 Subject: [PATCH 1/5] Add optional extras --- pyproject.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 0d118ac94..5f0d41013 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,21 @@ visualisation = [ "dash", ] +optional = [ + "pydantic>=2.9.2", + "mp-api>=0.42.2", + "pymatviz>=0.14", + "seaborn>=0.13.2", + "pymatgen>=2024.2.20", + "matminer>=0.9.2", + "umap-learn>=0.5.3", + "kaleido>=0.2.1", + "ase>=3.22.0", + "numpy", + "ElementEmbeddings>=0.4", + "dash>=2.18.2", + +] strict = [ "pydantic==2.9.2", "mp-api==0.42.2", From 2377b158b941910032f72a1ed5b350a3ee26342c Mon Sep 17 00:00:00 2001 From: Anthony Onwuli Date: Sun, 1 Dec 2024 11:16:45 -0500 Subject: [PATCH 2/5] Update ci --- .github/workflows/ci.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88ae0fec5..9d22ebed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,20 +23,31 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up micromamba + uses: mamba-org/setup-micromamba@main + + - name: Create mamba environment + run: | + micromamba create -n smact_env python=${{ matrix.python-version }} --yes + - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools - pip install -e ".[crystal_space,dev]" - pip install pytest-cov + micromamba activate smact_env + pip install uv + uv pip install build + python -m build --wheel + uv pip install dist/*.whl + uv pip install smact[dev,optional] + - name: Run tests and collect coverage env: MP_API_KEY: ${{ secrets.MP_API_KEY }} - run: python -m pytest --cov=smact --cov-report=xml -v + run: | + micromamba activate smact_env + python -m pytest --cov=smact --cov-report=xml -v - name: Upload coverage reports to CodeCov uses: codecov/codecov-action@v4 with: From 734b84736b9ad5fe203ff3f9e844ff2420648968 Mon Sep 17 00:00:00 2001 From: Anthony Onwuli Date: Sun, 1 Dec 2024 11:24:14 -0500 Subject: [PATCH 3/5] Revert "Update ci" This reverts commit 2377b158b941910032f72a1ed5b350a3ee26342c. --- .github/workflows/ci.yml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d22ebed2..88ae0fec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,31 +23,20 @@ jobs: runs-on: ${{matrix.os}} steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up micromamba - uses: mamba-org/setup-micromamba@main - - - name: Create mamba environment - run: | - micromamba create -n smact_env python=${{ matrix.python-version }} --yes - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - micromamba activate smact_env - pip install uv - uv pip install build - python -m build --wheel - uv pip install dist/*.whl - uv pip install smact[dev,optional] - + python -m pip install --upgrade pip wheel setuptools + pip install -e ".[crystal_space,dev]" + pip install pytest-cov - name: Run tests and collect coverage env: MP_API_KEY: ${{ secrets.MP_API_KEY }} - run: | - micromamba activate smact_env - python -m pytest --cov=smact --cov-report=xml -v + run: python -m pytest --cov=smact --cov-report=xml -v - name: Upload coverage reports to CodeCov uses: codecov/codecov-action@v4 with: From a2ca9183dd2f824f84bd969913726e6b407ff600 Mon Sep 17 00:00:00 2001 From: Anthony Onwuli Date: Sun, 1 Dec 2024 11:26:58 -0500 Subject: [PATCH 4/5] Add UV to CI --- .github/workflows/ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88ae0fec5..4db0b967d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,16 +23,22 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + + - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools - pip install -e ".[crystal_space,dev]" - pip install pytest-cov + pip install uv + uv pip install -e ".[optional,dev]" --system + - name: Run tests and collect coverage env: MP_API_KEY: ${{ secrets.MP_API_KEY }} From f59baf817732fcd3cf1fb2650ec7c7348d9896f1 Mon Sep 17 00:00:00 2001 From: Anthony Onwuli Date: Sun, 1 Dec 2024 11:53:38 -0500 Subject: [PATCH 5/5] Run pre-commit --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db0b967d..68f03e6e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,12 +33,11 @@ jobs: cache: pip cache-dependency-path: pyproject.toml - - name: Install dependencies run: | pip install uv uv pip install -e ".[optional,dev]" --system - + - name: Run tests and collect coverage env: MP_API_KEY: ${{ secrets.MP_API_KEY }}