Skip to content

Commit

Permalink
use uv
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Dec 7, 2024
1 parent 28cd7de commit 65a36ed
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 56 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Build docs

name: build docs
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docs:
Expand All @@ -18,34 +21,31 @@ jobs:
~/.gdsfactory/
key: 0.0.1
restore-keys: 0.0.1
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.3.1-0'
init-shell: bash
- name: Install dependencies and build docs
- name: Install
env:
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
GDSFACTORY_DISPLAY_TYPE: klayout
run: |
make uv install test-data
- name: Build docs
env:
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
GDSFACTORY_DISPLAY_TYPE: klayout
run: |
eval "$(micromamba shell hook --shell=bash)"
micromamba activate
micromamba install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
make dev test-data
make docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./docs/_build/html/"
deploy-docs:
needs: build-docs
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
Expand Down
45 changes: 5 additions & 40 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
key: ${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install -e .[${{ matrix.plugin }},dev]
pip install git+https://github.com/gdsfactory/gdsfactory --force-reinstall
make uv
uv pip install -e .[${{ matrix.plugin }},dev]
- name: Test with pytest
env:
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
GDSFACTORY_DISPLAY_TYPE: klayout
run: pytest gplugins/${{ matrix.plugin }}
run: uv run pytest gplugins/${{ matrix.plugin }}
test_code_conda:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -105,45 +105,10 @@ jobs:
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
GDSFACTORY_DISPLAY_TYPE: klayout
run: |
eval "$(micromamba shell hook --shell=bash)"
micromamba activate
micromamba install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
make dev
pip freeze > requirements.txt
pytest --cov=gplugins
make uv install
uv run pytest --cov=gplugins
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gdsfactory/
key: 0.0.1
restore-keys: 0.0.1
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.3.1-0"
init-shell: bash
- name: Install dependencies and build docs
env:
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
GDSFACTORY_DISPLAY_TYPE: klayout
run: |
eval "$(micromamba shell hook --shell=bash)"
micromamba activate
micromamba install -c conda-forge pymeep=*=mpi_mpich_* nlopt -y
make test-data
make dev
make docs
- name: Expose docs artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: docs
path: docs/_build/html/
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
uv:
curl -LsSf https://astral.sh/uv/install.sh | sh

install:
pip install -e .[dev,docs,devsim,femwell,gmsh,klayout,meow,meshwell,ray,sax,schematic,tidy3d,vlsir]
pip install git+https://github.com/gdsfactory/gdsfactory --force-reinstall
pre-commit install
uv pip install -e .[dev,docs,devsim,femwell,gmsh,klayout,meow,meshwell,ray,sax,schematic,tidy3d,vlsir]
uv run pre-commit install

dev: test-data gmsh elmer install

Expand Down

0 comments on commit 65a36ed

Please sign in to comment.