Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building wheels. Move third party pip packages into setup.py #101

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
d74d513
init migration.
B1ueber2y Aug 25, 2024
75379f3
formatting.
B1ueber2y Aug 25, 2024
518ec41
update.
B1ueber2y Sep 4, 2024
cc0fc78
Merge branch 'main' into features/colmap_head
B1ueber2y Nov 20, 2024
beca63d
seems to be working
B1ueber2y Nov 20, 2024
3833cbe
skip copying to source
B1ueber2y Nov 21, 2024
b7b4d51
merge with main
B1ueber2y Nov 21, 2024
f1fdfbb
fix. remove poselib include
B1ueber2y Nov 23, 2024
6ec3768
fix non void
B1ueber2y Nov 23, 2024
adadd98
switch to official libigl
B1ueber2y Nov 23, 2024
733f474
use fetch content for poselib. update readme.
B1ueber2y Nov 23, 2024
e270af7
fetch content for colmap
B1ueber2y Nov 23, 2024
3451f5f
update readme. no need for colmap installation
B1ueber2y Nov 23, 2024
ee3ac85
update cmakelist
B1ueber2y Nov 23, 2024
940723b
fix install
B1ueber2y Nov 24, 2024
c59946f
update readme
B1ueber2y Nov 24, 2024
fcfc915
init build in ci
B1ueber2y Nov 24, 2024
94dab59
add script
B1ueber2y Nov 24, 2024
c2506d8
update
B1ueber2y Nov 24, 2024
10ef8b1
update
B1ueber2y Nov 24, 2024
81de36d
update
B1ueber2y Nov 24, 2024
dd59083
update
B1ueber2y Nov 24, 2024
41d0338
update
B1ueber2y Nov 24, 2024
ab68838
update
B1ueber2y Nov 24, 2024
baf82ba
Merge branch 'features/colmap_head' into features/ci_test
B1ueber2y Nov 24, 2024
a85c966
update
B1ueber2y Nov 24, 2024
20d0fc1
update ci.
B1ueber2y Nov 24, 2024
1ac6904
update
B1ueber2y Nov 24, 2024
de1e5fd
jkldfjs
B1ueber2y Nov 24, 2024
1a539da
reset
B1ueber2y Nov 24, 2024
ebb455d
update
B1ueber2y Nov 24, 2024
ed45995
fix submodule
B1ueber2y Nov 24, 2024
8a62586
Merge branch 'features/colmap_head' into features/ci_test
B1ueber2y Nov 24, 2024
c10839c
remove tp_lsd from third-party and update installation guide
B1ueber2y Nov 24, 2024
bbfc627
remove lbd and update installation guide
B1ueber2y Nov 24, 2024
5ee1c73
put hawp as separate installation
B1ueber2y Nov 24, 2024
ac60f01
minor update on docs
B1ueber2y Nov 24, 2024
10fa5b5
Merge branch 'fix/third_party' into features/ci_test
B1ueber2y Nov 24, 2024
d5ec878
update requirements.txt
B1ueber2y Nov 24, 2024
4e84b4a
merge fix/third_party
B1ueber2y Nov 24, 2024
61bcefe
add setuptools
B1ueber2y Nov 24, 2024
3e0b5e3
update
B1ueber2y Nov 24, 2024
6c03b11
update
B1ueber2y Nov 24, 2024
47cc740
update
B1ueber2y Nov 24, 2024
72126af
add v flag
B1ueber2y Nov 24, 2024
83f0c6e
update setup to support wheels
B1ueber2y Nov 25, 2024
5ee0395
remove third_party pip package from third-party
B1ueber2y Nov 25, 2024
311e124
build wheel in CI
B1ueber2y Nov 25, 2024
b4ae3f0
update
B1ueber2y Nov 25, 2024
c0b2423
update
B1ueber2y Nov 25, 2024
77897cb
update
B1ueber2y Nov 26, 2024
62039fd
test
B1ueber2y Nov 26, 2024
91bea94
tesi multiple versions
B1ueber2y Nov 26, 2024
6ef1edc
format
B1ueber2y Nov 26, 2024
9db38c3
test
B1ueber2y Nov 26, 2024
3bb004b
test
B1ueber2y Nov 26, 2024
70bd5e0
test
B1ueber2y Nov 26, 2024
922f4b4
test
B1ueber2y Nov 26, 2024
0c692d6
test matrix
B1ueber2y Nov 26, 2024
9ae9827
test
B1ueber2y Nov 26, 2024
3b2cef3
test
B1ueber2y Nov 26, 2024
8c41feb
test
B1ueber2y Nov 26, 2024
1ff3b33
try to disable cuda for colmap
B1ueber2y Nov 26, 2024
1dade95
test
B1ueber2y Nov 26, 2024
fa853ec
fix binding
B1ueber2y Nov 26, 2024
c129c87
move CUDA_ENABLED to top level
B1ueber2y Nov 26, 2024
6e14755
fix copy in pybind
B1ueber2y Nov 26, 2024
215aa50
switch to clang-format 19.1.0 and use pip
B1ueber2y Nov 26, 2024
f0513bc
upgrade deeplsd
B1ueber2y Nov 26, 2024
39b7c81
use logging from pycolmap
B1ueber2y Nov 26, 2024
2957ebf
disable parallelization in fitnmerge
B1ueber2y Nov 26, 2024
8d40cd8
fix formatting
B1ueber2y Nov 26, 2024
ceb400a
fix formatting
B1ueber2y Nov 26, 2024
c0014a0
E501
B1ueber2y Nov 26, 2024
bb3fcf8
fix scripts
B1ueber2y Nov 26, 2024
ae0872f
remove python json logger
B1ueber2y Nov 26, 2024
804595e
Merge branch 'features/colmap_head' into features/ci_test
B1ueber2y Nov 26, 2024
2583257
merge from upstream
B1ueber2y Nov 26, 2024
3d627fa
test
B1ueber2y Nov 26, 2024
ad32a40
fix copy constructor for other classes
B1ueber2y Nov 26, 2024
aa615ae
Merge branch 'features/colmap_head' into features/ci_test
B1ueber2y Nov 26, 2024
b86a11a
Merge branch 'features/ci_test' into features/wheels
B1ueber2y Nov 26, 2024
810d79c
test
B1ueber2y Nov 26, 2024
cd3c0b7
update test
B1ueber2y Nov 26, 2024
bd234e3
test
B1ueber2y Nov 26, 2024
176d1ad
upgrade gluestick
B1ueber2y Nov 26, 2024
f66db18
upgrade pytlsd
B1ueber2y Nov 26, 2024
5e955fa
make pytlsd consistent with gluestick
B1ueber2y Nov 26, 2024
f6e51ca
shorten tags
B1ueber2y Nov 26, 2024
023ce45
use system JLinkage
B1ueber2y Nov 26, 2024
ab0fb3e
use fetch content
B1ueber2y Nov 26, 2024
c99f063
merge branch features/jlinkage and resolve conflicts.
B1ueber2y Nov 27, 2024
2bf0af8
merge with main
B1ueber2y Nov 28, 2024
4f83e8d
fix merge
B1ueber2y Nov 28, 2024
0f15352
upgrade pytlsd and gluestick
B1ueber2y Nov 28, 2024
83381f1
resolve merge conflicts
B1ueber2y Nov 28, 2024
37b1bef
resolve conflicts
B1ueber2y Nov 28, 2024
7c50d76
update readme.
B1ueber2y Nov 28, 2024
4cb4ce0
minor update on readme
B1ueber2y Nov 28, 2024
49dc2be
test
B1ueber2y Nov 28, 2024
aa47aac
test
B1ueber2y Nov 28, 2024
0b893d2
test
B1ueber2y Nov 28, 2024
6ca6182
remove broken support for python 3.11/12
B1ueber2y Nov 28, 2024
310f47f
test
B1ueber2y Nov 28, 2024
928d440
test
B1ueber2y Nov 28, 2024
1df7c82
test
B1ueber2y Nov 28, 2024
681a3e1
fix test
B1ueber2y Nov 28, 2024
4d4efd1
remove 3.12 support for now
B1ueber2y Nov 28, 2024
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
53 changes: 45 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ on:

