Skip to content

Commit d00dd0a

Browse files
committed
first commit
0 parents  commit d00dd0a

File tree

11 files changed

+411
-0
lines changed

11 files changed

+411
-0
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
17+
with:
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
run: uv python install
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
25+
26+
- name: Lint
27+
run: uv run ruff check .
28+
29+
- name: Run tests
30+
run: uv run pytest tests src

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.8.4
5+
hooks:
6+
- id: ruff
7+
args: [--fix]
8+
- id: ruff-format

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 marimo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# marimo + uv Starter Template
2+
3+
A starter template for [marimo](https://marimo.io) notebooks using [uv](https://github.com/astral-sh/uv) for dependency and project management. This template provides a modern Python development setup with best practices for notebook development.
4+
5+
## Features
6+
7+
- 🚀 Python 3.12+ support
8+
- 📦 Fast dependency management with `uv`
9+
- 🧪 Testing setup with pytest
10+
- 🎯 Code quality with Ruff (linting + formatting)
11+
- 👷 CI/CD with GitHub Actions
12+
- 📓 Interactive notebook development with marimo
13+
14+
## Prerequisites
15+
16+
- Python 3.12 or higher
17+
- [uv](https://github.com/astral-sh/uv) installed
18+
19+
## Getting Started
20+
21+
1. Clone this repository:
22+
23+
```bash
24+
git clone https://github.com/yourusername/marimo-uv-starter-template
25+
cd marimo-uv-starter-template
26+
```
27+
28+
2. Run the marimo editor:
29+
30+
```bash
31+
uv run marimo edit
32+
```
33+
34+
## Development
35+
36+
### Running Tests
37+
38+
```bash
39+
# Run testing in your regular python files
40+
uv run pytest tests
41+
# Running testing in your marimo notebooks
42+
uv run pytest src
43+
```
44+
45+
### Linting and formatting
46+
47+
```bash
48+
uv run ruff check .
49+
uv run ruff format .
50+
```
51+
52+
## Project Structure
53+
54+
```markdown
55+
├── .github/ # GitHub Actions workflows
56+
├── src/ # Source code
57+
│ └── app.py # Sample marimo notebook
58+
├── tests/ # Test files
59+
├── pyproject.toml # Project configuration
60+
└── uv.lock # Dependency lock file
61+
```
62+
63+
## License
64+
65+
MIT

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[project]
2+
description = "A starter template for marimo notebooks with uv"
3+
name = "marimo-template"
4+
requires-python = ">=3.12"
5+
version = "0.1.0"
6+
7+
[dependency-groups]
8+
dev = [
9+
"pre-commit>=4.0.1",
10+
"pytest>=8.3.4",
11+
"ruff>=0.8.3",
12+
]
13+
14+
[tool.pytest.ini_options]
15+
pythonpath = ["."]
16+
testpaths = ["tests", "marimo_template"]
17+
18+
[tool.ruff]
19+
line-length = 100
20+
target-version = "py312"
21+
22+
[tool.ruff.lint]
23+
select = [
24+
"E", # pycodestyle
25+
"F", # pyflakes
26+
"I", # isort
27+
"B", # flake8-bugbear
28+
]

src/__init__.py

Whitespace-only changes.

src/app.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import marimo
2+
3+
__generated_with = "0.10.12"
4+
app = marimo.App(width="medium")
5+
6+
7+
@app.cell
8+
def _():
9+
import marimo as mo
10+
11+
mo.md("Hello")
12+
return (mo,)
13+
14+
15+
@app.cell
16+
def test_cell():
17+
from utils import add
18+
19+
assert add(1, 2) == 3
20+
assert 2 == 2
21+
return
22+
23+
24+
if __name__ == "__main__":
25+
app.run()

src/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def add(a: int, b: int) -> int:
2+
return a + b
3+
4+
5+
def subtract(a: int, b: int) -> int:
6+
return a - b

tests/test_sample.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from src.utils import add, subtract
2+
3+
4+
def test_add():
5+
assert add(1, 2) == 3
6+
7+
8+
def test_subtract():
9+
assert subtract(1, 2) == -1

0 commit comments

Comments
 (0)