Skip to content

Commit

Permalink
feat: inline marimo files, files as whole pages, cell configuration
Browse files Browse the repository at this point in the history
- Myles Scolnick <[email protected]>

chore: migrate to pixi
- Pavel Zwerschke <[email protected]>
  • Loading branch information
pavelzw authored and mscolnick committed Oct 21, 2024
1 parent dcfcc9b commit 18417c4
Show file tree
Hide file tree
Showing 34 changed files with 17,262 additions and 911 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
15 changes: 7 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
interval: monthly
groups:
actions:
patterns:
- "*"
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build package

on:
push:
branches:
- main
tags:
- v*
pull_request:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: build
- name: Build package
run: |
pixi run -e build python -m build --no-isolation .
- name: Upload package
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: artifact
path: dist/*
if-no-files-found: error

release:
name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: write
environment: pypi
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: artifact
path: dist
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
37 changes: 37 additions & 0 deletions .github/workflows/bump-lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update lockfiles

permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:
schedule:
- cron: 0 5 1 * *

jobs:
pixi-update:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
run-install: false
- name: Update lockfiles
run: |
set -o pipefail
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
- name: Create pull request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update pixi lockfile
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: main
labels: pixi
delete-branch: true
add-paths: pixi.lock
66 changes: 38 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
name: CI

on: [push, pull_request]
# Automatically stop old builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:

jobs:
test:
strategy:
max-parallel: 5
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-latest]
# Just to slim down the test matrix:
exclude:
- python-version: 3.9
os: ubuntu-latest
- python-version: 3.10
os: macos-latest
- python-version: 3.10
os: windows-latest
env:
- py39
- py310
- py311
- py312
os:
- ubuntu-latest
- macos-latest
# TODO: fix windows
# - windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
environments: ${{ matrix.env }}
- name: Install repository
run: |
python -m pip install --upgrade hatch
pixi run -e ${{ matrix.env }} postinstall
- name: Run tests
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} test:test
shell: bash
pixi run -e ${{ matrix.env }} test --color=yes
- name: Type checking
run: |
pixi run -e ${{ matrix.env }} mypy mkdocs_marimo
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
python-version: '3.12'
- name: Install Python dependencies
environments: lint default
- name: Lint
run: |
python -m pip install hatch
- name: Check style
if: always()
run: hatch run style:check
pixi run lint-all-check
29 changes: 0 additions & 29 deletions .github/workflows/deploy-docs.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/deploy-release.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy docs

# Automatically stop old builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Deploy docs
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Install Python
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: docs
- name: Install repository
run: pixi run -e docs postinstall
- name: Build site
run: pixi run -e docs mkdocs build
- name: Deploy to gh-pages
# TODO: replace with a maintained action
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: oprypin/push-to-gh-pages@v3
with:
publish_dir: site
commit_message: 'Generate docs: '
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ site/
.pytest_cache/
.venv/
__pycache__/
.pixi
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

## Development

Install `pixi`: see [pixi docs](https://pixi.sh)

Run the tests:

```bash
pixi run postinstall
pixi run test
```

Serve the documentation:

```bash
pixi run docs
```
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

Loading

0 comments on commit 18417c4

Please sign in to comment.