Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra test
run: uv sync --group test
- name: Run test suite
run: uv run pytest --cov=order_matching

Expand All @@ -47,47 +47,46 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: uv sync --extra test
run: uv sync --group test
- name: Run benchmark
run: uv run ./benchmark.sh
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: pytest
output-file-path: benchmark.json
external-data-json-path: ./cache/benchmark-data.json
fail-on-alert: false
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-comment-cc-users: '@${GITHUB_ACTOR},@khrapovs'
# - name: Store benchmark result
# uses: benchmark-action/github-action-benchmark@v1
# with:
# tool: pytest
# output-file-path: benchmark.json
# external-data-json-path: ./cache/benchmark-data.json
# fail-on-alert: false
# github-token: ${{ secrets.GITHUB_TOKEN }}
# comment-on-alert: true
# alert-comment-cc-users: '@${GITHUB_ACTOR},@khrapovs'

code-quality:
name: Code quality checks
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.12"
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> ${GITHUB_ENV}
- uses: actions/cache@v4
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Setup Python
uses: actions/setup-python@v5
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
python-version: "3.13"
- name: Install dependencies
run: pip install pre-commit
run: uv sync --group dev
- name: Run pre-commit
run: pre-commit run -v --show-diff-on-failure
run: uv run prek run -v --show-diff-on-failure

docs:
name: Documentation
Expand All @@ -103,7 +102,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: uv sync --extra doc
- name: Build documentation
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.4
rev: v0.14.13
hooks:
- id: ruff
args: [ --config, pyproject.toml, --fix, --exit-non-zero-on-fix ]
Expand All @@ -17,7 +17,7 @@ repos:
types_or: [ python ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.19.1
hooks:
- id: mypy
args: [--config, pyproject.toml]
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.13"

mkdocs:
configuration: mkdocs.yaml
Expand Down
29 changes: 20 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10"
dependencies = ["pandas", "pandera", "faker"]

[project.urls]
Source = "https://github.com/khrapovs/OrderBookMatchingEngine"
Documentation = "https://order-book-matching-engine.readthedocs.io/"
dependencies = [
"faker>=33.0.0",
"pandas>=2.2.3",
"pandera>=0.21.0",
]

[dependency-groups]
test = [
"pytest>=8.3.3",
"pytest-benchmark[histogram]>=5.1.0",
"pytest-cov>=6.0.0",
"pytest-xdist>=3.6.1",
]
dev = [
"prek>=0.2.30",
]
[project.optional-dependencies]
test = ["pytest", "pytest-cov", "pytest-xdist", "pytest-benchmark[histogram]"]
doc = [
"mkdocs-material",
"mkdocstrings[python]",
Expand All @@ -32,7 +41,10 @@ doc = [
"mkdocs-macros-plugin",
"pymdown-extensions",
]
dev = ["pre-commit"]

[project.urls]
Source = "https://github.com/khrapovs/OrderBookMatchingEngine"
Documentation = "https://order-book-matching-engine.readthedocs.io/"

[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
Expand All @@ -46,7 +58,6 @@ testpaths = ["tests", "src", "README.md"]

[tool.ruff]
line-length = 120
target-version = "py312"
src = ["src", "tests"]

[tool.ruff.lint]
Expand All @@ -64,7 +75,7 @@ ignore = [
"D417",
]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.mypy]
Expand Down
Loading
Loading