jobs:
build:
name: ${{ matrix.config.os }} ${{ matrix.config.arch }}
name: ${{ matrix.config.os }} ${{ matrix.config.arch }} with Python ${{ matrix.config.python-version }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config: [
{os: ubuntu-latest},
{os: ubuntu-latest, python-version: "3.8"},
{os: ubuntu-latest, python-version: "3.9"},
{os: ubuntu-latest, python-version: "3.10"},
]
env:
COMPILER_CACHE_VERSION: 1
COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache
CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache
CCACHE_BASEDIR: ${{ github.workspace }}
# For faster builds in PRs, skip all but the latest Python versions.
PULL_REQUEST_CIBW_BUILD: cp39-{manylinux}*
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down Expand Up @@ -64,18 +65,54 @@ jobs:
libunwind-dev \
xvfb

- name: Set up Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python-version }}

- name: Install Python dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install -r requirements.txt # If you have a requirements file

- name: Build
run: |
python -m pip install -v .
run: python -m pip install -v .

- name: Run Python tests
run: python -c "import limap; print(limap.__version__)"

- name: Build wheels
run: |
python -c "import limap; print(limap.__version__)"
python -m pip install wheel
python setup.py bdist_wheel
env:
CIBW_ARCHS_MACOS: ${{ matrix.config.arch }}

