Skip to content

Commit 8e7fe25

Browse files
committed
use pyproject
1 parent 41acb27 commit 8e7fe25

File tree

12 files changed

+2066
-100
lines changed

12 files changed

+2066
-100
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/deploy-dev.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,15 @@ 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'
29-
30-
- name: Install Requirements
31-
run: pip install -r requirements.txt
28+
python-version: "3.12"
3229

3330
- name: Update Reflex CLI
34-
run: pip install reflex-hosting-cli -U
31+
run: uv pip install reflex-hosting-cli -U
3532

3633
- name: Deploy to Reflex
3734
id: deploy
3835
run: |
3936
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: 4 additions & 8 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,13 @@ 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'
28-
29-
- name: Install Requirements
30-
run: pip install -r requirements.txt
26+
python-version: "3.12"
3127

3228
- name: Update Reflex CLI
33-
run: pip install reflex-hosting-cli -U
29+
run: uv pip install reflex-hosting-cli -U
3430

3531
- name: Deploy to Reflex
3632
id: deploy

.github/workflows/deploy-stg.yml

Lines changed: 5 additions & 8 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,13 @@ 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'
29-
30-
- name: Install Requirements
31-
run: pip install -r requirements.txt
28+
python-version: "3.12"
3229

3330
- name: Update Reflex CLI
34-
run: pip install reflex-hosting-cli -U
31+
run: uv pip install reflex-hosting-cli -U
3532

3633
- name: Deploy to Reflex
3734
id: deploy

.github/workflows/integration_tests.yml

Lines changed: 12 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,17 @@ 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+
3235
- name: Install Requirements for reflex-web and reflex
33-
run: pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}' -r requirements.txt
36+
run: uv pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}'
37+
3438
- name: Init Website for reflex-web
3539
run: reflex init
40+
3641
- name: Export the website
37-
run: reflex export
42+
run: reflex export

.github/workflows/unit_tests.yml

Lines changed: 17 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,24 @@ 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+
4047
- 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
48+
run: uv pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}'
49+
50+
- name: Install Playwright
51+
run: playwright install --with-deps
52+
53+
- name: Initialize reflex
54+
run: reflex init
55+
4456
- name: Run unit tests
45-
run: |
46-
export PYTHONUNBUFFERED=1
47-
reflex init
48-
pytest tests
57+
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.

pyproject.toml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[project]
2+
name = "reflex-web"
3+
version = "0.0.1"
4+
authors = [
5+
{ name = "Nikhil Rao", email = "[email protected]" },
6+
{ name = "Alek Petuskey", email = "[email protected]" },
7+
]
8+
readme = "README.md"
9+
requires-python = ">=3.11"
10+
dependencies = [
11+
"email-validator==2.1.1",
12+
"black==23.10.0",
13+
"pandas>=1.5.3",
14+
"psycopg[binary]==3.2.3",
15+
"plotly-express==0.4.1",
16+
"googletrans-py==4.0.0",
17+
"typesense==0.14.0",
18+
"openai==1.13.3",
19+
"pyyaml>=6.0.2",
20+
"flexdown>=0.1.5a12,<0.2",
21+
"reflex @ git+https://github.com/reflex-dev/reflex@main",
22+
"mistletoe>=1.2.1",
23+
"reflex-image-zoom>=0.0.2",
24+
"reflex-chat==0.0.2a1",
25+
"reflex_type_animation==0.0.1",
26+
"reflex-ag-grid==0.0.10",
27+
"replicate==0.32.1",
28+
"reflex-pyplot==0.1.3",
29+
"python-multipart==0.0.20",
30+
]
31+
32+
[dependency-groups]
33+
dev = ["pytest", "playwright", "pytest-playwright", "uvicorn"]
34+
35+
[tool.setuptools.packages.find]
36+
where = ["pcweb"]
37+
38+
[tool.ruff]
39+
target-version = "py311"
40+
output-format = "concise"
41+
lint.isort.split-on-trailing-comma = false
42+
lint.select = [
43+
"ANN001",
44+
"B",
45+
"C4",
46+
"D",
47+
"E",
48+
"ERA",
49+
"F",
50+
"FURB",
51+
"I",
52+
"N",
53+
"PERF",
54+
"PGH",
55+
"PTH",
56+
"RUF",
57+
"SIM",
58+
"T",
59+
"TRY",
60+
"W",
61+
]
62+
lint.ignore = [
63+
"B008",
64+
"D205",
65+
"E501",
66+
"F403",
67+
"SIM115",
68+
"RUF006",
69+
"RUF008",
70+
"RUF012",
71+
"TRY0",
72+
]
73+
lint.pydocstyle.convention = "google"

0 commit comments

Comments
 (0)