Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,21 @@ jobs:
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
pyproject-file: "extralit-server/pyproject.toml"
python-version: "3.11"
enable-cache: true
cache-local-path: ~/.cache/uv
cache-dependency-glob: "extralit-server/pdm.lock"
cache-dependency-glob: "extralit-server/uv.lock"

- name: Setup Python env and Install extralit-server editable package
env:
PDM_IGNORE_ACTIVE_VENV: 1
run: |
uv tool install pdm
pdm config use_uv true
pdm config python.install_root "$(uv python dir)"

cd extralit-server/
pdm install -G test
- name: Setup Python env and Install extralit-server
working-directory: extralit-server
run: uv sync --group test --extra postgresql

- name: Install extralit editable package with dependencies
working-directory: extralit
run: |
uv pip install -e ".[dev]"
run: uv sync

- name: Install Node.js
uses: actions/setup-node@v4
Expand All @@ -101,8 +93,8 @@ jobs:
HOME: /home/runner
run: |
mkdir -p /home/runner/.extralit
pdm run alembic -c src/extralit_server/alembic.ini upgrade head
uv run alembic -c src/extralit_server/alembic.ini upgrade head

# - name: Verify critical dependencies
# run: |
# cd extralit-server && pdm run python -c "import pandera; print('✓ Pandera available')" || echo "⚠ Pandera not available"
# cd extralit-server && uv run python -c "import pandera; print('✓ Pandera available')" || echo "⚠ Pandera not available"
13 changes: 4 additions & 9 deletions .github/workflows/extralit-server.build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version-file: extralit-server/pyproject.toml
cache-dependency-path: extralit-server/pdm.lock
cache: true
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86

- name: Read package info
id: package-info
working-directory: extralit-server
run: |
PACKAGE_VERSION=$(pdm show --version)
PACKAGE_NAME=$(pdm show --name)
PACKAGE_VERSION=$(grep '__version__' src/extralit_server/_version.py | cut -d'"' -f2)
PACKAGE_NAME="extralit-server"
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
echo "$PACKAGE_NAME==$PACKAGE_VERSION"
Expand Down Expand Up @@ -130,4 +126,3 @@ jobs:
password: ${{ env.DOCKER_PASSWORD }}
repository: ${{ env.SERVER_DOCKER_IMAGE }}
readme-filepath: extralit-server/docker/server/README.md

40 changes: 16 additions & 24 deletions .github/workflows/extralit-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,32 +91,26 @@ jobs:
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
with:
pyproject-file: "extralit-server/pyproject.toml"
enable-cache: true
cache-local-path: ~/.cache/uv
cache-dependency-glob: "extralit-server/pdm.lock"

- name: Install PDM
run: uv tool install pdm
cache-dependency-glob: "extralit-server/uv.lock"

- name: Install dependencies
run: |
pdm config use_uv true
pdm config python.install_root "$(uv python dir)"
pdm install --dev
run: uv sync --group test --extra postgresql

- name: Run tests 📈
id: run-tests
continue-on-error: true
env:
HF_TOKEN_EXTRALIT_INTERNAL_TESTING: ${{ secrets.HF_TOKEN_EXTRALIT_INTERNAL_TESTING }}
EXTRALIT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/extralit
EXTRALIT_ELASTICSEARCH: http://localhost:9200
EXTRALIT_SEARCH_ENGINE: elasticsearch
run: |
EXTRALIT_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/extralit
EXTRALIT_ELASTICSEARCH=http://localhost:9200
EXTRALIT_SEARCH_ENGINE=elasticsearch
pdm test-cov tests/unit
uv run pytest tests/unit --cov=extralit_server --cov-report=term --cov-report=xml --verbosity=0 --disable-warnings

- name: Upload test coverage
if: always()
Expand Down Expand Up @@ -156,7 +150,7 @@ jobs:
- name: Build package
run: |
cp -r ../extralit-frontend/dist src/extralit_server/static
pdm build
uv build

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -209,7 +203,7 @@ jobs:
uses: githubocto/repo-visualizer@0.7.1
with:
root_path: "extralit-server/"
excluded_paths: "dist,build,node_modules,docs,tests,.swm,assets,.github,package-lock.json,pdm.lock"
excluded_paths: "dist,build,node_modules,docs,tests,.swm,assets,.github,package-lock.json,uv.lock"
excluded_globs: "*.spec.js;**/*.{png,jpg,svg,md};**/!(*.module).ts,**/__pycache__/,**/__mocks__/,LICENSE*,**/.gitignore,**/*.egg-info/,**/.*/"
output_file: "repo-visualizer.svg"
should_push: false
Expand All @@ -227,25 +221,23 @@ jobs:
name: extralit-server
path: extralit-server/dist

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
with:
python-version-file: extralit-server/pyproject.toml
cache-dependency-path: extralit-server/pdm.lock
cache: true
pyproject-file: "extralit-server/pyproject.toml"

