Skip to content

Commit b88c814

Browse files
authored
Merge pull request #1 from sunbox-sudo/feat/arithmetic
Feat/arithmetic
2 parents 21e670f + 630c6ac commit b88c814

File tree

9 files changed

+103
-0
lines changed

9 files changed

+103
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: ["3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
cache: "pip"
26+
27+
- name: Install dependencies
28+
run: pip install -e ".[dev]"
29+
30+
- name: Lint with ruff
31+
run: ruff check .
32+
33+
- name: Check formatting
34+
run: ruff format --check .
35+
36+
- name: Run tests with coverage
37+
run: pytest --cov=mathlib --cov-report=term-missing

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,7 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
210+
# VsCode settings
211+
.vscode/

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.defaultInterpreterPath": ".venv/Scripts/python",
3+
"editor.formatOnSave": true,
4+
"[python]": {
5+
"editor.defaultFormatter": "charliermarsh.ruff"
6+
}
7+
}

pymath/__init__.py

Whitespace-only changes.

pymath/arithmetic.py

Whitespace-only changes.

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[build-system]
2+
requires = ["setuptools>=68"]
3+
build-backend = "etuptools.build_meta"
4+
5+
[project]
6+
name = "mathlib"
7+
version = "0.1.0"
8+
description = "A math library built for learning"
9+
requires-python = ">=3.11"
10+
11+
[project.optional-dependencies]
12+
dev = [
13+
"pytest>=8.0",
14+
"pytest-cov", # coverage reports
15+
"ruff", # linting + formatting (replaces flake8+black)
16+
]
17+
18+
[tool.ruff]
19+
line-length = 88
20+
21+
[tool.ruff.lint]
22+
select = ["E", "F", "W"] # pycodestyle + pyflakes rules
23+
24+
[tool.pytest.ini_options]
25+
testpaths = ["tests"]
26+
27+
[tool.coverage.report]
28+
omit = ["tests/*"]

setup

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Create venv (do this once per machine)
2+
python -m venv .venv
3+
4+
# Activate — Linux/Mac
5+
source .venv/bin/activate
6+
7+
# Activate — Windows (VSCode terminal)
8+
.venv\Scripts\activate
9+
10+
# Install the project in editable mode + dev tools
11+
pip install -e ".[dev]"
12+
```
13+
14+
The `-e` flag means **editable install** — changes to your `mathlib/` code take effect immediately without reinstalling.
15+
16+
---
17+
18+
### 4. `.gitignore`
19+
```
20+
.venv/
21+
__pycache__/
22+
*.pyc
23+
.coverage
24+
htmlcov/
25+
dist/
26+
*.egg-info/
27+
.vscode/

test/__init__.py

Whitespace-only changes.

test/test_arithmetic.py

Whitespace-only changes.

0 commit comments

Comments
 (0)