Skip to content

Commit b7365e0

Browse files
chore: Sync with rhiza (#648)
* chore: Update via rhiza * dependencies --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0478492 commit b7365e0

48 files changed

Lines changed: 983 additions & 982 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# DevContainer Configuration
2+
3+
This directory contains the configuration for [GitHub Codespaces](https://github.com/features/codespaces) and [VS Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers).
4+
5+
## Contents
6+
7+
- `devcontainer.json`: The primary configuration file defining the development environment.
8+
- `bootstrap.sh`: A script that runs after the container is created to initialize the environment (installing dependencies, setting up tools).
9+
10+
## Features
11+
12+
- **Python Environment**: Pre-configured with Python 3.12.
13+
- **Tools**: Includes `uv` for fast package management and `make` for project tasks.
14+
- **Extensions**: Recommended VS Code extensions for Python development, including Ruff and Marimo.

.github/workflows/rhiza_book.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@ jobs:
4343
- name: Install uv
4444
uses: astral-sh/setup-uv@v7
4545
with:
46-
version: "0.9.18"
46+
version: "0.9.21"
4747

4848
- name: "Sync the virtual environment for ${{ github.repository }}"
4949
shell: bash
5050
run: |
5151
export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
5252
# will just use .python-version?
53-
uv sync --all-extras --frozen
53+
uv sync --all-extras --all-groups --frozen
54+
55+
- name: Install dev dependencies
56+
run: bash .rhiza/scripts/install-dev-deps.sh
5457

5558
- name: "Make the book"
5659
run: |

.github/workflows/rhiza_ci.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ permissions:
1414

1515
on:
1616
push:
17+
branches: [ main, master ]
1718
pull_request:
18-
branches: [main, master]
19+
branches: [ main, master ]
1920

2021
jobs:
2122
generate-matrix:
@@ -25,10 +26,15 @@ jobs:
2526
steps:
2627
- uses: actions/checkout@v6
2728

29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
with:
32+
version: "0.9.21"
33+
2834
- id: versions
2935
run: |
3036
# Generate Python versions JSON from the script
31-
JSON=$(python ./.rhiza/utils/version_matrix.py)
37+
JSON=$(make -s version-matrix)
3238
echo "list=$JSON" >> "$GITHUB_OUTPUT"
3339
3440
- name: Debug matrix
@@ -52,21 +58,17 @@ jobs:
5258
- name: Install uv
5359
uses: astral-sh/setup-uv@v7
5460
with:
55-
version: "0.9.18"
61+
version: "0.9.21"
5662

5763
- name: "Sync the virtual environment for ${{ github.repository }}"
5864
shell: bash
5965
run: |
6066
export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
6167
uv venv --python ${{ matrix.python-version }}
62-
uv sync --all-extras --frozen
68+
uv sync --all-extras --all-groups --frozen
6369
64-
- name: Install dependencies
65-
run: |
66-
if [ -f "tests/requirements.txt" ]; then
67-
uv pip install -r tests/requirements.txt
68-
fi
69-
uv pip install pytest
70+
- name: Install dev dependencies
71+
run: bash .rhiza/scripts/install-dev-deps.sh
7072

7173
- name: Run tests
7274
run: uv run pytest tests

.github/workflows/rhiza_codeql.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main", "master" ]
17+
pull_request:
18+
branches: [ "main", "master" ]
19+
schedule:
20+
- cron: '27 1 * * 1'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
if: ${{ !github.event.repository.private }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# required to fetch internal or private CodeQL packs
37+
packages: read
38+
39+
# only required for workflows in private repositories
40+
actions: read
41+
contents: read
42+
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
include:
47+
- language: actions
48+
build-mode: none
49+
- language: python
50+
build-mode: none
51+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
52+
# Use `c-cpp` to analyze code written in C, C++ or both
53+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
54+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
55+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
56+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
57+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
58+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v6
62+
63+
# Add any setup steps before running the `github/codeql-action/init` action.
64+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
65+
# or others). This is typically only required for manual builds.
66+
# - name: Setup runtime (example)
67+
# uses: actions/setup-example@v1
68+
69+
# Initializes the CodeQL tools for scanning.
70+
- name: Initialize CodeQL
71+
uses: github/codeql-action/init@v4
72+
with:
73+
languages: ${{ matrix.language }}
74+
build-mode: ${{ matrix.build-mode }}
75+
# If you wish to specify custom queries, you can do so here or in a config file.
76+
# By default, queries listed here will override any specified in a config file.
77+
# Prefix the list here with "+" to use these queries and those in the config file.
78+
79+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
80+
# queries: security-extended,security-and-quality
81+
82+
# If the analyze step fails for one of the languages you are analyzing with
83+
# "We were unable to automatically build your code", modify the matrix above
84+
# to set the build mode to "manual" for that language. Then modify this step
85+
# to build your code.
86+
# ℹ️ Command-line programs to run using the OS shell.
87+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88+
- name: Run manual build steps
89+
if: matrix.build-mode == 'manual'
90+
shell: bash
91+
run: |
92+
echo 'If you are using a "manual" build mode for one or more of the' \
93+
'languages you are analyzing, replace this with the commands to build' \
94+
'your code, for example:'
95+
echo ' make bootstrap'
96+
echo ' make release'
97+
exit 1
98+
99+
- name: Perform CodeQL Analysis
100+
uses: github/codeql-action/analyze@v4
101+
with:
102+
category: "/language:${{matrix.language}}"

.github/workflows/rhiza_deptry.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ permissions:
1818

1919
on:
2020
push:
21+
branches: [ main, master ]
2122
pull_request:
2223
branches: [ main, master ]
2324

@@ -26,17 +27,14 @@ jobs:
2627
name: Check dependencies with deptry
2728
runs-on: ubuntu-latest
2829
container:
29-
image: ghcr.io/astral-sh/uv:0.9.18-python3.12-trixie
30+
image: ghcr.io/astral-sh/uv:0.9.21-python3.12-trixie
3031

3132
steps:
3233
- uses: actions/checkout@v6
3334

3435
- name: Run deptry
35-
run: |
36-
set -euo pipefail
37-
if [ -d "src" ]; then
38-
SOURCE_FOLDER="src"
39-
else
40-
SOURCE_FOLDER="."
41-
fi
42-
uvx deptry "$SOURCE_FOLDER"
36+
run: make deptry
37+
# NOTE: make deptry is good style because it encapsulates the folders to check
38+
# (e.g. src and book/marimo) and keeps CI in sync with local development.
39+
# Since we use a 'uv' container, the Makefile is optimized to use the
40+
# pre-installed 'uv' and 'uvx' from the system PATH.

.github/workflows/rhiza_docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ permissions:
1414

1515
on:
1616
push:
17+
branches: [ main, master ]
1718
pull_request:
1819
branches: [ main, master ]
1920

.github/workflows/rhiza_marimo.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ permissions:
2222

2323
on:
2424
push:
25+
branches: [ main, master ]
2526
pull_request:
2627
branches: [ main, master ]
2728

@@ -79,7 +80,7 @@ jobs:
7980
- name: Install uv
8081
uses: astral-sh/setup-uv@v7
8182
with:
82-
version: "0.9.18"
83+
version: "0.9.21"
8384

8485
# Execute the notebook with the appropriate runner based on its content
8586
- name: Run notebook

.github/workflows/rhiza_pre-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020

2121
on:
2222
push:
23+
branches: [ main, master ]
2324
pull_request:
2425
branches: [ main, master ]
2526

.github/workflows/rhiza_release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ jobs:
111111
- name: Install uv
112112
uses: astral-sh/setup-uv@v7
113113
with:
114-
version: "0.9.18"
114+
version: "0.9.21"
115115

116116
- name: "Sync the virtual environment for ${{ github.repository }}"
117117
shell: bash
118118
run: |
119119
export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
120120
# will just use .python-version?
121-
uv sync --all-extras --frozen
121+
uv sync --all-extras --all-groups --frozen
122122
123123
- name: Verify version matches tag
124124
if: hashFiles('pyproject.toml') != ''
@@ -322,14 +322,14 @@ jobs:
322322
- name: Install uv
323323
uses: astral-sh/setup-uv@v7
324324
with:
325-
version: "0.9.18"
325+
version: "0.9.21"
326326

327327
- name: "Sync the virtual environment for ${{ github.repository }}"
328328
shell: bash
329329
run: |
330330
export UV_EXTRA_INDEX_URL="${{ secrets.uv-extra-index-url }}"
331331
# will just use .python-version?
332-
uv sync --all-extras --frozen
332+
uv sync --all-extras --all-groups --frozen
333333
334334
- name: Set up Python
335335
uses: actions/setup-python@v6

.github/workflows/rhiza_validate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions:
55

66
on:
77
push:
8+
branches: [ main, master ]
89
pull_request:
910
branches: [ main, master ]
1011

@@ -14,7 +15,7 @@ jobs:
1415
# don't run this in rhiza itself. Rhiza has no template.yml file.
1516
if: ${{ github.repository != 'jebel-quant/rhiza' }}
1617
container:
17-
image: ghcr.io/astral-sh/uv:0.9.18-python3.12-trixie
18+
image: ghcr.io/astral-sh/uv:0.9.21-python3.12-trixie
1819

1920
steps:
2021
- name: Checkout repository

0 commit comments

Comments
 (0)