- name: Read package info
run: |
PACKAGE_VERSION=$(pdm show --version)
PACKAGE_NAME=$(pdm show --name)
PACKAGE_VERSION=$(grep '__version__' src/extralit_server/_version.py | cut -d'"' -f2)
PACKAGE_NAME="extralit-server"
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "$PACKAGE_NAME==$PACKAGE_VERSION"

- name: Publish Package to PyPI test environment 🥪
continue-on-error: true
run: |
pdm publish --no-build --repository testpypi --username __token__ --password ${{ secrets.AR_TEST_PYPI_API_TOKEN }}
uv publish --index-url https://test.pypi.org/legacy/ --token ${{ secrets.AR_TEST_PYPI_API_TOKEN }} dist/*

- name: Test Installing 🍿
continue-on-error: true
Expand All @@ -255,4 +247,4 @@ jobs:
- name: Publish Package to PyPI 🥩
if: github.ref == 'refs/heads/main'
run: |
pdm publish --no-build --username __token__ --password ${{ secrets.AR_PYPI_API_TOKEN }}
uv publish --token ${{ secrets.AR_PYPI_API_TOKEN }} dist/*
32 changes: 10 additions & 22 deletions .github/workflows/extralit.docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,18 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
with:
pyproject-file: "extralit/pyproject.toml"
python-version: "3.10"
enable-cache: true
cache-local-path: ~/.cache/uv
ignore-nothing-to-cache: true
cache-dependency-glob: "extralit/pdm.lock"

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true
cache-dependency-path: |
extralit/pdm.lock
cache-dependency-glob: "extralit/uv.lock"

- name: Install dependencies
env:
PDM_IGNORE_ACTIVE_VENV: 1
run: |
pdm config use_uv true
pdm config python.install_root "$(uv python dir)"
pdm install -q
uv sync
uv cache prune --ci

- name: Set git credentials
Expand All @@ -80,33 +68,33 @@ jobs:

- name: Deploy Extralit docs (branch /main)
run: |
pdm run mike deploy stable --push
uv run mike deploy stable --push
if: github.ref == 'refs/heads/main'

- name: Deploy Extralit docs (branch /develop)
run: |
pdm run mike deploy latest --push
pdm run mike set-default --push latest
uv run mike deploy latest --push
uv run mike set-default --push latest
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch'

- name: Deploy Extralit docs (release $version)
run: |
version=$(echo $TAG_VERSION | awk -F \. {'print $1"."$2'})
echo "Deploying version ${version}"
pdm run mike deploy $version --push
uv run mike deploy $version --push
if: startsWith(github.ref, 'refs/tags/')
env:
TAG_VERSION: ${{ github.ref_name }}

- name: Delete Extralit docs (versions 'docs_*')
id: delete_deployment
run: |
versions=$(pdm run mike list)
versions=$(uv run mike list)
formatted_versions=$(echo "$versions" | tr ',' '\n' | tr -d '[]')
for version in $versions; do
if [[ $version == docs_* ]]; then
echo "Deleting version: $version"
pdm run mike delete "$version" --push
uv run mike delete "$version" --push
fi
done
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -117,7 +105,7 @@ jobs:
run: echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's/\//_/g' >> $GITHUB_OUTPUT

- name: Deploy Extralit docs (branch /docs/*)
run: pdm run mike deploy ${{ steps.extract_branch_name.outputs.branch_name }} --prop-set hidden=true --push
run: uv run mike deploy ${{ steps.extract_branch_name.outputs.branch_name }} --prop-set hidden=true --push
if: startsWith(github.ref, 'refs/heads/docs') || startsWith(github.head_ref, 'docs/')

- name: Add deployment message in PR
Expand Down
49 changes: 22 additions & 27 deletions .github/workflows/extralit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
with:
pyproject-file: "extralit/pyproject.toml"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-local-path: ~/.cache/uv
ignore-nothing-to-cache: true
cache-dependency-glob: "extralit/pdm.lock"
- name: Install PDM
run: uv tool install pdm
cache-dependency-glob: "extralit/uv.lock"
- name: Install dependencies
env:
PDM_IGNORE_ACTIVE_VENV: 1
run: |
pdm config use_uv true
pdm config python.install_root "$(uv python dir)"

pdm install
uv sync
uv cache prune --ci
- name: Wait for extralit-container to start
timeout-minutes: 3
Expand All @@ -89,8 +82,11 @@ jobs:
- name: Run unit tests
id: tests-unit
continue-on-error: true
env:
EXTRALIT_API_URL: http://localhost:6900
EXTRALIT_API_KEY: extralit.apikey
run: |
pdm run test-cov tests/unit
uv run pytest tests/unit --disable-warnings --cov=extralit --cov-report=term --cov-report=xml

- name: Check test status
if: steps.tests-unit.outcome == 'failure'
Expand All @@ -99,15 +95,18 @@ jobs:
- name: Run integration tests
id: tests-integration
continue-on-error: true
env:
EXTRALIT_API_URL: http://localhost:6900
EXTRALIT_API_KEY: extralit.apikey
run: |
pdm run test-cov tests/integration
uv run pytest tests/integration --disable-warnings --cov=extralit --cov-report=term --cov-report=xml --cov-append

- name: Generate coverage report
if: always()
continue-on-error: true
run: |
pdm run coverage xml -o coverage.xml
pdm run coverage report
uv run coverage xml -o coverage.xml
uv run coverage report

- name: Upload test coverage
if: always()
Expand All @@ -124,7 +123,7 @@ jobs:

- name: Build package
run: |
pdm build
uv build
- name: Upload artifact
uses: actions/upload-artifact@v4
# Upload the package to be used in the next jobs only once
Expand Down Expand Up @@ -161,7 +160,7 @@ jobs:
uses: githubocto/repo-visualizer@0.7.1
with:
root_path: "extralit/"
excluded_paths: "dist,build,node_modules,docs,tests,.swm,assets,.github,package-lock.json,pdm.lock"
excluded_paths: "dist,build,node_modules,docs,tests,.swm,assets,.github,package-lock.json,uv.lock"
excluded_globs: "*.spec.js;**/*.{png,jpg,svg,md};**/!(*.module).ts,**/__pycache__/,**/__mocks__/,LICENSE*,**/.gitignore,**/*.egg-info/,**/.*/"
output_file: "repo-visualizer.svg"
should_push: false
Expand All @@ -180,28 +179,23 @@ jobs:
path: extralit/dist

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
with:
pyproject-file: "extralit/pyproject.toml"
python-version: "3.9"
enable-cache: true
cache-local-path: ~/.cache/uv
ignore-nothing-to-cache: true
cache-dependency-glob: "extralit/pdm.lock"
- name: Install PDM
run: uv tool install pdm

