-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from samuelcolvin/refactor-package
Refactor
- Loading branch information
Showing
47 changed files
with
424 additions
and
69 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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '**' | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- run: pip install -r python/requirements/all.txt | ||
|
||
- run: npm install | ||
|
||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files | ||
env: | ||
SKIP: no-commit-to-branch | ||
|
||
check: # This job does nothing and is only used for the branch protection | ||
if: always() | ||
needs: [lint] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
id: all-green | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
|
||
release: | ||
needs: [check] | ||
if: "success() && startsWith(github.ref, 'refs/tags/')" | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: install | ||
run: pip install -U build | ||
|
||
- name: check version | ||
id: check-version | ||
uses: samuelcolvin/[email protected] | ||
with: | ||
version_file_path: 'python/fastui/__init__.py' | ||
|
||
- name: build | ||
run: python -m build | ||
|
||
- name: Upload package to PyPI | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ dist-ssr | |
__pycache__/ | ||
|
||
/.logfire/ | ||
/frontend-dist/ | ||
/scratch/ |
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,41 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: no-commit-to-branch | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: local | ||
hooks: | ||
- id: python-format | ||
name: python-format | ||
types_or: [python] | ||
entry: make format | ||
language: system | ||
pass_filenames: false | ||
- id: python-typecheck | ||
name: python-typecheck | ||
types_or: [python] | ||
entry: make typecheck | ||
language: system | ||
pass_filenames: false | ||
- id: react-prettier | ||
name: react-prettier | ||
types_or: [javascript, jsx, ts, tsx, css, json, markdown] | ||
entry: npm run prettier | ||
language: system | ||
- id: react-lint | ||
name: react-lint | ||
types_or: [ts, tsx] | ||
entry: npm run lint-fix | ||
language: system | ||
pass_filenames: false | ||
- id: react-typecheck | ||
name: react-typecheck | ||
types_or: [ts, tsx] | ||
entry: npm run typecheck | ||
language: system | ||
pass_filenames: false |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2023 to present Samuel Colvin | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,44 @@ | ||
.DEFAULT_GOAL:=all | ||
paths = python | ||
|
||
.PHONY: install | ||
install: | ||
pip install -U pip pre-commit pip-tools | ||
pip install -r python/requirements/all.txt | ||
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 | ||
pip install --dry-run -r python/requirements/all.txt | ||
|
||
.PHONY: format | ||
format: | ||
ruff check --fix-only $(paths) | ||
ruff format $(paths) | ||
|
||
.PHONY: lint | ||
lint: | ||
ruff check $(paths) | ||
ruff format --check $(paths) | ||
|
||
.PHONY: typecheck | ||
typecheck: | ||
pyright python/fastui | ||
|
||
.PHONY: test | ||
test: | ||
coverage run -m pytest tests | ||
|
||
.PHONY: testcov | ||
testcov: test | ||
coverage html | ||
|
||
.PHONY: dev | ||
dev: | ||
uvicorn demo.server:app --reload | ||
|
||
.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# FastUI | ||
|
||
[![CI](https://github.com/samuelcolvin/FastUI/workflows/CI/badge.svg?event=push)](https://github.com/samuelcolvin/FastUI/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) | ||
[![pypi](https://img.shields.io/pypi/v/fastui.svg)](https://pypi.python.org/pypi/fastui) | ||
[![versions](https://img.shields.io/pypi/pyversions/fastui.svg)](https://github.com/samuelcolvin/FastUI) | ||
[![license](https://img.shields.io/github/license/samuelcolvin/FastUI.svg)](https://github.com/samuelcolvin/FastUI/blob/main/LICENSE) | ||
|
||
WIP |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.