- name: Upload wheel files as artifacts
uses: actions/upload-artifact@v4
with:
name: limap-${{ matrix.config.os }}-${{ matrix.config.arch }}-cp${{ matrix.config.python-version }}
path: dist/*.whl

pypi-publish:
name: Publish wheels to PyPI
needs: build
runs-on: ubuntu-latest
# We publish the wheel to pypi when a new tag is pushed,
# either by creating a new GitHub release or explictly with `git tag`
if: ${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags') }}
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./artifacts/
- name: Move wheels
run: mkdir ./wheelhouse && mv ./artifacts/**/*.whl ./wheelhouse/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ./wheelhouse/
12 changes: 0 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
[submodule "third-party/pybind11"]
path = third-party/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "third-party/Hierarchical-Localization"]
path = third-party/Hierarchical-Localization
url = https://github.com/cvg/Hierarchical-Localization.git
[submodule "third-party/RansacLib"]
path = third-party/RansacLib
url = https://github.com/B1ueber2y/RansacLib.git
branch = header-only
[submodule "third-party/HighFive"]
path = third-party/HighFive
url = https://github.com/B1ueber2y/HighFive.git
[submodule "third-party/pytlsd"]
path = third-party/pytlsd
url = https://github.com/iago-suarez/pytlsd.git
[submodule "third-party/DeepLSD"]
path = third-party/DeepLSD
url = https://github.com/cvg/DeepLSD.git
[submodule "third-party/GlueStick"]
path = third-party/GlueStick
url = https://github.com/cvg/GlueStick.git
[submodule "third-party/libigl"]
path = third-party/libigl
url = https://github.com/libigl/libigl.git
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ In this project, we provide interfaces for various geometric operations on 2D/3D
## Installation

**Install the dependencies as follows:**
* Python 3.8/9/10
* CMake >= 3.17
* All dependencies for third-party: COLMAP (will be installed with FetchContent). From [[official guide](https://colmap.github.io/install.html)]
* The following dependencies (many of which are for the third-party COLMAP from its [[official guide](https://colmap.github.io/install.html)]):
```bash
sudo apt-get install \
git \
Expand All @@ -43,23 +44,13 @@ sudo apt-get install \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev \
libceres-dev
```
* HDF5
```bash
sudo apt-get install libhdf5-dev
```
* Python >= 3.9 + required packages
```bash
git submodule update --init --recursive

# Refer to https://pytorch.org/get-started/previous-versions/ to install pytorch compatible with your CUDA
python -m pip install torch==1.12.0 torchvision==0.13.0
python -m pip install -r requirements.txt
libceres-dev \
libhdf5-dev
```

To install the LIMAP Python package:
```
git submodule update --init --recursive
python -m pip install -Ive .
```
To double check if the package is successfully installed:
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pycolmap
ruff==0.6.7
clang-format==19.1.0

./third-party/pytlsd
./third-party/Hierarchical-Localization
./third-party/DeepLSD
./third-party/GlueStick
pytlsd @ git+https://github.com/iago-suarez/pytlsd.git@37ac583
hloc @ git+https://github.com/cvg/Hierarchical-Localization.git@abb2520
deeplsd @ git+https://github.com/cvg/DeepLSD.git@88c589d
gluestick @ git+https://github.com/cvg/GlueStick.git@0f28efd
27 changes: 25 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
import sys

from setuptools import Extension, setup
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext

# Cores used for building the project
Expand Down Expand Up @@ -62,17 +62,40 @@ def build_extension(self, ext):
)


# Read requirements from requirements.txt
def parse_requirements_for_limap(filename):
requirements = []
with open(filename) as f:
requirements = [
line.strip()
for line in f
if line.strip()
and not line.startswith("#")
and not line.startswith(".")
]
return requirements


# The information here can also be placed in setup.cfg - better separation of
# logic and declaration, and simpler if you include description/version in
# one file.
setup(
name="limap",
version="1.0.0",
author="B1ueber2y",
packages=find_packages(),
python_requires=">=3.8, < 3.11",
install_requires=parse_requirements_for_limap("requirements.txt"),
author="Shaohui Liu",
author_email="[email protected]",
description="A toolbox for mapping and localization with line features",
long_description="",
ext_modules=[CMakeExtension("_limap")],
cmdclass={"build_ext": CMakeBuild},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
],
)
1 change: 0 additions & 1 deletion third-party/DeepLSD
Submodule DeepLSD deleted from 88c589
1 change: 0 additions & 1 deletion third-party/GlueStick
Submodule GlueStick deleted from 0a6a1a
1 change: 0 additions & 1 deletion third-party/Hierarchical-Localization
Submodule Hierarchical-Localization deleted from abb252
1 change: 0 additions & 1 deletion third-party/pytlsd
Submodule pytlsd deleted from 37ac58