- name: Read package info
run: |
PACKAGE_VERSION=$(pdm show --version)
PACKAGE_NAME=$(pdm show --name)
PACKAGE_VERSION=$(grep '__version__' src/extralit/_version.py | cut -d'"' -f2)
PACKAGE_NAME="extralit"
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "$PACKAGE_NAME==$PACKAGE_VERSION"

- name: Publish Package to PyPI test environment 🥪
run: pdm publish --no-build --repository testpypi --username __token__ --password ${{ secrets.AR_TEST_PYPI_API_TOKEN }}
continue-on-error: true
run: |
uv publish --index-url https://test.pypi.org/legacy/ --token ${{ secrets.AR_TEST_PYPI_API_TOKEN }} dist/*

- name: Test Installing 🍿
continue-on-error: true
Expand All @@ -210,4 +204,5 @@ jobs:

- name: Publish Package to PyPI 🥩
if: github.ref == 'refs/heads/main'
run: pdm publish --no-build --username __token__ --password ${{ secrets.AR_PYPI_API_TOKEN }}
run: |
uv publish --token ${{ secrets.AR_PYPI_API_TOKEN }} dist/*
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ sw.*
yarn.lock

# pdm and uv
uv.lock
pyproject.toml.*

# App generated files
Expand Down
Loading
Loading