[build-system] requires = [ "scikit-build-core>=0.3.3", "pybind11==3.0.4", "pybind11_stubgen @ git+https://github.com/sarlinpe/pybind11-stubgen@sarlinpe/fix-2025-08-20", "numpy", "ruff==0.15.20", "clang-format==22.1.5", ] build-backend = "scikit_build_core.build" [project] name = "pycolmap" # WARNING: This version must follow the MAJOR.MINOR.PATCH format. If only # MAJOR.MINOR is used, cibuildwheel will add a .dev0 patch version, which # results in releasing a pre-release version on PyPI. version = "4.2.0" description = "COLMAP bindings" readme = "python/README.md" authors = [ { name = "Johannes Schönberger", email = "jsch@demuc.de" }, { name = "Mihai Dusmanu", email = "mihai.dusmanu@gmail.com" }, { name = "Paul-Edouard Sarlin", email = "paul.edouard.sarlin@gmail.com" }, { name = "Shaohui Liu", email = "b1ueber2y@gmail.com" }, { name = "Philipp Lindenberger", email = "plindenbe@ethz.ch" }, ] license = {text = "BSD-3-Clause"} urls = {Repository = "https://github.com/colmap/colmap"} requires-python = ">=3.10" dependencies = ["numpy"] classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3 :: Only", ] [project.optional-dependencies] panorama = ["opencv-python-headless", "pillow", "tqdm"] [tool.scikit-build] wheel.expand-macos-universal-tags = true cmake.source-dir = "python/" wheel.packages = ["python/pycolmap"] [tool.cibuildwheel] build = "cp3{10,11,12,13,14}-{macosx,manylinux,win}*" archs = ["auto64"] # A fresh PEP 517 isolation directory changes compiler include paths on every # run, preventing ccache reuse. Install the same requirements into the stable # cibuildwheel Python environment instead. build-frontend = {name = "build", args = ["--no-isolation"]} before-build = "python {project}/python/ci/install-build-requirements.py" # pillow and requests are imported by the TartanAir packaging script, whose # tests are otherwise silently skipped. test-requires = "pytest>=8.0 mypy==2.1.0 enlighten==1.14.1 pillow requests" test-command = """\ python -c "import pycolmap; print(pycolmap.__version__)" && \ cd {project} && \ mypy --package pycolmap && \ mypy --install-types --non-interactive python benchmark && \ mypy src/pycolmap && \ pytest\ """ [tool.cibuildwheel.linux] before-all = "{project}/python/ci/install-colmap-almalinux.sh" [tool.cibuildwheel.macos] before-all = "{project}/python/ci/install-colmap-macos.sh" [tool.cibuildwheel.windows] before-all = "pwsh -File {project}/python/ci/install-colmap-windows.ps1" before-build = "python {project}/python/ci/install-build-requirements.py && pip install delvewheel" test-command = "pwsh -File {project}/python/ci/test-colmap-windows.ps1" # Skip mypy on source files for Python 3.10. There's a bug in numpy's type # annotations that was fixed in version 2.3.0, but numpy stopped shipping # wheels for Python 3.10 in 2.3.0. This causes mypy to fail. # TODO: remove once support for Python 3.10 is dropped after its EOL in # October 2026. [[tool.cibuildwheel.overrides]] select = "cp310-{macosx,manylinux}*" test-command = """\ python -c "import pycolmap; print(pycolmap.__version__)" && \ cd {project} && \ mypy --package pycolmap && \ mypy src/pycolmap && \ pytest\ """ [tool.pytest.ini_options] minversion = "8.0" addopts = ["-ra", "-q", "--import-mode=importlib"] testpaths = [ "python", "benchmark", "src/pycolmap", ] norecursedirs = [ "build", "python/build", ] [tool.mypy] implicit_optional = true ignore_missing_imports = true explicit_package_bases = true