Skip to content
Merged
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
54 changes: 0 additions & 54 deletions .github/actions/install-env/action.yml

This file was deleted.

31 changes: 19 additions & 12 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone repository
uses: actions/checkout@v5

- name: Build River
uses: ./.github/actions/install-env
with:
python-version: "3.13"
build-root: false
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --locked --all-extras --dev

- name: MyPy type check
run: poetry run mypy
- name: Download datasets
run: uv run make download-datasets

- name: Ruff code linting
run: poetry run ruff check --output-format=github river/
- name: Run tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was mypy bypassed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be part of the pre-commit hooks 🤔

run: uv run pytest

- name: Install pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit/
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Ruff code formatting
run: poetry run ruff format --check river/
- name: Run pre-commit
run: uv run pre-commit run --all-files
3 changes: 2 additions & 1 deletion .github/workflows/delete-caches.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Clear all Github Actions caches
name: delete-github-action-caches

on:
workflow_dispatch:
schedule:
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/dev-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build River
uses: ./.github/actions/install-env
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
# Use 3.12 for the docs env waiting for spaCy and srsly to support 3.13
python-version: "3.12"
build-root: false

- name: Install extra Ubuntu dependencies
- name: Install Ubuntu dependencies
run: sudo apt-get install graphviz pandoc

- name: Install extra Python dependencies
run: |
poetry install --with docs
- name: Install dependencies
run: uv sync --group docs

- name: Build docs
run: |
source $VENV
make doc
run: uv run make doc

- name: Deploy docs
env:
GH_TOKEN: ${{ secrets.GitHubToken }}
run: |
source $VENV
git config user.name github-actions
git config user.email github-actions@github.com
git config pull.rebase false
Expand All @@ -45,4 +40,4 @@ jobs:
git checkout gh-pages
git pull
git checkout main
mike deploy dev --push --remote https://github.com/${{ github.repository }}.git
uv run mike deploy dev --push --remote https://github.com/${{ github.repository }}.git
17 changes: 8 additions & 9 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ jobs:
CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_NET_GIT_FETCH_WITH_CLI="true"'
CIBW_BEFORE_BUILD: >
rustup default nightly &&
rustup show &&
pip install numpy
rustup show
CIBW_BEFORE_BUILD_LINUX: >
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
rustup show
CIBW_BUILD_FRONTEND: "pip"
CIBW_BUILD_FRONTEND: "build[uv]"
- uses: actions/upload-artifact@v5
with:
name: cibw-wheels-${{ matrix.linux_tag }}-${{ matrix.python-version }}-${{ strategy.job-index }}
Expand Down Expand Up @@ -67,7 +66,7 @@ jobs:
rustup default nightly &&
rustup show
MACOSX_DEPLOYMENT_TARGET: 10.13
CIBW_BUILD_FRONTEND: "pip"
CIBW_BUILD_FRONTEND: "build[uv]"
- uses: actions/upload-artifact@v5
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}-${{ strategy.job-index }}
Expand Down Expand Up @@ -99,7 +98,7 @@ jobs:
CIBW_BEFORE_BUILD: >
rustup default nightly &&
rustup show
CIBW_BUILD_FRONTEND: "pip"
CIBW_BUILD_FRONTEND: "build[uv]"
- uses: actions/upload-artifact@v5
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}-${{ strategy.job-index }}
Expand All @@ -109,15 +108,15 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Build River
uses: ./.github/actions/install-env
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"

- name: Build dist
run: poetry build
run: uv build --sdist

- uses: actions/upload-artifact@v5
with:
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,35 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build River
uses: ./.github/actions/install-env
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
# Use 3.12 for the docs env waiting for spaCy and srsly to support 3.13
python-version: "3.12"

- name: Install extra Ubuntu dependencies
- name: Install Ubuntu dependencies
run: sudo apt-get install graphviz pandoc

- name: Install extra Python dependencies
- name: Install dependencies
run: |
poetry install --with docs --with compat
poetry run python -m spacy download en_core_web_sm
uv sync --group docs --group compat
uv run python -m spacy download en_core_web_sm

- name: Use Rich in notebooks
run: |
poetry run ipython profile create
uv run ipython profile create
echo "%load_ext rich" > ~/.ipython/profile_default/startup/00_rich.ipy

- name: Execute notebooks
run: |
source $VENV
make execute-notebooks
run: uv run make execute-notebooks

- name: Build docs
run: |
source $VENV
make doc
run: uv run make doc

- name: Deploy docs
env:
GH_TOKEN: ${{ secrets.GitHubToken }}
run: |
source $VENV
git config user.name github-actions
git config user.email github-actions@github.com
git config pull.rebase false
Expand All @@ -55,5 +50,5 @@ jobs:
git checkout gh-pages
git pull
git checkout main
RIVER_VERSION=$(python -c "import river; print(river.__version__)")
mike deploy ${RIVER_VERSION} latest --update-aliases --push --remote https://${GH_TOKEN}@github.com/online-ml/river.git
RIVER_VERSION=$(uv run python -c "import river; print(river.__version__)")
uv run mike deploy ${RIVER_VERSION} latest --update-aliases --push --remote https://${GH_TOKEN}@github.com/online-ml/river.git
47 changes: 0 additions & 47 deletions .github/workflows/unit-tests.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ coverage.xml
profile_default/
ipython_config.py

# pyenv
.python-version

# Environments
.env
.venv
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.3
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
COMMIT_HASH := $(shell eval git rev-parse HEAD)

download-datasets:
python -c "from river import datasets, bandit; datasets.Elec2().download(); datasets.SMSSpam().download(); bandit.datasets.NewsArticles().download()"

format:
pre-commit run --all-files

Expand All @@ -25,3 +28,6 @@ livedoc: doc

rebase:
git fetch && git rebase origin/main

fomo:
git fetch && git rebase origin/main
Loading