Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 4cbd96c

Browse files
authored
Revert "Migrates from pip to uv and adds dynamic versioning (#6156)" (#6167)
This reverts commit 956ddbc.
1 parent a261559 commit 4cbd96c

24 files changed

Lines changed: 1258 additions & 647 deletions

.devcontainer/postCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
uv pip install -e /workspaces/dispatch
1+
pip install -e /workspaces/dispatch
22
npm install --prefix /workspaces/dispatch/src/dispatch/static/dispatch
33

44
export LOG_LEVEL="ERROR"

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
kevgliss
2+
metroid-samus
23
mvilanova
34
whitdog47
45
wssheldon

.github/workflows/playwright.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,41 +92,32 @@ jobs:
9292
- name: Set up Python 3.11
9393
uses: actions/setup-python@v5
9494
with:
95-
python-version: 3.11.11
95+
python-version: 3.11
9696
- uses: actions/setup-node@v4
9797
with:
98-
node-version-file: .nvmrc
98+
node-version: 18
9999
- uses: actions/cache@v4
100100
with:
101101
path: ~/.cache/pip
102102
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
103103
restore-keys: |
104104
${{ runner.os }}-pip-
105-
- name: Install uv
106-
run: |
107-
curl -LsSf https://astral.sh/uv/install.sh | sh
108-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
109-
- name: Install dependencies
105+
- name: Install python dependencies
110106
run: |
111107
export DISPATCH_LIGHT_BUILD=1
112-
uv venv
113-
source .venv/bin/activate
114-
uv pip install psycopg[binary]
115-
uv pip install -e ".[dev]"
108+
python -m pip install --upgrade pip
109+
pip install psycopg[binary]
110+
pip install -e ".[dev]"
116111
- name: Install npm dependencies
117112
run: |
118113
npm ci -D --prefix src/dispatch/static/dispatch
119-
npm ci
114+
npm install -D @playwright/test
120115
- name: Install playwright browsers
121116
run: npx playwright install --with-deps chromium
122117
- name: Setup sample database
123-
run: |
124-
source .venv/bin/activate
125-
dispatch database restore --dump-file data/dispatch-sample-data.dump --skip-check && dispatch database upgrade
118+
run: dispatch database restore --dump-file data/dispatch-sample-data.dump --skip-check && dispatch database upgrade
126119
- name: Run tests
127-
run: |
128-
source .venv/bin/activate
129-
npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
120+
run: npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
130121
- uses: actions/upload-artifact@v4
131122
if: always()
132123
with:
Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,15 @@
11
name: Test image build
22

3-
"on":
4-
pull_request:
5-
paths:
6-
- "Dockerfile"
7-
- "docker/Dockerfile"
8-
- "src/**"
9-
- "pyproject.toml"
10-
- ".github/workflows/publish-image-test.yml"
3+
on: pull_request
114

125
jobs:
136
build_image:
14-
name: Build and test Docker image
7+
name: Build Docker image
158
runs-on: ubuntu-latest
169
steps:
1710
- name: Check out the repo
1811
uses: actions/checkout@v4
19-
20-
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v3
22-
23-
- name: Extract metadata
24-
id: meta
25-
uses: docker/metadata-action@v5
26-
with:
27-
images: dispatch-test
28-
tags: |
29-
type=ref,event=pr,prefix=pr-
30-
type=sha,prefix=sha-
31-
32-
- name: Build Docker image
33-
uses: docker/build-push-action@v6
12+
- name: Build without push
13+
uses: docker/build-push-action@v1
3414
with:
35-
context: .
36-
file: ./Dockerfile
3715
push: false
38-
tags: ${{ steps.meta.outputs.tags }}
39-
labels: ${{ steps.meta.outputs.labels }}
40-
cache-from: type=gha
41-
cache-to: type=gha,mode=max
42-
build-args: |
43-
SOURCE_COMMIT=${{ github.sha }}
44-
VITE_DISPATCH_COMMIT_HASH=${{ github.sha }}
45-
46-
# - name: Run Trivy vulnerability scanner
47-
# uses: aquasecurity/trivy-action@master
48-
# with:
49-
# image-ref: "dispatch-test:${{ github.event.pull_request.head.sha || github.sha }}"
50-
# format: "sarif"
51-
# output: "trivy-results.sarif"
52-
53-
# - name: Upload Trivy scan results to GitHub Security tab
54-
# uses: github/codeql-action/upload-sarif@v3
55-
# if: always()
56-
# with:
57-
# sarif_file: "trivy-results.sarif"
Lines changed: 7 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,19 @@
11
name: Publish Docker image
2-
3-
"on":
2+
on:
43
release:
54
types: [published]
6-
workflow_dispatch:
7-
inputs:
8-
tag:
9-
description: "Tag to build and push"
10-
required: true
11-
default: "latest"
12-
13-
env:
14-
REGISTRY_GITHUB: ghcr.io
15-
REGISTRY_DOCKERHUB: docker.io
16-
IMAGE_NAME: netflix/dispatch
17-
185
jobs:
196
push_to_registry:
20-
name: Build and push Docker image
7+
name: Push Docker image to GitHub Packages
218
runs-on: ubuntu-latest
22-
permissions:
23-
contents: read
24-
packages: write
25-
security-events: write
269
steps:
2710
- name: Check out the repo
2811
uses: actions/checkout@v4
29-
30-
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v3
32-
33-
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v3
35-
36-
- name: Log in to GitHub Container Registry
37-
uses: docker/login-action@v3
12+
- name: Push to GitHub Packages
13+
uses: docker/build-push-action@v1
3814
with:
39-
registry: ${{ env.REGISTRY_GITHUB }}
4015
username: ${{ github.actor }}
4116
password: ${{ secrets.GITHUB_TOKEN }}
42-
43-
- name: Log in to Docker Hub
44-
uses: docker/login-action@v3
45-
continue-on-error: true
46-
with:
47-
registry: ${{ env.REGISTRY_DOCKERHUB }}
48-
username: ${{ secrets.DOCKERHUB_USERNAME }}
49-
password: ${{ secrets.DOCKERHUB_TOKEN }}
50-
51-
- name: Extract metadata
52-
id: meta
53-
uses: docker/metadata-action@v5
54-
with:
55-
images: |
56-
${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }}
57-
${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
58-
tags: |
59-
type=ref,event=tag
60-
type=ref,event=branch
61-
type=semver,pattern={{version}}
62-
type=semver,pattern={{major}}.{{minor}}
63-
type=semver,pattern={{major}}
64-
type=raw,value=latest,enable={{is_default_branch}}
65-
66-
- name: Build and push Docker image
67-
uses: docker/build-push-action@v6
68-
with:
69-
context: .
70-
file: ./Dockerfile
71-
platforms: linux/amd64,linux/arm64
72-
push: true
73-
tags: ${{ steps.meta.outputs.tags }}
74-
labels: ${{ steps.meta.outputs.labels }}
75-
cache-from: type=gha
76-
cache-to: type=gha,mode=max
77-
build-args: |
78-
SOURCE_COMMIT=${{ github.sha }}
79-
VITE_DISPATCH_COMMIT_HASH=${{ github.sha }}
80-
81-
# - name: Run Trivy vulnerability scanner
82-
# uses: aquasecurity/trivy-action@master
83-
# with:
84-
# image-ref: ${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
85-
# format: "sarif"
86-
# output: "trivy-results.sarif"
87-
88-
# - name: Upload Trivy scan results to GitHub Security tab
89-
# uses: github/codeql-action/upload-sarif@v3
90-
# if: always()
91-
# with:
92-
# sarif_file: "trivy-results.sarif"
93-
94-
# - name: Generate SBOM
95-
# uses: anchore/sbom-action@v0
96-
# with:
97-
# image: ${{ env.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
98-
# format: spdx-json
99-
# output-file: sbom.spdx.json
100-
101-
# - name: Upload SBOM
102-
# uses: actions/upload-artifact@v4
103-
# with:
104-
# name: sbom
105-
# path: sbom.spdx.json
17+
registry: docker.pkg.github.com
18+
repository: netflix/dispatch/dispatch-image
19+
tag_with_ref: true

.github/workflows/python.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,25 @@ jobs:
2727
- name: Set up Python 3.11
2828
uses: actions/setup-python@v5
2929
with:
30-
python-version: 3.11.11
30+
python-version: 3.11.2
3131
- uses: actions/cache@v4
3232
with:
3333
path: ~/.cache/pip
3434
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
3535
restore-keys: |
3636
${{ runner.os }}-pip-
37-
- name: Install uv
38-
run: |
39-
curl -LsSf https://astral.sh/uv/install.sh | sh
40-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4137
- name: Install python dependencies
4238
run: |
4339
export DISPATCH_LIGHT_BUILD=1
44-
uv venv
45-
source .venv/bin/activate
46-
uv pip install -e ".[dev]"
40+
python -m pip install --upgrade pip
41+
pip install -e ".[dev]"
4742
- name: "Lint with ruff"
4843
run: |
49-
source .venv/bin/activate
5044
ruff check src tests
5145
ruff format src tests
5246
- name: Test with pytest
5347
run: |
54-
source .venv/bin/activate
55-
uv pip install pytest-cov
48+
pip install pytest-cov
5649
pytest --junitxml=junit/test-results.xml --cov=dispatch --cov-report=json:coverage.json --cov-report=xml --cov-report=html
5750
- name: Coverage per file
5851
# All modified files should meet the minimum code coverage requirement.

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ ipython_config.py
133133
!data/.env
134134
.venv
135135
env/
136-
# uv
137-
uv.lock
138136
venv/
139137
ENV/
140138
env.bak/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quick Start:
22
#
3-
# uv pip install pre-commit
3+
# pip install pre-commit
44
# pre-commit install && pre-commit install -t pre-push
55
# pre-commit run --all-files
66
#
@@ -10,7 +10,7 @@
1010
fail_fast: false
1111

1212
default_language_version:
13-
python: python3.11.11
13+
python: python3.11.2
1414

1515
repos:
1616
- repo: https://github.com/astral-sh/ruff-pre-commit

docker/Dockerfile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515
# Needed for fetching stuff
1616
ca-certificates \
1717
wget \
18-
curl \
1918
&& rm -rf /var/lib/apt/lists/*
2019

21-
# Install uv for building
22-
RUN curl -LsSf https://astral.sh/uv/0.4.17/install.sh | sh && \
23-
mv /root/.cargo/bin/uv /usr/local/bin/
24-
2520
RUN wget --quiet -O - https://deb.nodesource.com/setup_20.x | bash - \
2621
&& apt-get install -y nodejs --no-install-recommends
2722

@@ -56,7 +51,7 @@ COPY . /usr/src/dispatch/
5651
RUN YARN_CACHE_FOLDER="$(mktemp -d)" \
5752
&& export YARN_CACHE_FOLDER \
5853
&& pushd /usr/src/dispatch \
59-
&& uv build \
54+
&& python setup.py bdist_wheel \
6055
&& rm -r "$YARN_CACHE_FOLDER" \
6156
&& mv /usr/src/dispatch/dist /dist
6257

@@ -86,13 +81,9 @@ ENV PIP_NO_CACHE_DIR=off \
8681
RUN apt-get update && apt-get install -y --no-install-recommends \
8782
# Needed for fetching stuff
8883
ca-certificates \
89-
wget gnupg curl \
84+
wget gnupg \
9085
&& rm -rf /var/lib/apt/lists/*
9186

92-
# Install uv
93-
RUN curl -LsSf https://astral.sh/uv/0.4.17/install.sh | sh && \
94-
mv /root/.cargo/bin/uv /usr/local/bin/
95-
9687
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
9788
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
9889

@@ -103,7 +94,7 @@ RUN buildDeps="" \
10394
&& apt-get update \
10495
&& apt-get install -y --no-install-recommends "$buildDeps" \
10596
# remove internal index when internal plugins are separated
106-
&& uv pip install --system -U /tmp/dist/*.whl \
97+
&& pip install -U /tmp/dist/*.whl \
10798
&& apt-get purge -y --auto-remove "$buildDeps" \
10899
# We install run-time dependencies strictly after
109100
# build dependencies to prevent accidental collusion.
@@ -115,7 +106,7 @@ RUN buildDeps="" \
115106
&& rm -rf /var/lib/apt/lists/* \
116107
# mjml has to be installed differently here because
117108
# after node 14, docker will install npm files at the
118-
# root directory and fail, so we have to create a new
109+
# root directoy and fail, so we have to create a new
119110
# directory and use it for the install then copy the
120111
# files to the root directory to maintain backwards
121112
# compatibility for email generation

docs/docs/administration/contributing/environment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This guide assumes you're using an OS of the Linux/Unix variant \(Ubuntu/OS X\)
1212
Install Dispatch with PIP:
1313

1414
```bash
15-
> DISPATCH_LIGHT_BUILD=1 uv pip install -e .[dev]
15+
> DISPATCH_LIGHT_BUILD=1 pip install -e .[dev]
1616
```
1717

1818
Run dev server:
@@ -55,7 +55,7 @@ Create a new virtualenv just for Dispatch:
5555
Install Dispatch with pip:
5656

5757
```bash
58-
> uv pip install -e /path/to/dispatch
58+
> pip install -e /path/to/dispatch
5959
```
6060

6161
Test it by seeing if the `dispatch` command is in your path:

0 commit comments

Comments
 (0)