pyvefr 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyvefr-0.1.0/.clang-format +60 -0
- pyvefr-0.1.0/.clang-tidy +91 -0
- pyvefr-0.1.0/.github/workflows/ci_ctest.yml +59 -0
- pyvefr-0.1.0/.github/workflows/ci_pytest.yml +49 -0
- pyvefr-0.1.0/.github/workflows/ci_release.yml +141 -0
- pyvefr-0.1.0/.github/workflows/docs.yml +45 -0
- pyvefr-0.1.0/.github/workflows/peachycheck.yml +35 -0
- pyvefr-0.1.0/.github/workflows/release.yml +190 -0
- pyvefr-0.1.0/.gitignore +9 -0
- pyvefr-0.1.0/AGENTS.md +10 -0
- pyvefr-0.1.0/CMakeLists.txt +99 -0
- pyvefr-0.1.0/Config.cmake.in +11 -0
- pyvefr-0.1.0/LICENSE +674 -0
- pyvefr-0.1.0/PKG-INFO +60 -0
- pyvefr-0.1.0/README.md +45 -0
- pyvefr-0.1.0/docs/algorithms.rst +157 -0
- pyvefr-0.1.0/docs/conf.py +21 -0
- pyvefr-0.1.0/docs/graphs.rst +62 -0
- pyvefr-0.1.0/docs/index.rst +45 -0
- pyvefr-0.1.0/docs/nauty.rst +42 -0
- pyvefr-0.1.0/docs/python.rst +123 -0
- pyvefr-0.1.0/docs/refinement.rst +52 -0
- pyvefr-0.1.0/docs/requirements.txt +3 -0
- pyvefr-0.1.0/include/vefr/algorithms.hpp +619 -0
- pyvefr-0.1.0/include/vefr/dot.hpp +71 -0
- pyvefr-0.1.0/include/vefr/graphs.hpp +89 -0
- pyvefr-0.1.0/include/vefr/nauty.hpp +65 -0
- pyvefr-0.1.0/include/vefr/properties.hpp +56 -0
- pyvefr-0.1.0/include/vefr/python/bindings.hpp +383 -0
- pyvefr-0.1.0/include/vefr/refinement.hpp +198 -0
- pyvefr-0.1.0/include/vefr/reversed.hpp +64 -0
- pyvefr-0.1.0/peachycheck.yml +6 -0
- pyvefr-0.1.0/pyproject.toml +80 -0
- pyvefr-0.1.0/pyrightconfig.json +51 -0
- pyvefr-0.1.0/python/__pycache__/pyvefr_build_backend.cpython-313.pyc +0 -0
- pyvefr-0.1.0/python/pyvefr_build_backend.py +17 -0
- pyvefr-0.1.0/python/src/CMakeLists.txt +50 -0
- pyvefr-0.1.0/python/src/module.cpp +3 -0
- pyvefr-0.1.0/python/src/pyvefr/__init__.py +71 -0
- pyvefr-0.1.0/python/src/pyvefr/bindings.cpp +63 -0
- pyvefr-0.1.0/python/src/pyvefr/bindings.hpp +8 -0
- pyvefr-0.1.0/python/src/pyvefr/py.typed +0 -0
- pyvefr-0.1.0/python/tests/downstream/module.cpp +39 -0
- pyvefr-0.1.0/python/tests/test_downstream.py +39 -0
- pyvefr-0.1.0/python/tests/test_graphs.py +141 -0
- pyvefr-0.1.0/ruff.toml +49 -0
- pyvefr-0.1.0/src/CMakeLists.txt +34 -0
- pyvefr-0.1.0/src/nauty.cpp +88 -0
- pyvefr-0.1.0/tests/CMakeLists.txt +6 -0
- pyvefr-0.1.0/tests/unit/graphs.cpp +310 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
AccessModifierOffset: -4
|
|
3
|
+
AlignAfterOpenBracket: Align
|
|
4
|
+
AlignEscapedNewlines: Left
|
|
5
|
+
AlignOperands: 'true'
|
|
6
|
+
AlignTrailingComments: 'true'
|
|
7
|
+
AllowAllArgumentsOnNextLine: 'false'
|
|
8
|
+
AllowAllConstructorInitializersOnNextLine: 'false'
|
|
9
|
+
AllowAllParametersOfDeclarationOnNextLine: 'false'
|
|
10
|
+
AllowShortBlocksOnASingleLine: 'true'
|
|
11
|
+
AllowShortCaseLabelsOnASingleLine: 'false'
|
|
12
|
+
AllowShortFunctionsOnASingleLine: All
|
|
13
|
+
AllowShortIfStatementsOnASingleLine: Never
|
|
14
|
+
AllowShortLambdasOnASingleLine: All
|
|
15
|
+
AllowShortLoopsOnASingleLine: 'false'
|
|
16
|
+
AlwaysBreakTemplateDeclarations: 'Yes'
|
|
17
|
+
BinPackArguments: 'false'
|
|
18
|
+
BinPackParameters: 'false'
|
|
19
|
+
BreakBeforeBinaryOperators: NonAssignment
|
|
20
|
+
BreakBeforeBraces: Allman
|
|
21
|
+
BreakBeforeTernaryOperators: 'false'
|
|
22
|
+
BreakConstructorInitializers: AfterColon
|
|
23
|
+
BreakInheritanceList: AfterColon
|
|
24
|
+
ColumnLimit: '160'
|
|
25
|
+
CompactNamespaces: 'false'
|
|
26
|
+
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
|
|
27
|
+
Cpp11BracedListStyle: 'false'
|
|
28
|
+
FixNamespaceComments: 'false'
|
|
29
|
+
IncludeBlocks: Regroup
|
|
30
|
+
IndentAccessModifiers: 'false'
|
|
31
|
+
IndentCaseLabels: 'true'
|
|
32
|
+
IndentPPDirectives: None
|
|
33
|
+
IndentWidth: '4'
|
|
34
|
+
IndentWrappedFunctionNames: 'false'
|
|
35
|
+
KeepEmptyLinesAtTheStartOfBlocks: 'false'
|
|
36
|
+
Language: Cpp
|
|
37
|
+
MaxEmptyLinesToKeep: '1'
|
|
38
|
+
NamespaceIndentation: None
|
|
39
|
+
PointerAlignment: Left
|
|
40
|
+
SortIncludes: 'true'
|
|
41
|
+
SortUsingDeclarations: 'true'
|
|
42
|
+
SpaceAfterCStyleCast: 'true'
|
|
43
|
+
SpaceAfterLogicalNot: 'false'
|
|
44
|
+
SpaceAfterTemplateKeyword: 'false'
|
|
45
|
+
SpaceBeforeAssignmentOperators: 'true'
|
|
46
|
+
SpaceBeforeCpp11BracedList: 'true'
|
|
47
|
+
SpaceBeforeCtorInitializerColon: 'true'
|
|
48
|
+
SpaceBeforeInheritanceColon: 'true'
|
|
49
|
+
SpaceBeforeParens: ControlStatements
|
|
50
|
+
SpaceBeforeRangeBasedForLoopColon: 'true'
|
|
51
|
+
SpaceInEmptyParentheses: 'false'
|
|
52
|
+
SpacesBeforeTrailingComments: '2'
|
|
53
|
+
SpacesInAngles: 'false'
|
|
54
|
+
SpacesInCStyleCastParentheses: 'false'
|
|
55
|
+
SpacesInParentheses: 'false'
|
|
56
|
+
SpacesInSquareBrackets: 'false'
|
|
57
|
+
Standard: Cpp11
|
|
58
|
+
TabWidth: '4'
|
|
59
|
+
UseTab: Never
|
|
60
|
+
...
|
pyvefr-0.1.0/.clang-tidy
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# clang-tidy for peachycheck: every bugprone, cppcoreguidelines and performance check is on,
|
|
2
|
+
# except where the check is wrong for any code, not just for today's:
|
|
3
|
+
# - unchecked container access, constant array index: the only fix, .at(), puts a bounds
|
|
4
|
+
# check into hot loops. Debug builds check those bounds instead: VEFR_STDLIB_ASSERTIONS
|
|
5
|
+
# (CMakeLists.txt) defines _GLIBCXX_ASSERTIONS, so operator[] of std::vector, std::array and
|
|
6
|
+
# std::span asserts its index there, at no cost in Release;
|
|
7
|
+
# - easily-swappable-parameters: a heuristic without a clear fix;
|
|
8
|
+
# - chained-comparison: GCC's -Wall (-Wparentheses) already rejects a < b < c on built-in
|
|
9
|
+
# types in the Linux CI build, where warnings are errors, so the check adds only overloaded
|
|
10
|
+
# operators, and here those are Boost.Spirit X3's expectation chains (a > b > c), which are
|
|
11
|
+
# not comparisons;
|
|
12
|
+
# - avoid-c-arrays: std::unique_ptr<T[]> with make_unique_for_overwrite is the uninitialized buffer,
|
|
13
|
+
# which std::vector would zero;
|
|
14
|
+
# From the other families, the checks that find defects rather than enforce a style: the static
|
|
15
|
+
# analyzer (clang-analyzer-*), concurrency, include cycles, redundant expressions, external linkage
|
|
16
|
+
# of file-local functions, discarded results, nested namespace syntax, C-style casts, declarations
|
|
17
|
+
# whose parameter names differ from the definition, non-inline definitions in headers (ODR), ignored
|
|
18
|
+
# C return values, dead code (unused declarations and parameters, redundant declarations and casts,
|
|
19
|
+
# member functions that could be const) and the modern forms that rule out a defect class (override,
|
|
20
|
+
# nullptr, make_unique, deleted and defaulted members, misleading identifiers and indentation). Not
|
|
21
|
+
# misc-const-correctness: in templates it reports variables as never modified that an overload
|
|
22
|
+
# chosen at instantiation does modify (hash_combine's seed, fold-expression counters); following it
|
|
23
|
+
# made hash_combine recurse forever.
|
|
24
|
+
# Not google-explicit-constructor: the standard library's own idioms need implicit conversions
|
|
25
|
+
# that it forbids, with no option to allow them: proxy references convert to their value (as
|
|
26
|
+
# std::vector<bool>::reference does, and iterator concepts require it), and views of mutable
|
|
27
|
+
# elements convert to views of const ones (as std::span does).
|
|
28
|
+
# Not portability-template-virtual-member-function: it warns that other compilers (MSVC)
|
|
29
|
+
# instantiate unused virtual members of class templates; the libraries build only with GCC and
|
|
30
|
+
# Clang (Linux and macOS), which instantiate only what is used, so no build can check a fix.
|
|
31
|
+
# tests/ turns off more in their own files, each with its reason.
|
|
32
|
+
Checks: >
|
|
33
|
+
-*,
|
|
34
|
+
bugprone-*,
|
|
35
|
+
cppcoreguidelines-*,
|
|
36
|
+
performance-*,
|
|
37
|
+
clang-analyzer-*,
|
|
38
|
+
concurrency-*,
|
|
39
|
+
misc-header-include-cycle,
|
|
40
|
+
misc-redundant-expression,
|
|
41
|
+
misc-use-internal-linkage,
|
|
42
|
+
modernize-use-nodiscard,
|
|
43
|
+
modernize-concat-nested-namespaces,
|
|
44
|
+
modernize-avoid-c-style-cast,
|
|
45
|
+
google-runtime-int,
|
|
46
|
+
readability-inconsistent-declaration-parameter-name,
|
|
47
|
+
misc-definitions-in-headers,
|
|
48
|
+
cert-err33-c,
|
|
49
|
+
misc-unused-using-decls,
|
|
50
|
+
misc-unused-alias-decls,
|
|
51
|
+
misc-unused-parameters,
|
|
52
|
+
readability-redundant-declaration,
|
|
53
|
+
readability-redundant-casting,
|
|
54
|
+
readability-redundant-string-cstr,
|
|
55
|
+
readability-make-member-function-const,
|
|
56
|
+
modernize-use-emplace,
|
|
57
|
+
modernize-use-equals-default,
|
|
58
|
+
modernize-use-equals-delete,
|
|
59
|
+
modernize-use-override,
|
|
60
|
+
modernize-use-nullptr,
|
|
61
|
+
modernize-use-using,
|
|
62
|
+
modernize-make-unique,
|
|
63
|
+
modernize-make-shared,
|
|
64
|
+
misc-misplaced-const,
|
|
65
|
+
misc-throw-by-value-catch-by-reference,
|
|
66
|
+
misc-unconventional-assign-operator,
|
|
67
|
+
misc-non-copyable-objects,
|
|
68
|
+
misc-confusable-identifiers,
|
|
69
|
+
misc-misleading-bidirectional,
|
|
70
|
+
misc-misleading-identifier,
|
|
71
|
+
readability-misleading-indentation,
|
|
72
|
+
readability-duplicate-include,
|
|
73
|
+
readability-non-const-parameter,
|
|
74
|
+
hicpp-multiway-paths-covered,
|
|
75
|
+
-cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,
|
|
76
|
+
-cppcoreguidelines-pro-bounds-constant-array-index,
|
|
77
|
+
-bugprone-easily-swappable-parameters,
|
|
78
|
+
-cppcoreguidelines-avoid-c-arrays,
|
|
79
|
+
-bugprone-chained-comparison
|
|
80
|
+
HeaderFilterRegex: '.*/(include/vefr|tests|profiling|python/src)/.*'
|
|
81
|
+
ExcludeHeaderFilterRegex: '.*/(dependencies-install|dependencies-build|build|site-packages|_deps)/.*'
|
|
82
|
+
CheckOptions:
|
|
83
|
+
# Views are handles (an index or data handle plus a context pointer), passed by value like
|
|
84
|
+
# std::string_view; only cista's variant inside some of them makes their copy non-trivial.
|
|
85
|
+
# Matched by name as written, so the aliases (TermView, FunctionExpressionView<T>) match too.
|
|
86
|
+
performance-unnecessary-value-param.AllowedTypes: 'View<;View$'
|
|
87
|
+
# Member initializers are written `= value`, as elsewhere in the code.
|
|
88
|
+
cppcoreguidelines-use-default-member-init.UseAssignment: true
|
|
89
|
+
# URD_ASSUME (urd/config.hpp) must expand at its call site, like assert: the
|
|
90
|
+
# analysis of optionals sees a condition only in the function that states it, never through a call.
|
|
91
|
+
cppcoreguidelines-macro-usage.AllowedRegexp: '^URD_ASSUME$'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: CI Ctest
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches-ignore:
|
|
6
|
+
- test-pypi
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CMAKE_BUILD_PARALLEL_LEVEL: "2"
|
|
11
|
+
VEFR_JOBS: "2"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-and-test:
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
include:
|
|
20
|
+
- os: ubuntu-latest
|
|
21
|
+
build_type: Debug
|
|
22
|
+
- os: macos-latest
|
|
23
|
+
build_type: Release
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout vefr
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- name: Setup Python
|
|
30
|
+
uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.11"
|
|
33
|
+
|
|
34
|
+
- name: Install python requirements
|
|
35
|
+
run: |
|
|
36
|
+
python -m pip install --no-cache-dir --upgrade pip uv
|
|
37
|
+
uv pip install --system --no-cache -r pyproject.toml --extra test
|
|
38
|
+
env:
|
|
39
|
+
PIP_NO_CACHE_DIR: 1
|
|
40
|
+
|
|
41
|
+
# Every compiler warning fails the build here, so none goes unnoticed.
|
|
42
|
+
- name: Configure and Build vefr
|
|
43
|
+
run: |
|
|
44
|
+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
|
45
|
+
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
|
46
|
+
-DVEFR_BUILD_TESTS=ON \
|
|
47
|
+
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
48
|
+
-DPython_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')" \
|
|
49
|
+
-S . -B build_${{ matrix.build_type }} \
|
|
50
|
+
-DCMAKE_PREFIX_PATH="$(python -c 'import pyurd, pyurd_native; print(f"{pyurd.native_prefix()};{pyurd_native.native_prefix()}")')"
|
|
51
|
+
cmake --build build_${{ matrix.build_type }} -j2
|
|
52
|
+
|
|
53
|
+
- name: Run Tests
|
|
54
|
+
working-directory: build_${{ matrix.build_type }}/tests
|
|
55
|
+
run: |
|
|
56
|
+
URD_LIB_DIR="$(python -c 'import pyurd_native; print(pyurd_native.native_prefix() / "lib")')"
|
|
57
|
+
export DYLD_LIBRARY_PATH="${URD_LIB_DIR}:$PWD/../src:${DYLD_LIBRARY_PATH:-}"
|
|
58
|
+
export LD_LIBRARY_PATH="${URD_LIB_DIR}:$PWD/../src:${LD_LIBRARY_PATH:-}"
|
|
59
|
+
GTEST_OUTPUT=xml:test-results/ GTEST_COLOR=1 ctest -V
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: CI Pytest
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches-ignore:
|
|
6
|
+
- test-pypi
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CMAKE_BUILD_PARALLEL_LEVEL: "2"
|
|
11
|
+
VEFR_JOBS: "2"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-and-test:
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, macos-latest]
|
|
20
|
+
python-version: ["3.13"]
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout repository
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Setup Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
|
|
31
|
+
- name: Install CMake on Linux
|
|
32
|
+
if: runner.os == 'Linux'
|
|
33
|
+
run: |
|
|
34
|
+
sudo apt-get update
|
|
35
|
+
sudo apt-get install -y cmake
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies and requirements
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --no-cache-dir --upgrade pip
|
|
40
|
+
env:
|
|
41
|
+
PIP_NO_CACHE_DIR: 1
|
|
42
|
+
|
|
43
|
+
- name: Build and install
|
|
44
|
+
run: python -m pip install --no-cache-dir --verbose .[test]
|
|
45
|
+
env:
|
|
46
|
+
PIP_NO_CACHE_DIR: 1
|
|
47
|
+
|
|
48
|
+
- name: Test
|
|
49
|
+
run: pytest python/tests
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
name: CI Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- dev
|
|
8
|
+
pull_request:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
CMAKE_BUILD_PARALLEL_LEVEL: "2"
|
|
13
|
+
VEFR_JOBS: "2"
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build_sdist:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v6
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v6
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
- name: Install build frontend
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
python -m pip install build
|
|
32
|
+
|
|
33
|
+
- name: Build source distribution
|
|
34
|
+
run: python -m build --sdist
|
|
35
|
+
|
|
36
|
+
- name: Upload sdist artifact
|
|
37
|
+
uses: actions/upload-artifact@v5
|
|
38
|
+
with:
|
|
39
|
+
name: sdist
|
|
40
|
+
path: dist/*.tar.gz
|
|
41
|
+
|
|
42
|
+
build_wheels_linux:
|
|
43
|
+
runs-on: ${{ matrix.architecture == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
|
44
|
+
strategy:
|
|
45
|
+
fail-fast: false
|
|
46
|
+
matrix:
|
|
47
|
+
architecture: ["x86_64", "aarch64"]
|
|
48
|
+
python-version: ["cp311"]
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- name: Checkout repository
|
|
52
|
+
uses: actions/checkout@v6
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v6
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.13"
|
|
58
|
+
|
|
59
|
+
- name: Install cibuildwheel
|
|
60
|
+
run: |
|
|
61
|
+
python -m pip install --upgrade pip
|
|
62
|
+
python -m pip install cibuildwheel
|
|
63
|
+
|
|
64
|
+
- name: Build Linux wheels
|
|
65
|
+
run: cibuildwheel --output-dir wheelhouse
|
|
66
|
+
env:
|
|
67
|
+
CIBW_ENVIRONMENT: "VEFR_JOBS=2 CMAKE_BUILD_PARALLEL_LEVEL=2"
|
|
68
|
+
CIBW_PLATFORM: linux
|
|
69
|
+
CIBW_BUILD: "${{ matrix.python-version }}-*"
|
|
70
|
+
CIBW_SKIP: "*-musllinux_*"
|
|
71
|
+
CIBW_ARCHS: "${{ matrix.architecture }}"
|
|
72
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
73
|
+
|
|
74
|
+
- name: Upload Linux wheels artifact
|
|
75
|
+
uses: actions/upload-artifact@v5
|
|
76
|
+
with:
|
|
77
|
+
name: wheels-linux-${{ matrix.python-version }}-${{ matrix.architecture }}
|
|
78
|
+
path: wheelhouse/*.whl
|
|
79
|
+
|
|
80
|
+
build_wheels_macos:
|
|
81
|
+
runs-on: ${{ matrix.architecture == 'x86_64' && 'macos-15-intel' || 'macos-latest' }}
|
|
82
|
+
strategy:
|
|
83
|
+
fail-fast: false
|
|
84
|
+
matrix:
|
|
85
|
+
architecture: ["arm64", "x86_64"]
|
|
86
|
+
python-version: ["cp311"]
|
|
87
|
+
|
|
88
|
+
steps:
|
|
89
|
+
- name: Checkout repository
|
|
90
|
+
uses: actions/checkout@v6
|
|
91
|
+
|
|
92
|
+
- name: Set up Python
|
|
93
|
+
uses: actions/setup-python@v6
|
|
94
|
+
with:
|
|
95
|
+
python-version: "3.13"
|
|
96
|
+
|
|
97
|
+
- name: Install cibuildwheel
|
|
98
|
+
run: |
|
|
99
|
+
python -m pip install --upgrade pip
|
|
100
|
+
python -m pip install cibuildwheel
|
|
101
|
+
|
|
102
|
+
- name: Build macOS wheels
|
|
103
|
+
run: cibuildwheel --output-dir wheelhouse
|
|
104
|
+
env:
|
|
105
|
+
CIBW_ENVIRONMENT: "VEFR_JOBS=2 CMAKE_BUILD_PARALLEL_LEVEL=2 MACOSX_DEPLOYMENT_TARGET=11.0"
|
|
106
|
+
CIBW_PLATFORM: macos
|
|
107
|
+
CIBW_BUILD: "${{ matrix.python-version }}-*"
|
|
108
|
+
CIBW_ARCHS: "${{ matrix.architecture }}"
|
|
109
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
110
|
+
|
|
111
|
+
- name: Upload macOS wheels artifact
|
|
112
|
+
uses: actions/upload-artifact@v5
|
|
113
|
+
with:
|
|
114
|
+
name: wheels-macos-${{ matrix.python-version }}-${{ matrix.architecture }}
|
|
115
|
+
path: wheelhouse/*.whl
|
|
116
|
+
|
|
117
|
+
validate_release:
|
|
118
|
+
needs:
|
|
119
|
+
- build_sdist
|
|
120
|
+
- build_wheels_linux
|
|
121
|
+
- build_wheels_macos
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
|
|
124
|
+
steps:
|
|
125
|
+
- name: Download wheels
|
|
126
|
+
uses: actions/download-artifact@v5
|
|
127
|
+
with:
|
|
128
|
+
pattern: wheels-*
|
|
129
|
+
path: dist
|
|
130
|
+
merge-multiple: true
|
|
131
|
+
|
|
132
|
+
- name: Download source distribution
|
|
133
|
+
uses: actions/download-artifact@v5
|
|
134
|
+
with:
|
|
135
|
+
name: sdist
|
|
136
|
+
path: dist
|
|
137
|
+
|
|
138
|
+
- name: Validate release assets
|
|
139
|
+
run: |
|
|
140
|
+
test "$(find dist -maxdepth 1 -type f -name '*.tar.gz' | wc -l)" -eq 1
|
|
141
|
+
test "$(find dist -maxdepth 1 -type f -name '*.whl' | wc -l)" -eq 4
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
# The documentation (docs/, Sphinx), built with warnings as errors on every pull request; main's is published on
|
|
4
|
+
# GitHub Pages (https://planning-and-learning.github.io/vefr/), where the README links.
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: docs-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
- uses: actions/setup-python@v6
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.13"
|
|
26
|
+
- run: pip install --no-cache-dir -r docs/requirements.txt
|
|
27
|
+
- run: sphinx-build -W --keep-going -b html docs build/docs/html
|
|
28
|
+
- uses: actions/upload-pages-artifact@v3
|
|
29
|
+
if: github.ref == 'refs/heads/main'
|
|
30
|
+
with:
|
|
31
|
+
path: build/docs/html
|
|
32
|
+
|
|
33
|
+
deploy:
|
|
34
|
+
if: github.ref == 'refs/heads/main'
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
permissions:
|
|
38
|
+
pages: write
|
|
39
|
+
id-token: write
|
|
40
|
+
environment:
|
|
41
|
+
name: github-pages
|
|
42
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
43
|
+
steps:
|
|
44
|
+
- id: deployment
|
|
45
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: peachycheck
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
peachycheck:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
- uses: actions/setup-python@v6
|
|
14
|
+
id: python
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.11"
|
|
17
|
+
cache: pip
|
|
18
|
+
cache-dependency-path: pyproject.toml
|
|
19
|
+
- uses: drexlerd/peachycheck@v0.1.0
|
|
20
|
+
env:
|
|
21
|
+
PYTHON: ${{ steps.python.outputs.python-path }}
|
|
22
|
+
with:
|
|
23
|
+
# clang-tidy needs compile_commands.json, pyright the package in .venv (the stubs are generated at install).
|
|
24
|
+
# The native dependencies come with the pyurd and pyurd_native wheels.
|
|
25
|
+
prepare: |
|
|
26
|
+
"$PYTHON" -m venv .venv
|
|
27
|
+
.venv/bin/python -m pip install 'scikit-build-core>=1.0.3,<2' 'cmake>=3.21' 'ninja>=1.5' \
|
|
28
|
+
'nanobind-backend>=1.0' 'pybrokkr>=0.1.3,<0.2' 'pyurd>=0.2.0,<0.3'
|
|
29
|
+
PREFIX="$(.venv/bin/python -c 'import pyurd, pyurd_native; print(f"{pyurd.native_prefix()};{pyurd_native.native_prefix()}")')"
|
|
30
|
+
cmake -S . -B build/peachycheck -G Ninja -DCMAKE_MAKE_PROGRAM="$PWD/.venv/bin/ninja" \
|
|
31
|
+
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
32
|
+
-DVEFR_BUILD_TESTS=ON -DVEFR_BUILD_PYVEFR=ON \
|
|
33
|
+
-DCMAKE_PREFIX_PATH="$PREFIX" -DCMAKE_INSTALL_LIBDIR=lib \
|
|
34
|
+
-DPython_EXECUTABLE="$PWD/.venv/bin/python" -DPython3_EXECUTABLE="$PWD/.venv/bin/python"
|
|
35
|
+
.venv/bin/python -m pip install --no-build-isolation ".[test]"
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CMAKE_BUILD_PARALLEL_LEVEL: "2"
|
|
10
|
+
VEFR_JOBS: "2"
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build_sdist:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.13"
|
|
24
|
+
|
|
25
|
+
- name: Install build frontend
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --no-cache-dir --upgrade pip
|
|
28
|
+
python -m pip install --no-cache-dir build
|
|
29
|
+
|
|
30
|
+
- name: Build source distribution
|
|
31
|
+
run: python -m build --sdist
|
|
32
|
+
|
|
33
|
+
- name: Upload sdist artifact
|
|
34
|
+
uses: actions/upload-artifact@v5
|
|
35
|
+
with:
|
|
36
|
+
name: sdist
|
|
37
|
+
path: dist/*.tar.gz
|
|
38
|
+
|
|
39
|
+
build_wheels_linux:
|
|
40
|
+
runs-on: ${{ matrix.architecture == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
|
41
|
+
strategy:
|
|
42
|
+
fail-fast: false
|
|
43
|
+
matrix:
|
|
44
|
+
architecture: ["x86_64", "aarch64"]
|
|
45
|
+
python-version: ["cp311"]
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- name: Checkout repository
|
|
49
|
+
uses: actions/checkout@v6
|
|
50
|
+
|
|
51
|
+
- name: Set up Python
|
|
52
|
+
uses: actions/setup-python@v6
|
|
53
|
+
with:
|
|
54
|
+
python-version: "3.13"
|
|
55
|
+
|
|
56
|
+
- name: Install cibuildwheel
|
|
57
|
+
run: |
|
|
58
|
+
python -m pip install --no-cache-dir --upgrade pip
|
|
59
|
+
python -m pip install --no-cache-dir cibuildwheel
|
|
60
|
+
|
|
61
|
+
- name: Build Linux wheels
|
|
62
|
+
run: cibuildwheel --output-dir wheelhouse
|
|
63
|
+
env:
|
|
64
|
+
CIBW_ENVIRONMENT: "VEFR_JOBS=2 CMAKE_BUILD_PARALLEL_LEVEL=2"
|
|
65
|
+
CIBW_PLATFORM: linux
|
|
66
|
+
CIBW_BUILD: "${{ matrix.python-version }}-*"
|
|
67
|
+
CIBW_SKIP: "*-musllinux_*"
|
|
68
|
+
CIBW_ARCHS: "${{ matrix.architecture }}"
|
|
69
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
70
|
+
|
|
71
|
+
- name: Upload Linux wheels artifact
|
|
72
|
+
uses: actions/upload-artifact@v5
|
|
73
|
+
with:
|
|
74
|
+
name: wheels-linux-${{ matrix.python-version }}-${{ matrix.architecture }}
|
|
75
|
+
path: wheelhouse/*.whl
|
|
76
|
+
|
|
77
|
+
build_wheels_macos:
|
|
78
|
+
runs-on: ${{ matrix.architecture == 'x86_64' && 'macos-15-intel' || 'macos-latest' }}
|
|
79
|
+
strategy:
|
|
80
|
+
fail-fast: false
|
|
81
|
+
matrix:
|
|
82
|
+
architecture: ["arm64", "x86_64"]
|
|
83
|
+
python-version: ["cp311"]
|
|
84
|
+
|
|
85
|
+
steps:
|
|
86
|
+
- name: Checkout repository
|
|
87
|
+
uses: actions/checkout@v6
|
|
88
|
+
|
|
89
|
+
- name: Set up Python
|
|
90
|
+
uses: actions/setup-python@v6
|
|
91
|
+
with:
|
|
92
|
+
python-version: "3.13"
|
|
93
|
+
|
|
94
|
+
- name: Install cibuildwheel
|
|
95
|
+
run: |
|
|
96
|
+
python -m pip install --no-cache-dir --upgrade pip
|
|
97
|
+
python -m pip install --no-cache-dir cibuildwheel
|
|
98
|
+
|
|
99
|
+
- name: Build macOS wheels
|
|
100
|
+
run: cibuildwheel --output-dir wheelhouse
|
|
101
|
+
env:
|
|
102
|
+
CIBW_ENVIRONMENT: "VEFR_JOBS=2 CMAKE_BUILD_PARALLEL_LEVEL=2 MACOSX_DEPLOYMENT_TARGET=11.0"
|
|
103
|
+
CIBW_PLATFORM: macos
|
|
104
|
+
CIBW_BUILD: "${{ matrix.python-version }}-*"
|
|
105
|
+
CIBW_ARCHS: "${{ matrix.architecture }}"
|
|
106
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
107
|
+
|
|
108
|
+
- name: Upload macOS wheels artifact
|
|
109
|
+
uses: actions/upload-artifact@v5
|
|
110
|
+
with:
|
|
111
|
+
name: wheels-macos-${{ matrix.python-version }}-${{ matrix.architecture }}
|
|
112
|
+
path: wheelhouse/*.whl
|
|
113
|
+
|
|
114
|
+
github_release:
|
|
115
|
+
needs:
|
|
116
|
+
- build_sdist
|
|
117
|
+
- build_wheels_linux
|
|
118
|
+
- build_wheels_macos
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
|
|
121
|
+
if: github.repository_owner == 'planning-and-learning'
|
|
122
|
+
|
|
123
|
+
permissions:
|
|
124
|
+
contents: write
|
|
125
|
+
|
|
126
|
+
steps:
|
|
127
|
+
- name: Checkout repository
|
|
128
|
+
uses: actions/checkout@v6
|
|
129
|
+
|
|
130
|
+
- name: Check version matches tag
|
|
131
|
+
run: |
|
|
132
|
+
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
133
|
+
TAG=${GITHUB_REF#refs/tags/v}
|
|
134
|
+
|
|
135
|
+
echo "Package version: $VERSION"
|
|
136
|
+
echo "Git tag: $TAG"
|
|
137
|
+
|
|
138
|
+
if [ "$VERSION" != "$TAG" ]; then
|
|
139
|
+
echo "Version mismatch: pyproject.toml=$VERSION tag=$TAG"
|
|
140
|
+
exit 1
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
- name: Download wheels
|
|
144
|
+
uses: actions/download-artifact@v5
|
|
145
|
+
with:
|
|
146
|
+
pattern: wheels-*
|
|
147
|
+
path: dist
|
|
148
|
+
merge-multiple: true
|
|
149
|
+
|
|
150
|
+
- name: Download source distribution
|
|
151
|
+
uses: actions/download-artifact@v5
|
|
152
|
+
with:
|
|
153
|
+
name: sdist
|
|
154
|
+
path: dist
|
|
155
|
+
|
|
156
|
+
- name: Inspect release assets
|
|
157
|
+
run: find dist -maxdepth 1 -type f
|
|
158
|
+
|
|
159
|
+
- name: Create GitHub release
|
|
160
|
+
env:
|
|
161
|
+
GH_TOKEN: ${{ github.token }}
|
|
162
|
+
run: gh release create "$GITHUB_REF_NAME" dist/* --verify-tag --generate-notes
|
|
163
|
+
|
|
164
|
+
publish:
|
|
165
|
+
needs: github_release
|
|
166
|
+
runs-on: ubuntu-latest
|
|
167
|
+
|
|
168
|
+
if: github.repository_owner == 'planning-and-learning'
|
|
169
|
+
|
|
170
|
+
permissions:
|
|
171
|
+
id-token: write
|
|
172
|
+
|
|
173
|
+
steps:
|
|
174
|
+
- name: Download wheels
|
|
175
|
+
uses: actions/download-artifact@v5
|
|
176
|
+
with:
|
|
177
|
+
pattern: wheels-*
|
|
178
|
+
path: dist
|
|
179
|
+
merge-multiple: true
|
|
180
|
+
|
|
181
|
+
- name: Download source distribution
|
|
182
|
+
uses: actions/download-artifact@v5
|
|
183
|
+
with:
|
|
184
|
+
name: sdist
|
|
185
|
+
path: dist
|
|
186
|
+
|
|
187
|
+
- name: Publish to PyPI
|
|
188
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
189
|
+
with:
|
|
190
|
+
packages-dir: dist
|
pyvefr-0.1.0/.gitignore
ADDED
pyvefr-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Shared rules
|
|
4
|
+
|
|
5
|
+
The rules that the planning-and-learning libraries share are maintained in brokkr and published at
|
|
6
|
+
<https://planning-and-learning.github.io/brokkr/>. Follow them; the rules in this file add to them.
|
|
7
|
+
|
|
8
|
+
- [Release cycle](https://planning-and-learning.github.io/brokkr/release_cycle.html)
|
|
9
|
+
- [Template and include rules](https://planning-and-learning.github.io/brokkr/template_rules.html)
|
|
10
|
+
- [Coding rules](https://planning-and-learning.github.io/brokkr/coding_rules.html)
|