Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into masenf/check_generate…
Browse files Browse the repository at this point in the history
…d_pyi_fix
  • Loading branch information
masenf committed Nov 16, 2023
2 parents ead6616 + ddb1f81 commit 6c1a2c9
Show file tree
Hide file tree
Showing 256 changed files with 30,530 additions and 4,254 deletions.
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"postCreateCommand": "/bin/bash -c 'python -m pip install poetry && python -m poetry install & git clone https://github.com/reflex-dev/reflex-examples; wait'",
"forwardPorts": [3000, 8000],
"portsAttributes": {
"3000": {
"label": "Frontend",
"onAutoForward": "notify"
},
"8000": {
"label": "Backend"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lighthouse-tests
name: benchmarking

on:
push:
Expand Down Expand Up @@ -62,8 +62,14 @@ jobs:
run: |
# Check that npm is home
npm -v
poetry run bash scripts/lighthouse.sh ./reflex-web prod
poetry run bash scripts/benchmarks.sh ./reflex-web prod
env:
LHCI_GITHUB_APP_TOKEN: $
POSTHOG: $

- name: Run Benchmarks
working-directory: ./integration/benchmarks
run:
poetry run python benchmarks.py "$GITHUB_SHA" .lighthouseci
env:
GITHUB_SHA: ${{ github.sha }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PR_TITLE: ${{ github.event.pull_request.title }}
3 changes: 2 additions & 1 deletion .github/workflows/integration_app_harness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
strategy:
matrix:
state_manager: [ "redis", "memory" ]
python-version: ["3.11.5", "3.12.0"]
runs-on: ubuntu-latest
services:
# Label used to access the service container
Expand All @@ -37,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: "3.11.5"
python-version: ${{ matrix.python-version }}
run-poetry-install: true
create-venv-at-path: .venv
- run: poetry run pip install pyvirtualdisplay pillow
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# Show OS combos first in GUI
os: [ ubuntu-latest, windows-latest, macos-latest ]
node-version: [ "16.x" ]
python-version: ["3.8.18", "3.9.18", "3.10.13", "3.11.5"]
python-version: ["3.8.18", "3.9.18", "3.10.13", "3.11.5", "3.12.0"]
exclude:
- os: windows-latest
python-version: "3.10.13"
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-web
ref: reflex-ci
ref: main
path: reflex-web

- name: Install Requirements for reflex-web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8.18", "3.9.18", "3.10.13", "3.11.5"]
python-version: ["3.8.18", "3.9.18", "3.10.13", "3.11.5", "3.12.0"]
# Windows is a bit behind on Python version availability in Github
exclude:
- os: windows-latest
Expand Down
29 changes: 6 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ For an extensive guide on the different ways to contribute to Reflex see our [Co


## Running a Local Build of Reflex
Here is a quick guide to how the run Reflex repo locally so you can start contributing to the project.
Here is a quick guide on how to run Reflex repo locally so you can start contributing to the project.

**Prerequisites:**
- Python >= 3.8
Expand Down Expand Up @@ -34,23 +34,6 @@ cd examples
poetry run reflex init
poetry run reflex run
```
All the changes you make to the repository will be reflected in your running app.


## 🧪 Testing and QA

Within the 'test' directory of Reflex you can add to a test file already there or create a new test python file if it doesn't fit into the existing layout.

#### What to unit test?
- Any feature or significant change that has been added.
- Any edge cases or potential problem areas.
- Any interactions between different parts of the code.

Now Init/Run
``` bash
poetry run reflex init
poetry run reflex run
```

All the changes you make to the repository will be reflected in your running app.
* We have the examples folder in the .gitignore, so your changes in reflex/examples won't be reflected in your commit.
Expand All @@ -61,20 +44,20 @@ Any feature or significant change added should be accompanied with unit tests.

Within the 'test' directory of Reflex you can add to a test file already there or create a new test python file if it doesn't fit into the existing layout.

What to unit test?
#### What to unit test?
- Any feature or significant change that has been added.
- Any edge cases or potential problem areas.
-Any interactions between different parts of the code.
- Any interactions between different parts of the code.


## ✅ Making a PR

Once you solve a current issue or improvement to Reflex, you can make a pr, and we will review the changes.
Once you solve a current issue or improvement to Reflex, you can make a PR, and we will review the changes.

Before submitting, a pull request, ensure the following steps are taken and test passing.

In your `reflex` directory run make sure all the unit tests are still passing using the following command.
This will fail if code coverage is below 80%.
This will fail if code coverage is below 70%.
``` bash
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
```
Expand All @@ -95,4 +78,4 @@ Note that pre-commit will only be installed when you use a Python version >= 3.8
pre-commit install
```

That's it you can now submit your pr. Thanks for contributing to Reflex!
That's it you can now submit your PR. Thanks for contributing to Reflex!
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
[![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex)
![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg)
![versions](https://img.shields.io/pypi/pyversions/reflex.svg)
[![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction)
[![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction)
[![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ)
</div>

---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md)

[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md)

---
## ⚙️ Installation

Expand Down Expand Up @@ -54,7 +56,7 @@ Now you can modify the source code in `my_app_name/my_app_name.py`. Reflex has f

## 🫧 Example App

Let's go over an example: creating an image generation UI around DALL·E. For simplicity, we just call the OpenAI API, but you could replace this with an ML model run locally.
Let's go over an example: creating an image generation UI around [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). For simplicity, we just call the [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), but you could replace this with an ML model run locally.

&nbsp;

Expand Down Expand Up @@ -142,7 +144,7 @@ This `index` function defines the frontend of the app.
We use different components such as `center`, `vstack`, `input`, and `button` to build the frontend. Components can be nested within each other
to create complex layouts. And you can use keyword args to style them with the full power of CSS.

Reflex comes with [60+ built-in components](https://reflex.dev/docs/library) to help you get started. We are actively adding more components, and it's easy to [create your own components](https://reflex.dev/docs/advanced-guide/wrapping-react).
Reflex comes with [60+ built-in components](https://reflex.dev/docs/library) to help you get started. We are actively adding more components, and it's easy to [create your own components](https://reflex.dev/docs/wrapping-react/overview/).

### **State**

Expand Down Expand Up @@ -228,9 +230,9 @@ We welcome contributions of any size! Below are some good ways to get started in

- **Join Our Discord**: Our [Discord](https://discord.gg/T5WSbC2YtQ) is the best place to get help on your Reflex project and to discuss how you can contribute.
- **GitHub Discussions**: A great way to talk about features you want added or things that are confusing/need clarification.
- **GitHub Issues**: These are an excellent way to report bugs. Additionally, you can try and solve an existing issue and submit a PR.
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) are an excellent way to report bugs. Additionally, you can try and solve an existing issue and submit a PR.

We are actively looking for contributors, no matter your skill level or experience.
We are actively looking for contributors, no matter your skill level or experience. To contribute check out [CONTIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)

## License

Expand Down
2 changes: 1 addition & 1 deletion docker-example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY . .
# Create virtualenv which will be copied into final container
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python3 -m venv $VIRTUAL_ENV
RUN python3.11 -m venv $VIRTUAL_ENV

# Install app requirements and reflex inside virtualenv
RUN pip install -r requirements.txt
Expand Down
Loading

0 comments on commit 6c1a2c9

Please sign in to comment.