-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into WolfDWyc-tuples-in-forms
- Loading branch information
Showing
131 changed files
with
3,812 additions
and
1,800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,8 @@ jobs: | |
with: | ||
node-version: 18 | ||
|
||
- run: pip install -r python/requirements/all.txt | ||
- run: pip install -r src/python-fastui/requirements/all.txt | ||
- run: pip install src/python-fastui | ||
|
||
- run: npm install | ||
|
||
|
@@ -34,7 +35,46 @@ jobs: | |
env: | ||
SKIP: no-commit-to-branch | ||
|
||
packages-build: | ||
test: | ||
name: test ${{ matrix.python-version }} on ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
||
runs-on: ${{ matrix.os }}-latest | ||
|
||
env: | ||
PYTHON: ${{ matrix.python-version }} | ||
OS: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- run: pip install -r src/python-fastui/requirements/test.txt | ||
- run: pip install -r src/python-fastui/requirements/pyproject.txt | ||
- run: pip install src/python-fastui | ||
|
||
- run: coverage run -m pytest src | ||
|
||
# test demo on 3.11 and 3.12, these tests are intentionally omitted from coverage | ||
- if: matrix.python-version == '3.11' || matrix.python-version == '3.12' | ||
run: pytest demo/tests.py | ||
|
||
- run: coverage xml | ||
|
||
- uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.xml | ||
env_vars: PYTHON,OS | ||
|
||
npm-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -46,11 +86,11 @@ jobs: | |
|
||
- run: npm install | ||
- run: npm run build | ||
- run: tree packages | ||
- run: tree src | ||
|
||
check: # This job does nothing and is only used for the branch protection | ||
if: always() | ||
needs: [lint, packages-build] | ||
needs: [lint, test, npm-build] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -72,22 +112,19 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: install | ||
run: pip install -U build | ||
- run: pip install -U build | ||
|
||
- name: check version | ||
id: check-version | ||
- id: check-version | ||
uses: samuelcolvin/[email protected] | ||
with: | ||
version_file_path: 'python/fastui/__init__.py' | ||
version_file_path: 'src/python-fastui/fastui/__init__.py' | ||
|
||
- run: python -m build --outdir dist src/python-fastui | ||
|
||
- name: build | ||
run: python -m build | ||
- run: ls -lh dist | ||
|
||
- name: Upload package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
htmlcov/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
.DEFAULT_GOAL:=all | ||
paths = python | ||
path = src/python-fastui | ||
|
||
.PHONY: install | ||
install: | ||
pip install -U pip pre-commit pip-tools | ||
pip install -r python/requirements/all.txt | ||
pip install -r $(path)/requirements/all.txt | ||
pip install -e $(path) | ||
pre-commit install | ||
|
||
.PHONY: update-lockfiles | ||
update-lockfiles: | ||
@echo "Updating requirements files using pip-compile" | ||
pip-compile -q --strip-extras -o python/requirements/lint.txt python/requirements/lint.in | ||
pip-compile -q --strip-extras -o python/requirements/pyproject.txt pyproject.toml --extra=fastapi | ||
pip install --dry-run -r python/requirements/all.txt | ||
pip-compile -q --strip-extras -o $(path)/requirements/lint.txt $(path)/requirements/lint.in | ||
pip-compile -q --strip-extras -o $(path)/requirements/pyproject.txt -c $(path)/requirements/lint.txt $(path)/pyproject.toml --extra=fastapi | ||
pip-compile -q --strip-extras -o $(path)/requirements/test.txt -c $(path)/requirements/lint.txt -c $(path)/requirements/pyproject.txt $(path)/requirements/test.in | ||
pip install --dry-run -r $(path)/requirements/all.txt | ||
|
||
.PHONY: format | ||
format: | ||
ruff check --fix-only $(paths) | ||
ruff format $(paths) | ||
ruff check --fix-only $(path) demo | ||
ruff format $(path) demo | ||
|
||
.PHONY: lint | ||
lint: | ||
ruff check $(paths) | ||
ruff format --check $(paths) | ||
ruff check $(path) demo | ||
ruff format --check $(path) demo | ||
|
||
.PHONY: typecheck | ||
typecheck: | ||
pyright python/fastui | ||
pyright | ||
|
||
.PHONY: test | ||
test: | ||
coverage run -m pytest tests | ||
coverage run -m pytest | ||
|
||
.PHONY: testcov | ||
testcov: test | ||
coverage html | ||
|
||
.PHONY: dev | ||
dev: | ||
uvicorn python.demo:app --reload | ||
uvicorn demo:app --reload --reload-dir . | ||
|
||
.PHONY: all | ||
all: testcov lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# FastUI Demo | ||
|
||
This a simple demo app for FastUI, it's deployed at [fastui-demo.onrender.com](https://fastui-demo.onrender.com). | ||
|
||
## Running | ||
|
||
To run the demo app, execute the following commands from the FastUI repo root | ||
|
||
```bash | ||
# create a virtual env | ||
python3.11 -m venv env311 | ||
# activate the env | ||
. env311/bin/activate | ||
# install deps | ||
make install | ||
# run the demo server | ||
make dev | ||
``` | ||
|
||
Then navigate to [http://localhost:8000](http://localhost:8000) | ||
|
||
If you want to run the dev version of the React frontend, run | ||
|
||
```bash | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
This will run at [http://localhost:3000](http://localhost:3000), and connect to the backend running at `localhost:3000`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.