Skip to content

Commit 9cfee60

Browse files
committed
chore: initial repo setup
1 parent 1bdd53c commit 9cfee60

File tree

19 files changed

+471
-0
lines changed

19 files changed

+471
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps maintain consistent coding styles between editors & IDEs
2+
# https://editorconfig.org
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_style = space
9+
indent_size = 4
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# Keep README & docs within the same column width as code
14+
[*.{py,toml,yaml,yml,md}]
15+
max_line_length = 100
16+
17+
# Make makes you use tabs
18+
[Makefile]
19+
indent_style = tab

.github/workflows/ci.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
py: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.py }}
20+
- run: pip install hatch
21+
- run: hatch run ruff format --check .
22+
- run: hatch run ruff check .
23+
- run: hatch run mypy .
24+
- run: hatch run dev:pytest

.github/workflows/docs.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/**"
8+
- "mkdocs.yml"
9+
- "src/**"
10+
- ".github/workflows/docs.yml"
11+
12+
permissions:
13+
pages: write
14+
id-token: write
15+
16+
jobs:
17+
build-deploy:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
26+
- run: pip install hatch
27+
28+
- name: Build & version docs
29+
run: hatch run mkdocs build --strict
30+
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: site
34+
35+
- uses: actions/deploy-pages@v4
36+
with:
37+
artifact_name: github-pages

.github/workflows/release.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
id-token: write # OIDC token for trusted publishing
10+
contents: read
11+
12+
jobs:
13+
build-and-publish:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
22+
- name: Build wheel & sdist
23+
run: |
24+
pip install --quiet hatch
25+
hatch build
26+
27+
- name: Publish to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
verbose: true # shows twine output

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Python artifacts
2+
__pycache__/
3+
*.py[cod]
4+
*.so
5+
*.pyd
6+
7+
# Packaging / build
8+
build/
9+
dist/
10+
*.egg-info/
11+
.eggs/
12+
13+
# Hatch & virtual-envs
14+
.hatch/ # local env metadata/cache
15+
.env/
16+
.venv/
17+
venv/
18+
env/
19+
env.bak/
20+
*.virtualenv
21+
22+
# Test & coverage outputs
23+
.coverage*
24+
htmlcov/
25+
.tox/
26+
.nox/
27+
pytest_cache/
28+
.mypy_cache/
29+
.pytest_cache/
30+
*.log
31+
32+
# Lint / formatter caches
33+
.ruff_cache/
34+
.black/
35+
.pyre/
36+
37+
# Documentation build (mkdocs)
38+
site/
39+
*.html
40+
41+
# IDE/editor settings
42+
.vscode/
43+
.idea/
44+
*.sublime-project
45+
*.sublime-workspace
46+
*.code-workspace
47+
48+
# OS miscellany
49+
.DS_Store
50+
Thumbs.db
51+
desktop.ini
52+
53+
# Logs & temp files
54+
*.log
55+
*.tmp
56+
*.swp
57+
*.swo
58+
*~

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .pre-commit-config.yaml – patched
2+
repos:
3+
# Ruff: formatter + linter
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.12.0
6+
hooks:
7+
- id: ruff-format
8+
- id: ruff
9+
args: [--fix]
10+
11+
# mypy (strict)
12+
- repo: https://github.com/pre-commit/mirrors-mypy
13+
rev: v1.16.1
14+
hooks:
15+
- id: mypy
16+
additional_dependencies: [pydantic==2.8.0, typing-extensions, types-click]
17+
18+
# Blacken-docs
19+
- repo: https://github.com/asottile/blacken-docs
20+
rev: "1.19.1"
21+
hooks:
22+
- id: blacken-docs
23+
24+
# Basic hygiene hooks (official, maintained)
25+
- repo: https://github.com/pre-commit/pre-commit-hooks
26+
rev: v5.0.0
27+
hooks:
28+
- id: end-of-file-fixer
29+
- id: trailing-whitespace
30+
31+
default_language_version:
32+
python: python3.12

.ruff.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.astral.sh/ruff/configuration/
2+
target-version = "py39"
3+
line-length = 100
4+
src = ["src", "tests"]
5+
6+
# Enable rule bundles
7+
lint.select = [
8+
"E", # pycodestyle errors
9+
"F", # pyflakes
10+
"I", # isort
11+
"UP", # pyupgrade
12+
"PL", # pylint-worthwhile subset
13+
]
14+
15+
lint.ignore = [
16+
"E501", # handled by formatter
17+
]
18+
19+
# Per-folder overrides --------------------------------------------------------
20+
[lint.per-file-ignores]
21+
"tests/**/*.py" = ["PLR2004"] # magic-numbers okay in tests

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Wokwi Python Client 🚀
2+
3+
Typed, asyncio-friendly Python SDK for the **Wokwi Simulation API**
4+
5+
[![PyPI version](https://img.shields.io/pypi/v/wokwi-client?logo=pypi)](https://pypi.org/project/wokwi-client/)
6+
[![Python versions](https://img.shields.io/pypi/pyversions/wokwi-client)](https://pypi.org/project/wokwi-client/)
7+
[![CI](https://github.com/wokwi/wokwi-python-client/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wokwi/wokwi-python-client/actions/workflows/ci.yml)
8+
[![License: MIT](https://img.shields.io/github/license/wokwi/wokwi-python-client)](LICENSE)
9+
10+
> **TL;DR:** Run and control your Wokwi simulations from Python, synchronously **or** asynchronously, with first-class type hints and zero boilerplate.
11+
12+
---
13+
14+
## Installation requirements
15+
16+
Python ≥ 3.9
17+
18+
An API token from https://wokwi.com/dashboard/ci
19+
20+
## License
21+
22+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Wokwi Python Client Library
2+
3+
Welcome! These docs will eventually cover installation, quickstart examples, and the full API reference.

docs/reference/wokwi_client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: wokwi_client

0 commit comments

Comments
 (0)