Skip to content

Commit 973c1a9

Browse files
committed
chore: switch project to Rye
1 parent c9f739f commit 973c1a9

File tree

20 files changed

+282
-2749
lines changed

20 files changed

+282
-2749
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/pipeline.yml

Lines changed: 71 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -3,141 +3,81 @@ name: Pipeline
33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
lint_black:
7-
name: Lint (black)
6+
lint:
7+
name: Lint
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- name: Set up Python 3.10
12-
uses: actions/setup-python@v2
13-
with:
14-
python-version: "3.10"
15-
- name: Install Black
11+
- name: Install Rye
1612
run: |
17-
pip install black
18-
- name: Run Black
19-
run: |
20-
black --check --diff momba tests
21-
22-
lint_flake8:
23-
name: Lint (flake8)
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v2
27-
- name: Set up Python 3.10
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: "3.10"
31-
- name: Install Flake8
32-
run: |
33-
pip install flake8 flake8-bugbear pep8-naming
34-
- name: Run Flake8
35-
run: |
36-
flake8 momba tests
37-
38-
build:
39-
name: Build
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v2
43-
- name: Set up Python 3.8
44-
uses: actions/setup-python@v2
45-
with:
46-
python-version: "3.8"
47-
- name: Install Poetry and Maturin
48-
run: |
49-
pip install poetry maturin
50-
- name: Build Momba
51-
run: |
52-
mkdir artifacts
53-
poetry build
54-
mv dist/* artifacts
55-
- name: Export development requirements
56-
run: |
57-
poetry export --without-hashes --extras all --dev -f requirements.txt --output artifacts/dev-requirements.txt
58-
- name: Build Engine
59-
run: |
60-
cd engine
61-
maturin build --manylinux=off --out ../artifacts -i $(which python)
62-
- uses: actions/upload-artifact@v2
63-
with:
64-
name: artifacts
65-
path: artifacts
13+
curl -sSf https://rye.astral.sh/get | bash
14+
- run: |
15+
rye fmt --all --check
16+
rye lint --all
17+
rye run check-types
6618
67-
test:
68-
name: Tests
69-
needs: [build]
70-
runs-on: ubuntu-latest
71-
steps:
72-
- uses: actions/checkout@v2
73-
- name: Set up Python 3.10
74-
uses: actions/setup-python@v2
75-
with:
76-
python-version: "3.10"
77-
- name: Download artifacts
78-
uses: actions/download-artifact@v2
79-
with:
80-
name: artifacts
81-
path: artifacts
82-
- name: Install packages
83-
run: |
84-
pip install -r artifacts/dev-requirements.txt
85-
pip install --ignore-installed artifacts/*.whl
86-
- name: Run tests
87-
run: |
88-
pytest tests
19+
# test:
20+
# name: Tests
21+
# runs-on: ubuntu-latest
22+
# steps:
23+
# - uses: actions/checkout@v2
24+
# - name: Install Rye
25+
# run: |
26+
# curl -sSf https://rye.astral.sh/get | bash
27+
# - run: |
28+
# rye run run-tests
8929

90-
type_check:
91-
name: Type Check
92-
needs: [build]
93-
runs-on: ubuntu-latest
94-
steps:
95-
- uses: actions/checkout@v2
96-
- name: Set up Python 3.10
97-
uses: actions/setup-python@v2
98-
with:
99-
python-version: "3.10"
100-
- name: Download artifacts
101-
uses: actions/download-artifact@v2
102-
with:
103-
name: artifacts
104-
path: artifacts
105-
- name: Install packages
106-
run: |
107-
pip install -r artifacts/dev-requirements.txt
108-
pip install --ignore-installed artifacts/*.whl
109-
- name: Run MypPy
110-
run: |
111-
mypy momba
30+
# type_check:
31+
# name: Type Check
32+
# needs: [build]
33+
# runs-on: ubuntu-latest
34+
# steps:
35+
# - uses: actions/checkout@v2
36+
# - name: Set up Python 3.10
37+
# uses: actions/setup-python@v2
38+
# with:
39+
# python-version: "3.10"
40+
# - name: Download artifacts
41+
# uses: actions/download-artifact@v2
42+
# with:
43+
# name: artifacts
44+
# path: artifacts
45+
# - name: Install packages
46+
# run: |
47+
# pip install -r artifacts/dev-requirements.txt
48+
# pip install --ignore-installed artifacts/*.whl
49+
# - name: Run MypPy
50+
# run: |
51+
# mypy momba
11252

113-
documentation:
114-
name: Documentation
115-
needs: [build]
116-
runs-on: ubuntu-latest
117-
steps:
118-
- uses: actions/checkout@v2
119-
- name: Set up Python 3.10
120-
uses: actions/setup-python@v2
121-
with:
122-
python-version: "3.10"
123-
- name: Download artifacts
124-
uses: actions/download-artifact@v2
125-
with:
126-
name: artifacts
127-
path: artifacts
128-
- name: Install packages
129-
run: |
130-
pip install -r artifacts/dev-requirements.txt
131-
pip install --ignore-installed artifacts/*.whl
132-
- name: Build documentation
133-
run: |
134-
sphinx-build -b dirhtml docs build/docs
135-
- name: Create CNAME file
136-
run: |
137-
echo "momba.dev" > build/docs/CNAME
138-
- name: Deploy documentation
139-
if: github.ref == 'refs/heads/main'
140-
uses: peaceiris/actions-gh-pages@v3
141-
with:
142-
github_token: ${{ secrets.GITHUB_TOKEN }}
143-
publish_dir: ./build/docs
53+
# documentation:
54+
# name: Documentation
55+
# needs: [build]
56+
# runs-on: ubuntu-latest
57+
# steps:
58+
# - uses: actions/checkout@v2
59+
# - name: Set up Python 3.10
60+
# uses: actions/setup-python@v2
61+
# with:
62+
# python-version: "3.10"
63+
# - name: Download artifacts
64+
# uses: actions/download-artifact@v2
65+
# with:
66+
# name: artifacts
67+
# path: artifacts
68+
# - name: Install packages
69+
# run: |
70+
# pip install -r artifacts/dev-requirements.txt
71+
# pip install --ignore-installed artifacts/*.whl
72+
# - name: Build documentation
73+
# run: |
74+
# sphinx-build -b dirhtml docs build/docs
75+
# - name: Create CNAME file
76+
# run: |
77+
# echo "momba.dev" > build/docs/CNAME
78+
# - name: Deploy documentation
79+
# if: github.ref == 'refs/heads/main'
80+
# uses: peaceiris/actions-gh-pages@v3
81+
# with:
82+
# github_token: ${{ secrets.GITHUB_TOKEN }}
83+
# publish_dir: ./build/docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ docs/_build
2121

2222
.mypy_cache
2323
.pytest_cache
24+
.ruff_cache
2425

2526
.ipynb_checkpoints
2627

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import subprocess
66
import re
7-
import subprocess
87

98
from pygments.lexer import RegexLexer
109
from pygments import token
@@ -130,7 +129,7 @@ class BNFLexer(RegexLexer): # type:ignore
130129
"path_to_docs": "docs/",
131130
"logo_only": True,
132131
"extra_footer": EXTRA_FOOTER,
133-
"extra_navbar" : "",
132+
"extra_navbar": "",
134133
"use_repository_button": True,
135134
"use_issues_button": True,
136135
}

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Welcome to Momba's documentation!
22
=================================
33

44
[![PyPi Package](https://img.shields.io/pypi/v/momba.svg?label=latest%20version)](https://pypi.python.org/pypi/momba)
5-
[![Tests](https://img.shields.io/github/workflow/status/koehlma/momba/Pipeline?label=tests)](https://github.com/koehlma/momba/actions)
5+
[![Tests](https://img.shields.io/github/actions/workflow/status/koehlma/momba/pipeline.yml?branch=main&label=tests)](https://github.com/koehlma/momba/actions)
66
[![Docs](https://img.shields.io/static/v1?label=docs&message=master&color=blue)](https://koehlma.github.io/momba/)
77
[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
88
[![Gitter](https://badges.gitter.im/koehlma/momba.svg)](https://gitter.im/koehlma/momba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

engine/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ hashbrown = "*"
2424

2525
[dependencies.pyo3]
2626
version = "0.17"
27-
# Minimal Python version is `3.8`.
28-
features = ["extension-module", "abi3-py38"]
27+
# Minimal Python version is `3.9`.
28+
features = ["extension-module", "abi3-py39"]

engine/pyproject.toml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
[project]
2+
name = "momba_engine"
3+
version = "0.6.10"
4+
description = "Momba's state space exploration engine."
5+
authors = [
6+
{ name = "Maximilian Köhl", email = "koehl@cs.uni-saarland.de" }
7+
]
8+
dependencies = []
9+
requires-python = ">= 3.8"
10+
111
[build-system]
2-
requires = ["maturin>=0.14,<0.15"]
3-
build-backend = "maturin"
12+
requires = ["maturin>=1.2,<2.0"]
13+
build-backend = "maturin"
14+
15+
[tool.rye]
16+
managed = true
17+
dev-dependencies = []
18+
19+
[tool.maturin]
20+
python-source = "python"
21+
module-name = "momba_engine"
22+
features = ["pyo3/extension-module"]

examples/conveyor-belt/conveyor_belt/experiments/scalability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def analyze(output_dir: pathlib.Path, exclude_fault_runs: bool) -> None:
216216

217217
for fault_sporadic in results.keys():
218218
print(fault_sporadic)
219-
for (length, value) in sorted(results[fault_sporadic].items()):
219+
for length, value in sorted(results[fault_sporadic].items()):
220220
print(f"({length},{value})")
221221

222222

examples/racetrack/racetrack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from . import model, tracks
99

10-
from . import _ipython # noqa:
10+
from . import _ipython # noqa: F401
1111

1212

1313
__all__ = ["model", "tracks"]

examples/racetrack_seed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import random
2+
3+
14
import racetrack
25

36
from momba import engine
@@ -18,7 +21,6 @@
1821

1922
print(transition.instances)
2023

21-
import random
2224

2325
random.seed(0)
2426

momba/engine/__main__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,8 @@ def parse_constants(cmd_input: str) -> t.Any:
4444
elif is_float(l.split("=")[1]):
4545
data[idx] = float(l.split("=")[1])
4646
elif (l.split("=")[1]).lower() in ("false", "true"):
47-
match l.split("=")[1]:
48-
case "False":
49-
data[idx] = False
50-
case "false":
51-
data[idx] = False
52-
case "True":
53-
data[idx] = True
54-
case "true":
55-
data[idx] = True
47+
value = l.split("=")[1]
48+
data[idx] = value == "True" or value == "true"
5649
return data
5750

5851

0 commit comments

Comments
 (0)