tschm commited on
Commit
2a33a28
·
1 Parent(s): 5202999

local support

Browse files
Files changed (5) hide show
  1. .pre-commit-config.yaml +37 -0
  2. .ruff.toml +7 -0
  3. Makefile +44 -0
  4. tests/__init__.py +0 -0
  5. tests/test_plot.py +11 -0
.pre-commit-config.yaml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: check-toml
6
+ - id: end-of-file-fixer
7
+ - id: trailing-whitespace
8
+
9
+ - repo: https://github.com/psf/black
10
+ rev: 23.7.0
11
+ hooks:
12
+ - id: black
13
+
14
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
15
+ rev: 'v0.0.286'
16
+ hooks:
17
+ - id: ruff
18
+ args: [ --fix, --exit-non-zero-on-fix ]
19
+
20
+ - repo: https://github.com/igorshubovych/markdownlint-cli
21
+ rev: v0.35.0
22
+ hooks:
23
+ - id: markdownlint-fix
24
+ args: [ "--ignore", "book/**/*.md" ]
25
+
26
+ - repo: https://github.com/asottile/pyupgrade
27
+ rev: v3.10.1
28
+ hooks:
29
+ - id: pyupgrade
30
+
31
+ - repo: https://github.com/python-jsonschema/check-jsonschema
32
+ rev: 0.26.3
33
+ hooks:
34
+ - id: check-dependabot
35
+ args: ["--verbose"]
36
+ - id: check-github-workflows
37
+ args: ["--verbose"]
.ruff.toml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ exclude = [
2
+ "*__init__.py"
3
+ ]
4
+ line-length = 120
5
+ target-version = "py312"
6
+
7
+ select = ["E", "F", "I"]
Makefile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .DEFAULT_GOAL := help
2
+
3
+ UV_SYSTEM_PYTHON := 1
4
+
5
+ .PHONY: install
6
+ install: ## Install a virtual environment
7
+ @curl -LsSf https://astral.sh/uv/install.sh | sh
8
+ @uv venv
9
+ @uv pip install -r requirements.txt
10
+ @echo 'Please perform'
11
+ @echo 'source .venv/bin/activate'
12
+
13
+ .PHONY: fmt
14
+ fmt: ## Run autoformatting and linting
15
+ @uv pip install pre-commit
16
+ @uv run pre-commit install
17
+ @uv run pre-commit run --all-files
18
+
19
+ .PHONY: clean
20
+ clean: ## Clean up caches and build artifacts
21
+ @git clean -X -d -f
22
+
23
+ .PHONY: test
24
+ test: install ## Run tests
25
+ @uv pip install pytest
26
+ @uv run pytest
27
+
28
+ .PHONY: help
29
+ help: ## Display this help screen
30
+ @echo -e "\033[1mAvailable commands:\033[0m"
31
+ @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort
32
+
33
+ .PHONY: deptry
34
+ deptry: install ## run deptry
35
+ @uv pip install deptry
36
+ @uv run deptry -vv --per-rule-ignores "DEP002=kaleido|marimo" pyscribble
37
+
38
+ .PHONY: marimo
39
+ marimo: install ## Install Marimo
40
+ @uv run marimo edit app.py
41
+
42
+ .PHONY: app
43
+ app: install
44
+ @uv run marimo run app.py
tests/__init__.py ADDED
File without changes
tests/test_plot.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pyscribble import create
2
+
3
+ name = "Thomas Schmelzer"
4
+ fct = "sinh(3*z)"
5
+ event = "wedding"
6
+
7
+
8
+ def test_plot():
9
+ fig = create(name, fct, event, n=100)
10
+ # Show the figure
11
+ fig.show()