Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
migrate to uv and pyproject.toml
  • Loading branch information
T4rk1n committed Jun 20, 2025
commit c87212ff22f3c2642423ef53c0852588b4d35aa3
83 changes: 45 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ jobs:
- run: echo $PYVERSION > ver.txt
- run: cat requirements/*.txt > requirements-all.txt
- restore_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}-uv-v1
- run:
name: Install uv
command: curl -LsSf https://astral.sh/uv/install.sh | sh && source $HOME/.cargo/env
- run:
name: 🏁 Build Component Packages & Update Dependencies/Artifacts
command: |
python -m venv venv && . venv/bin/activate
pip install "pip<25.0"
pip install --upgrade wheel setuptools
set -eo pipefail
pip install -e .[ci,dev,testing,celery,diskcache] --progress-bar off
source $HOME/.cargo/env
uv venv .venv --python 3.12
source .venv/bin/activate
uv sync --extra ci --extra dev --extra testing --extra celery --extra diskcache --extra build
pip list | grep dash
npm ci
npm run build.sequential
python setup.py sdist
uv build
mkdir dash-package && cp dist/*.tar.gz dash-package/dash-package.tar.gz
ls -la dash-package
no_output_timeout: 30m
Expand All @@ -68,23 +70,23 @@ jobs:
cat /home/circleci/.npm/_logs/*
fi
- save_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}-uv-v1
paths:
- venv
- .venv
- persist_to_workspace:
root: ~/dash
paths:
- dash-package

install-dependencies-38:
install-dependencies-39:
<<: *install-dependencies
docker:
- image: cimg/python:3.8.18-node
- image: cimg/python:3.9.14-node
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
PYVERSION: python38
PYVERSION: python39
PERCY_ENABLE: 0

lint-unit-312: &lint-unit
Expand All @@ -108,39 +110,44 @@ jobs:
- run: echo $PYVERSION > ver.txt
- run: cat requirements/*.txt > requirements-all.txt
- restore_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements-all.txt" }}-uv-v1
- run:
name: Install uv
command: curl -LsSf https://astral.sh/uv/install.sh | sh && source $HOME/.cargo/env
- browser-tools/install-browser-tools:
chrome-version: 120.0.6099.71
- run:
name: ️️🏗️ pip dev requirements
name: ️️🏗️ Install dependencies with uv
command: |
python -m venv venv && . venv/bin/activate
pip install --upgrade pip wheel
pip install -e .[ci,dev,testing] --no-cache-dir --progress-bar off
source $HOME/.cargo/env
uv venv .venv --python 3.12
source .venv/bin/activate
uv sync --extra ci --extra dev --extra testing
- run:
name: 🌸 Python & JS Lint
command: |
. venv/bin/activate
source .venv/bin/activate
set -eo pipefail
pip install -e . --progress-bar off && pip list | grep dash
npm ci npm run initialize
pip list | grep dash
npm ci
npm run initialize
npm run build.sequential
npm run lint
- run:
name: 🐍 Python Unit Tests & ☕ JS Unit Tests
command: |
. venv/bin/activate
source .venv/bin/activate
npm run citest.unit

lint-unit-38:
lint-unit-39:
<<: *lint-unit
docker:
- image: cimg/python:3.8.18-browsers
- image: cimg/python:3.9.14-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
PYVERSION: python38
PYVERSION: python39
PERCY_ENABLE: 0

build-windows-312:
Expand Down Expand Up @@ -225,17 +232,17 @@ jobs:
- store_artifacts:
path: /tmp/dash_artifacts

test-38:
test-39:
<<: *test
docker:
- image: cimg/python:3.8.18-browsers
- image: cimg/python:3.9.14-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
PERCY_ENABLE: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: True
PYVERSION: python38
PYVERSION: python39

dcc-lint-unit-312: &dcc-lint-unit
working_directory: ~/dash
Expand Down Expand Up @@ -445,44 +452,44 @@ workflows:
tests:
jobs:
- install-dependencies-312
- install-dependencies-38
- install-dependencies-39

- build-windows-312

- lint-unit-312:
requires:
- install-dependencies-312
- lint-unit-38:
- lint-unit-39:
requires:
- install-dependencies-38
- install-dependencies-39

- test-312:
requires:
- install-dependencies-312
- test-38:
- test-39:
requires:
- install-dependencies-38
- install-dependencies-39

- dcc-lint-unit-312:
requires:
- install-dependencies-312
- dcc-lint-unit-38:
- dcc-lint-unit-39:
requires:
- install-dependencies-38
- install-dependencies-39

- dcc-312:
requires:
- install-dependencies-312
- dcc-38:
- dcc-39:
requires:
- install-dependencies-38
- install-dependencies-39

- html-312:
requires:
- install-dependencies-312
- html-38:
- html-39:
requires:
- install-dependencies-38
- install-dependencies-39

- table-visual-test

Expand Down
55 changes: 34 additions & 21 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,21 @@ jobs:
python-version: '3.12'
cache: pip

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "setuptools<80.0.0"
python -m pip install build wheel
python -m pip install -e .[dev,ci]
uv sync --extra dev --extra ci --extra build

- name: Build Dash
run: npm run build

- name: Build Dash sdist and wheel
- name: Build Dash wheel
run: |
# This command will invoke hatchling (via hatch_dash.py) which includes building JS assets
python -m build --sdist --wheel
uv build --wheel
echo "Built packages:"
ls -lhR dist/
mkdir packages
Expand Down Expand Up @@ -115,6 +116,11 @@ jobs:
with:
python-version: '3.12'
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Download built Dash packages
uses: actions/download-artifact@v4
Expand All @@ -124,9 +130,7 @@ jobs:

- name: Install Dash packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install "setuptools<80.0.0"
find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[ci,testing,dev]"' \;
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;

- name: Build/Setup test components
run: npm run setup-tests.py # TODO build the packages and save them to packages/ in build job
Expand Down Expand Up @@ -184,6 +188,11 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Download built Dash packages
uses: actions/download-artifact@v4
with:
Expand All @@ -192,10 +201,8 @@ jobs:

- name: Install Dash packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install "setuptools<78.0.0"
python -m pip install "selenium==4.32.0"
find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[async,ci,testing,dev,celery,diskcache]"' \;
uv pip install "selenium==4.32.0"
find packages -name dash-*.whl -print -exec uv pip install "{}[async,ci,testing,dev,celery,diskcache]" \;

- name: Install Google Chrome
run: |
Expand Down Expand Up @@ -297,6 +304,11 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Download built Dash packages
uses: actions/download-artifact@v4
with:
Expand All @@ -305,9 +317,7 @@ jobs:

- name: Install Dash packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install "setuptools<80.0.0"
find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[ci,testing,dev]"' \;
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;

- name: Lint
run: |
Expand Down Expand Up @@ -355,6 +365,11 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Download built Dash packages
uses: actions/download-artifact@v4
with:
Expand All @@ -363,10 +378,8 @@ jobs:

- name: Install Dash packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install "setuptools<80.0.0"
find packages -name dash-*.whl -print -exec sh -c 'pip install "{}[ci,testing,dev]"' \;
pip install pytest-split
find packages -name dash-*.whl -print -exec uv pip install "{}[ci,testing,dev]" \;
uv pip install pytest-split

- name: Install Google Chrome
run: |
Expand Down
Loading