Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check Python codegen

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

jobs:
check-python-codegen:
name: Check Python codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
Comment thread
emilykl marked this conversation as resolved.

- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0

- name: Install dependencies
run: |
uv venv
source .venv/bin/activate
uv lock --check
uv sync --extra dev_codegen
- name: Run codegen
run: |
source .venv/bin/activate
python commands.py codegen
- name: Check for changes
run: |
# Fail if codegen produced any changes to the working directory.
# This means the committed generated files are out of date and codegen
# needs to be re-run locally and the results committed.
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated files are out of date. Please run 'python commands.py codegen' locally and commit the result."
echo "The following files differ after running codegen:"
git status --porcelain
echo ""
exit 1
fi
echo "Generated files are up to date."
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ dev_build = [
"build",
"jupyterlab"
]
dev_codegen = [ # Dependencies for running Python codegen
"plotly[dev_core]",
"inflect"
]
dev_optional = [
"plotly[dev_build]",
"plotly[dev_codegen]",
"plotly[express]",
"plotly[kaleido]",
"anywidget",
"colorcet",
# fiona>1.9.6 is not compatible with geopandas<1; geopandas>=1 is not compatible with python 3.8
"fiona<=1.9.6;python_version<='3.8'",
"geopandas",
"inflect",
"orjson",
"pandas",
"pdfrw",
Expand Down
19 changes: 16 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading