Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
66ce9aa
feat: init project
kuronull Jul 14, 2025
07271c1
feat: init project
kuronull Jul 14, 2025
5c2e562
feat: init project
kuronull Jul 14, 2025
dc67b55
feat: init project
kuronull Jul 14, 2025
9962730
feat: init project
kuronull Jul 14, 2025
070f6a3
chore(ci): update github_ci
kuronull Jul 15, 2025
7afe431
chore(ci): update github_build
kuronull Jul 15, 2025
8e6a707
chore: update Makefile
kuronull Jul 15, 2025
39f8be4
chore: refactor and update dependencies
kuronull Jul 15, 2025
0586c2e
chore(lint): update pre-commit hooks configuration
kuronull Jul 15, 2025
a98c05b
chore: adjust .editorconfig for consistent formatting rules
kuronull Jul 15, 2025
89b5f24
docs: update README
kuronull Jul 15, 2025
563d53a
test: update dummy test for compatibility with new setup
kuronull Jul 15, 2025
48c7504
feat: init-project
kuronull Jul 15, 2025
3ce9292
chore(ci): update workflow
kuronull Jul 17, 2025
561f1fd
chore: update Makefile
kuronull Jul 17, 2025
6f72c75
chore(lint): Update pre-commit hooks configuration
kuronull Jul 17, 2025
ec8aa37
chore: update configuration ruff file
kuronull Jul 17, 2025
9acd2e1
feat: init-project
kuronull Jul 17, 2025
024dcc4
feat: init-project
kuronull Jul 17, 2025
ed2f711
chore: refactor and update dependencies
kuronull Jul 17, 2025
11e21bd
chore: update Makefile
kuronull Jul 17, 2025
88c6091
feat: init-project
kuronull Jul 17, 2025
97cbfe7
feat: init-project
kuronull Jul 19, 2025
4d209dd
feat: init-project
kuronull Jul 19, 2025
8c8982c
feat: init-project
kuronull Jul 19, 2025
a462bb2
feat: init-project
kuronull Jul 20, 2025
7ff9b97
chore: update ci
kuronull Jul 21, 2025
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
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab

Comment thread
kuronull marked this conversation as resolved.
[*Dockerfile*]
indent_size = 4
30 changes: 30 additions & 0 deletions .github/workflows/github_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Publish to PyPI

on:
push:
tags:
- "v*" # Trigger on version tags

jobs:
build-and-publish:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"

- name: Install dependencies
run: |
uv sync --all-packages

- name: Build package
run: uv build --all-packages

- name: Publish to PyPI
run: |
uv publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
39 changes: 39 additions & 0 deletions .github/workflows/github_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
ci:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"

- name: Install dependencies with uv
run: |
uv sync --all-packages

Comment thread
kuronull marked this conversation as resolved.
- name: Run linter python source files
run: |
make lint

- name: Run unit tests
run: |
uv run pytest --cov=src --cov-report=xml --cov-report=html --cov-fail-under=0

- name: Upload coverage report
uses: codecov/codecov-action@v4
Comment thread
kuronull marked this conversation as resolved.
with:
files: coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
125 changes: 125 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py


# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

volumes/
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.2.0
hooks:
- id: check-added-large-files
args: [--maxkb=500, --enforce-all]
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.12.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.3
hooks:
- id: ruff-check
- id: ruff-format

- repo: local
hooks:
- id: mypy
name: mypy
entry: uv run mypy
types: [python]
language: system
- id: pytest
name: pytest
entry: uv run pytest -m "not slow"
types: [python]
language: system
pass_filenames: false
always_run: true
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
85 changes: 85 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
cache-dir = ".cache/ruff"
extend-exclude = [".cache"]
fix = true
line-length = 80
preview = true
src = [".", "src", "tests"]
target-version = "py312"

[format]
docstring-code-format = true
line-ending = "lf"

[lint]
select = ["ALL"]
ignore = [
# Missing docstring in public module
"D100",
# Missing docstring in public class
"D101",
# Missing docstring in public method
"D102",
# Missing docstring in public function
"D103",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in __init__
"D107",
# Trailing comma missing
"COM812",
# Implicitly concatenated string literals on one line
"ISC001",
# Missing copyright notice at top of file
"CPY001",
]
typing-modules = ["numpy.typing"]

[lint.per-file-ignores]
"**/scripts/*" = [
# `print` found
"T201",
# File {filename} is part of an implicit namespace package. Add an __init__.py.
"INP001",
]

Comment thread
kuronull marked this conversation as resolved.
[lint.flake8-import-conventions.extend-aliases]
scipy = "sp"

[lint.flake8-pytest-style]
fixture-parentheses = true
mark-parentheses = true

[lint.flake8-tidy-imports]
ban-relative-imports = "all"

[lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
strict = true

[lint.isort]
length-sort = true
lines-after-imports = 2
required-imports = ["from __future__ import annotations"]
section-order = [
"future",
"standard-library",
"third-party",
"testing",
"first-party",
"local-folder",
]
known-first-party = ['vecmodel']

[lint.isort.sections]
testing = ["pytest", "pytest_mock", "hypothesis"]

[lint.mccabe]
max-complexity = 6

[lint.pycodestyle]
max-doc-length = 80

[lint.pydocstyle]
convention = "google"
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"tamasfe.even-better-toml",
"ms-python.mypy-type-checker",
"esbenp.prettier-vscode",
"ms-python.vscode-pylance",
"ms-python.python",
"charliermarsh.ruff",
"nefrob.vscode-just-syntax"
]
}
Loading