Skip to content

Commit

Permalink
Rename pynecone to reflex (reflex-dev#1236)
Browse files Browse the repository at this point in the history
  • Loading branch information
picklelo authored Jun 25, 2023
1 parent d9e4d6d commit 139ce38
Show file tree
Hide file tree
Showing 216 changed files with 4,377 additions and 4,283 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
source = pynecone
source = reflex
branch = true

[report]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If applicable, add screenshots to help explain your problem.

** Specifics (please complete the following information):**
- Python Version:
- Pynecone Version:
- Reflex Version:
- OS:
- Browser (Optional):

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: poetry install --no-interaction
- run: poetry run pytest tests --cov --no-cov-on-fail --cov-report=
- run: poetry run pyright pynecone tests
- run: poetry run pyright reflex tests
- run: poetry run ruff check . --format github
- run: find pynecone tests -name "*.py" -not -path pynecone/pc.py | xargs poetry run darglint
- run: poetry run black --check pynecone tests
- run: find reflex tests -name "*.py" -not -path reflex/reflex.py | xargs poetry run darglint
- run: poetry run black --check reflex tests
- run: poetry run coverage html
6 changes: 3 additions & 3 deletions .github/workflows/integration_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Clone Pynecone Website Repo For integration tests
- name: Clone Pynecone Examples Repo
# Clone Reflex Website Repo For integration tests
- name: Clone Reflex Examples Repo
uses: actions/checkout@v3
with:
repository: pynecone-io/pynecone-examples
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
run: poetry run pip install -r requirements.txt
- name: Init Website
working-directory: ./pynecone-examples/counter
run: poetry run pc init
run: poetry run reflex init
- name: Check for errors
run: |
chmod +x ./scripts/integration.sh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Clone Pynecone Website Repo For integration tests
- name: Clone Pynecone Website Repo
# Clone Reflex Website Repo For integration tests
- name: Clone Reflex Website Repo
uses: actions/checkout@v3
with:
repository: pynecone-io/pcweb
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
run: poetry run pip install -r requirements.txt && poetry run pip install googletrans
- name: Init Website
working-directory: ./pcweb
run: poetry run pc init
run: poetry run reflex init
- name: Run Website and Check for errors
run: |
chmod +x ./scripts/integration.sh
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ repos:
rev: v1.1.313
hooks:
- id: pyright
args: [pynecone, tests]
args: [reflex, tests]
language: system

- repo: https://github.com/terrencepreilly/darglint
rev: v1.8.1
hooks:
- id: darglint
exclude: '^pynecone/pc.py'
exclude: '^reflex/reflex.py'

- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
args: [pynecone, tests]
args: [reflex, tests]
42 changes: 21 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# Welcome to Pynecone contributing guide! 🥳
# Welcome to Reflex contributing guide! 🥳

## Getting started

To navigate our codebase with confidence, see [Pynecone Docs](https://pynecone.io/docs/getting-started/introduction) :confetti_ball:.
To navigate our codebase with confidence, see [Reflex Docs](https://pynecone.io/docs/getting-started/introduction) :confetti_ball:.

### Discussions

- Have a question? Want to discuss a feature? [Start a discussion](https://github.com/pynecone-io/pynecone/discussions)

We welcome any discussions and questions. We want to make sure that Pynecone is the best it can be, and we can't do that without your help.
We welcome any discussions and questions. We want to make sure that Reflex is the best it can be, and we can't do that without your help.

### Issues

* #### Create a new issue

If you spot a problem with anything in Pynecone feel free to create an issue. Even if you are not sure if its a problem with the framework or your own code, create an issue and we will do our best to answer or resolve it.
If you spot a problem with anything in Reflex feel free to create an issue. Even if you are not sure if its a problem with the framework or your own code, create an issue and we will do our best to answer or resolve it.

* #### Solve an issue

Scan through our [existing issues](https://github.com/pynecone-io/pynecone/issues) to find one that interests you. You can narrow down the search using `labels` as filters. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. Any large issue changing the compiler of Pynecone should brought to the Pynecone maintainers for approval
Scan through our [existing issues](https://github.com/pynecone-io/pynecone/issues) to find one that interests you. You can narrow down the search using `labels` as filters. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. Any large issue changing the compiler of Reflex should brought to the Reflex maintainers for approval

Thank you for supporting Pynecone!🎊
Thank you for supporting Reflex!🎊

## 💻 How to Run a Local Build of Pynecone
Here is a quick guide to how the run Pynecone repo locally so you can start contributing to the project.
## 💻 How to Run 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.

First clone Pynecone:
First clone Reflex:
``` bash
git clone https://github.com/pynecone-io/pynecone.git
```

Navigate into the repo:
``` bash
cd pynecone
cd reflex
```

Install poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info).

Install your local Pynecone build:
Install your local Reflex build:
``` bash
poetry install
```
Expand All @@ -56,18 +56,18 @@ cd example

Now Init/Run
``` bash
poetry run pc init
poetry run pc run
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 pynecone/examples won't be reflected in your commit.
* We have the examples folder in the .gitignore, so your changes in reflex/examples won't be reflected in your commit.

## 🧪 Testing and QA

Any feature or significant change added should be accompanied with unit tests.

Within the 'test' directory of Pynecone 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.
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.
Expand All @@ -77,24 +77,24 @@ What to unit test?

## ✅ Making a PR

Once you solve a current issue or improvement to Pynecone, 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 `pynecone` directory run make sure all the unit tests are still passing using the following command.
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%.
``` bash
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
```
Next make sure all the following tests pass. This ensures that every new change has proper documentation and type checking.
``` bash
poetry run ruff check .
poetry run pyright pynecone tests
find pynecone tests -name "*.py" -not -path pynecone/pc.py | xargs poetry run darglint
poetry run pyright reflex tests
find reflex tests -name "*.py" -not -path reflex/reflex.py | xargs poetry run darglint
```
Finally, run `black` to format your code.
``` bash
poetry run black pynecone tests
poetry run black reflex tests
```

Consider installing git pre-commit hooks so Ruff, Pyright, Darglint and Black will run automatically before each commit.
Expand All @@ -103,4 +103,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 Pynecone!
That's it you can now submit your pr. Thanks for contributing to Reflex!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023, Pynecone Inc
Copyright 2023, Pynecone, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
```diff
+ ATTENTION: Over the next week we will be changing our project name from Pynecone to Reflex.

The new name aligns with our goal of allowing you to build apps easily, while also being flexible and powerful enough to handle all your use cases.

Major Changes:
+ Our domain will switch from https://pynecone.io/ -> https://pynecone.io/
+ Our pip install will switch from pip install pynecone -> pip install reflex
+ Our Github repo will switch from https://github.com/pynecone-io/pynecone -> https://github.com/reflex-dev/reflex
+ Our library will change from import pynecone as pc to import reflex as rx

We will have a feature freeze until we migrate our code and website to the new name.

Our goal is to complete the transition by June 30. Thanks for your support - please message on Discord if you have any questions or concerns!
```

<div align="center">

<img src="docs/images/cones.png">
Expand Down
10 changes: 5 additions & 5 deletions docker-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.11-slim as base

RUN adduser --disabled-password pynecone
RUN adduser --disabled-password reflex


FROM base as build
Expand Down Expand Up @@ -34,16 +34,16 @@ FROM runtime as init
WORKDIR /app
ENV BUN_INSTALL="/app/.bun"
COPY --from=build /app/ /app/
RUN pc init
RUN reflex init


FROM runtime

COPY --chown=pynecone --from=init /app/ /app/
USER pynecone
COPY --chown=reflex --from=init /app/ /app/
USER reflex
WORKDIR /app

CMD ["pc","run" , "--env", "prod"]
CMD ["rx","run" , "--env", "prod"]

EXPOSE 3000
EXPOSE 8000
24 changes: 12 additions & 12 deletions docker-example/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Pynecone Container Image Build
# Reflex Container Image Build

This example describes how to create and use a container image for Pynecone with your own code.
This example describes how to create and use a container image for Reflex with your own code.

## Update Requirements

The `requirements.txt` includes the pynecone package which is need to install Pynecone framework. If you use additional packages in your project you have add this in the `requirements.txt` first. Copy the `Dockerfile` and the `requirements.txt` file in your project folder.
The `requirements.txt` includes the reflex package which is need to install Reflex framework. If you use additional packages in your project you have add this in the `requirements.txt` first. Copy the `Dockerfile` and the `requirements.txt` file in your project folder.

## Customize Pynecone Config
## Customize Reflex Config

The `pcconfig.py` includes the configuration of your Pynecone service. Edit the file like the following configuration. If you want to use a custom database you can set the endpoint in this file.
The `rxconfig.py` includes the configuration of your Reflex service. Edit the file like the following configuration. If you want to use a custom database you can set the endpoint in this file.

```python
import pynecone as pc
import reflex as rx

config = pc.Config(
config = rx.Config(
app_name="app",
api_url="0.0.0.0:8000",
bun_path="/app/.bun/bin/bun",
db_url="sqlite:///pynecone.db",
db_url="sqlite:///reflex.db",
)
```

## Build Pynecone Container Image
## Build Reflex Container Image

To build your container image run the following command:

```bash
docker build -t pynecone-project:latest .
docker build -t reflex-project:latest .
```

## Start Container Service

Finally, you can start your Pynecone container service as follows:
Finally, you can start your Reflex container service as follows:

```bash
docker run -d -p 3000:3000 -p 8000:8000 --name pynecone pynecone-project:latest
docker run -d -p 3000:3000 -p 8000:8000 --name reflex reflex-project:latest
```
2 changes: 1 addition & 1 deletion docker-example/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone
reflex
Loading

0 comments on commit 139ce38

Please sign in to comment.