reflex/.github/workflows/check_generated_pyi.yml
Thomas Brandého 0af4770180
generate pyi files when building/publishing 3rd party component (#2945)
* build pyi files when building/publishing 3rd party

* fix typo in workflow

* add future annotation

* add tests to pass coverage check

* add more unit tests

* omit pyi_generator from test coverage

* change black from dev deps to direct deps

* remake all pyi

* format pyi if black is present, return as if otherwise

* fix requested changes

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-03-29 09:54:21 -07:00

37 lines
1.0 KiB
YAML

name: check-generated-pyi
on:
push:
branches: [ "main" ]
# We don't just trigger on make_pyi.py and the components dir, because
# there are other things that can change the generator output
# e.g. black version, reflex.Component, reflex.Var.
paths-ignore:
- '**/*.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**/*.md'
jobs:
check-generated-pyi-components:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: "3.11.5"
run-poetry-install: true
create-venv-at-path: .venv
- run: |
poetry run python scripts/make_pyi.py
if [[ $(git status --porcelain) ]]; then
git status
git diff
echo "ERROR: make_pyi.py output is out of date. Please run scripts/make_pyi.py and commit the changes."
exit 1
else
echo "No diffs - AOK!"
fi