Skip to content

Commit afd12b4

Browse files
authored
use pyproject (#1362)
* use pyproject * activate venv * uv run playwright * sync explicitly * add explicit sync
1 parent a9164f0 commit afd12b4

File tree

13 files changed

+2084
-98
lines changed

13 files changed

+2084
-98
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
3-
"postCreateCommand": "/bin/bash -c 'python -m pip install -r requirements.txt && reflex init'",
3+
"postCreateCommand": "/bin/bash -c 'python -m pip install . && reflex init'",
44
"forwardPorts": [3000, 8000],
55
"portsAttributes": {
66
"3000": {

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v3
1414
- name: Codespell
15-
uses: codespell-project/actions-codespell@v2
15+
uses: codespell-project/actions-codespell@v2

.github/workflows/deploy-dev.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,19 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v3
2424

25-
- name: Set up Python
26-
uses: actions/setup-python@v4
25+
- name: Install the latest version of uv
26+
uses: astral-sh/setup-uv@v6
2727
with:
28-
python-version: '3.12'
28+
python-version: "3.12"
29+
activate-environment: true
2930

30-
- name: Install Requirements
31-
run: pip install -r requirements.txt
31+
- name: Install the project
32+
run: uv sync --locked --no-dev
3233

3334
- name: Update Reflex CLI
34-
run: pip install reflex-hosting-cli -U
35+
run: uv pip install reflex-hosting-cli -U
3536

3637
- name: Deploy to Reflex
3738
id: deploy
3839
run: |
3940
reflex deploy --project ${{ secrets.DEV_PROJECT_ID }} --token ${{ secrets.DEV_TOKEN }} --no-interactive
40-
41-
42-
43-
44-

.github/workflows/deploy-prd.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
workflow_dispatch:
55
# This allows manual triggering of the workflow
66

7-
87
concurrency:
98
group: deploy-prod
109
cancel-in-progress: false
@@ -21,16 +20,17 @@ jobs:
2120
- name: Checkout code
2221
uses: actions/checkout@v3
2322

24-
- name: Set up Python
25-
uses: actions/setup-python@v4
23+
- name: Install the latest version of uv
24+
uses: astral-sh/setup-uv@v6
2625
with:
27-
python-version: '3.12'
26+
python-version: "3.12"
27+
activate-environment: true
2828

29-
- name: Install Requirements
30-
run: pip install -r requirements.txt
29+
- name: Install the project
30+
run: uv sync --locked --no-dev
3131

3232
- name: Update Reflex CLI
33-
run: pip install reflex-hosting-cli -U
33+
run: uv pip install reflex-hosting-cli -U
3434

3535
- name: Deploy to Reflex
3636
id: deploy

.github/workflows/deploy-stg.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to staging
33
on:
44
push:
55
branches:
6-
- 'r/*'
6+
- "r/*"
77

88
concurrency:
99
group: deploy-staging
@@ -22,16 +22,17 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v3
2424

25-
- name: Set up Python
26-
uses: actions/setup-python@v4
25+
- name: Install the latest version of uv
26+
uses: astral-sh/setup-uv@v6
2727
with:
28-
python-version: '3.12'
28+
python-version: "3.12"
29+
activate-environment: true
2930

30-
- name: Install Requirements
31-
run: pip install -r requirements.txt
31+
- name: Install the project
32+
run: uv sync --locked --no-dev
3233

3334
- name: Update Reflex CLI
34-
run: pip install reflex-hosting-cli -U
35+
run: uv pip install reflex-hosting-cli -U
3536

3637
- name: Deploy to Reflex
3738
id: deploy

.github/workflows/integration_tests.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: integration-tests
22

33
env:
44
TELEMETRY_ENABLED: false
5-
NODE_OPTIONS: '--max_old_space_size=8192'
5+
NODE_OPTIONS: "--max_old_space_size=8192"
66
REFLEX_DEP: "git+https://github.com/reflex-dev/reflex@main"
77
on:
88
push:
9-
branches: [ "main" ]
9+
branches: ["main"]
1010
pull_request:
11-
branches: [ "main" ]
11+
branches: ["main"]
1212
workflow_dispatch:
1313
inputs:
1414
reflex_dep:
@@ -26,12 +26,21 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: actions/setup-python@v3
29+
30+
- name: Install the latest version of uv
31+
uses: astral-sh/setup-uv@v6
3032
with:
31-
python-version: '3.11'
33+
python-version: "3.11"
34+
activate-environment: true
35+
36+
- name: Install the project
37+
run: uv sync --locked --all-extras --dev
38+
3239
- name: Install Requirements for reflex-web and reflex
33-
run: pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}' -r requirements.txt
40+
run: uv pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}'
41+
3442
- name: Init Website for reflex-web
3543
run: reflex init
44+
3645
- name: Export the website
37-
run: reflex export
46+
run: reflex export

.github/workflows/unit_tests.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
OPENAI_API_KEY: dummy
99
TELEMETRY_ENABLED: false
1010
REFLEX_DEP: "git+https://github.com/reflex-dev/reflex@main"
11+
PYTHONUNBUFFERED: 1
1112

1213
on:
1314
push:
@@ -33,16 +34,28 @@ jobs:
3334
fail-fast: false
3435
matrix:
3536
os: [ubuntu-latest]
36-
python-version: ["3.11.5", "3.12.0"]
37+
python-version: ["3.11", "3.12"]
3738
runs-on: ${{ matrix.os }}
3839
steps:
3940
- uses: actions/checkout@v4
41+
42+
- name: Install the latest version of uv
43+
uses: astral-sh/setup-uv@v6
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
activate-environment: true
47+
48+
- name: Install the project
49+
run: uv sync --locked --all-extras --dev
50+
4051
- name: Install Requirements for reflex-web and reflex
41-
run: |
42-
pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}' -r requirements.txt pytest playwright pytest-playwright uvicorn
43-
playwright install --with-deps
52+
run: uv pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}'
53+
54+
- name: Install Playwright
55+
run: uv run playwright install --with-deps
56+
57+
- name: Initialize reflex
58+
run: reflex init
59+
4460
- name: Run unit tests
45-
run: |
46-
export PYTHONUNBUFFERED=1
47-
reflex init
48-
pytest tests
61+
run: pytest tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ pynecone.db
1919
reflex.db
2020
venv/
2121
.env
22+
build
23+
*.egg-info

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ We recommend using a virtual environment with Python 3.10 or higher to run this
4747
6. Install the dependencies.
4848

4949
```bash
50-
python -m pip install -r requirements.txt
50+
python -m pip install .
5151
```
5252

5353
7. Run the project.

pypoetry.toml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)