File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,12 +25,24 @@ jobs:
2525 python-version : ${{ matrix.python-version }}
2626 - name : Install Rust toolchain
2727 uses : dtolnay/rust-toolchain@stable
28+ - name : Install Poetry
29+ uses : snok/install-poetry@v1
30+ with :
31+ version : latest
32+ virtualenvs-in-project : true
33+ - name : Cache Poetry virtualenv
34+ uses : actions/cache@v4
35+ with :
36+ path : .venv
37+ key : poetry-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
38+ restore-keys : |
39+ poetry-${{ runner.os }}-py${{ matrix.python-version }}-
40+ - name : Install dependencies
41+ run : poetry install
2842 - name : Build with maturin
29- run : |
30- pip install maturin pytest
31- maturin develop
43+ run : poetry run maturin develop
3244 - name : Run tests
33- run : pytest tests/ -v
45+ run : poetry run pytest tests/ -v
3446
3547 build :
3648 name : Build wheels
Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2024 Radosław Drążkiewicz
3+ Copyright (c) 2026 Radosław Drążkiewicz
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change @@ -33,5 +33,18 @@ Repository = "https://github.com/collerek/ormar-utils"
3333[tool .maturin ]
3434features = [" pyo3/extension-module" ]
3535
36+ [tool .poetry ]
37+ name = " ormar-utils"
38+ version = " 0.1.0"
39+ description = " Rust-accelerated utility functions for the ormar ORM"
40+ authors = [" Radosław Drążkiewicz <collerek@gmail.com>" ]
41+
42+ [tool .poetry .dependencies ]
43+ python = " ^3.10"
44+
45+ [tool .poetry .group .dev .dependencies ]
46+ pytest = " ^7.0"
47+ maturin = " ^1.0"
48+
3649[tool .pytest .ini_options ]
3750testpaths = [" tests" ]
Original file line number Diff line number Diff line change @@ -13,22 +13,15 @@ use pyo3::prelude::*;
1313/// Rust-accelerated utility functions for ormar ORM.
1414#[ pymodule]
1515fn ormar_rust_utils ( m : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
16- // Phase 1: Pure data, no Model dependency
1716 m. add_function ( wrap_pyfunction ! ( parsers:: encode_bytes, m) ?) ?;
1817 m. add_function ( wrap_pyfunction ! ( parsers:: decode_bytes, m) ?) ?;
1918 m. add_function ( wrap_pyfunction ! ( parsers:: encode_json, m) ?) ?;
2019 m. add_function ( wrap_pyfunction ! ( hash_item:: hash_item, m) ?) ?;
2120 m. add_function ( wrap_pyfunction ! ( translate_list:: translate_list_to_dict, m) ?) ?;
2221 m. add_function ( wrap_pyfunction ! ( group_related:: group_related_list, m) ?) ?;
23-
24- // Phase 2: Collection utilities
2522 m. add_class :: < unique_list:: UniqueList > ( ) ?;
26-
27- // Phase 3: Row processing
2823 m. add_function ( wrap_pyfunction ! ( extract_columns:: extract_prefixed_columns, m) ?) ?;
2924 m. add_function ( wrap_pyfunction ! ( prepare_save:: prepare_model_to_save, m) ?) ?;
30-
31- // Phase 4: Merge infrastructure
3225 m. add_function ( wrap_pyfunction ! ( merge_instances:: group_by_pk, m) ?) ?;
3326 m. add_function ( wrap_pyfunction ! ( merge_items:: plan_merge_items_lists, m) ?) ?;
3427 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments