Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = [
3 "scikit-build-core>=0.3.3",
4 "pybind11==3.0.4",
5 "pybind11_stubgen @ git+https://github.com/sarlinpe/pybind11-stubgen@sarlinpe/fix-2025-08-20",
6 "numpy",
7 "ruff==0.15.20",
8 "clang-format==22.1.5",
9 ]
10 build-backend = "scikit_build_core.build"
11
12 [project]
13 name = "pycolmap"
14 # WARNING: This version must follow the MAJOR.MINOR.PATCH format. If only
15 # MAJOR.MINOR is used, cibuildwheel will add a .dev0 patch version, which
16 # results in releasing a pre-release version on PyPI.
17 version = "4.2.0"
18 description = "COLMAP bindings"
19 readme = "python/README.md"
20 authors = [
21 { name = "Johannes Schönberger", email = "[email protected]" },
22 { name = "Mihai Dusmanu", email = "[email protected]" },
23 { name = "Paul-Edouard Sarlin", email = "[email protected]" },
24 { name = "Shaohui Liu", email = "[email protected]" },
25 { name = "Philipp Lindenberger", email = "[email protected]" },
26 ]
27 license = {text = "BSD-3-Clause"}
28 urls = {Repository = "https://github.com/colmap/colmap"}
29 requires-python = ">=3.10"
30 dependencies = ["numpy"]
31 classifiers = [
32 "License :: OSI Approved :: BSD License",
33 "Programming Language :: Python :: 3 :: Only",
34 ]
35
36 [project.optional-dependencies]
37 panorama = ["opencv-python-headless", "pillow", "tqdm"]
38
39 [tool.scikit-build]
40 wheel.expand-macos-universal-tags = true
41 cmake.source-dir = "python/"
42 wheel.packages = ["python/pycolmap"]
43
44 [tool.cibuildwheel]
45 build = "cp3{10,11,12,13,14}-{macosx,manylinux,win}*"
46 archs = ["auto64"]
47 # A fresh PEP 517 isolation directory changes compiler include paths on every
48 # run, preventing ccache reuse. Install the same requirements into the stable
49 # cibuildwheel Python environment instead.
50 build-frontend = {name = "build", args = ["--no-isolation"]}
51 before-build = "python {project}/python/ci/install-build-requirements.py"
52 # pillow and requests are imported by the TartanAir packaging script, whose
53 # tests are otherwise silently skipped.
54 test-requires = "pytest>=8.0 mypy==2.1.0 enlighten==1.14.1 pillow requests"
55 test-command = """\
56 python -c "import pycolmap; print(pycolmap.__version__)" && \
57 cd {project} && \
58 mypy --package pycolmap && \
59 mypy --install-types --non-interactive python benchmark && \
60 mypy src/pycolmap && \
61 pytest\
62 """
63
64 [tool.cibuildwheel.linux]
65 before-all = "{project}/python/ci/install-colmap-almalinux.sh"
66
67 [tool.cibuildwheel.macos]
68 before-all = "{project}/python/ci/install-colmap-macos.sh"
69
70 [tool.cibuildwheel.windows]
71 before-all = "pwsh -File {project}/python/ci/install-colmap-windows.ps1"
72 before-build = "python {project}/python/ci/install-build-requirements.py && pip install delvewheel"
73 test-command = "pwsh -File {project}/python/ci/test-colmap-windows.ps1"
74
75 # Skip mypy on source files for Python 3.10. There's a bug in numpy's type
76 # annotations that was fixed in version 2.3.0, but numpy stopped shipping
77 # wheels for Python 3.10 in 2.3.0. This causes mypy to fail.
78 # TODO: remove once support for Python 3.10 is dropped after its EOL in
79 # October 2026.
80 [[tool.cibuildwheel.overrides]]
81 select = "cp310-{macosx,manylinux}*"
82 test-command = """\
83 python -c "import pycolmap; print(pycolmap.__version__)" && \
84 cd {project} && \
85 mypy --package pycolmap && \
86 mypy src/pycolmap && \
87 pytest\
88 """
89
90 [tool.pytest.ini_options]
91 minversion = "8.0"
92 addopts = ["-ra", "-q", "--import-mode=importlib"]
93 testpaths = [
94 "python",
95 "benchmark",
96 "src/pycolmap",
97 ]
98 norecursedirs = [
99 "build",
100 "python/build",
101 ]
102
103 [tool.mypy]
104 implicit_optional = true
105 ignore_missing_imports = true
106 explicit_package_bases = true