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

Fix/python setup #308

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ build
.zip
.avi

# Python related
*/__pycache__
*.pyc

venv
.eggs/
dist/
pysurvive.egg-info/
pysurvive.egg-info/
_skbuild/
7 changes: 0 additions & 7 deletions bindings/python/Makefile

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
requires = [
"setuptools>=42",
"scikit-build>=0.13",
"cmake>=3.18",
"ninja"
]
build-backend = "setuptools.build_meta"
35 changes: 19 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
import platform
from setuptools import dist, find_packages
dist.Distribution().fetch_build_eggs(['wheel', 'cmake_setuptools'])

dist.Distribution().fetch_build_eggs(['cmake_setuptools', 'scikit-build'])

from skbuild import setup
import os
import platform
import subprocess

from skbuild import setup

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
long_description = f.read()


version = subprocess.check_output(["git", "describe", "--tags", "--long"]).strip().decode('utf-8').replace("-", ".")[1:]
version = subprocess.check_output(["git", "describe", "--tags", "--long"])
version = version.strip().decode('utf-8').replace("-", ".")[1:]
version = version[:version.rfind("g")-1]

cmake_args=['-DPYTHON_GENERATED_DIR="'+ os.path.dirname(os.path.abspath(__file__))+'/bindings/python/pysurvive/"',
"-DDOWNLOAD_EIGEN=ON",
"-DUSE_EIGEN=ON",
"-DBUILD_APPLICATIONS=OFF",
"-DLIB_INSTALL_DIR=bindings/python/pysurvive/"]
pysurvive_path = this_directory + '/bindings/python/pysurvive/'
cmake_args = ['-DPYTHON_GENERATED_DIR="' + pysurvive_path + '"',
"-DDOWNLOAD_EIGEN=ON",
"-DUSE_EIGEN=ON",
"-DBUILD_APPLICATIONS=OFF",
"-DLIB_INSTALL_DIR=bindings/python/pysurvive/"]

if platform.system() != 'Windows':
cmake_args.append('-DUSE_EIGEN=ON')
cmake_args.append('-DUSE_EIGEN=ON')

description = """Libsurvive is a set of tools and libraries that enable 6 DoF tracking
on lighthouse and vive based systems that is completely open source and can run on
any device. It currently supports both SteamVR 1.0 and SteamVR 2.0 generation of
devices and should support any tracked object commercially available."""

setup(name='pysurvive',
version=version,
long_description=long_description,
long_description_content_type='text/markdown',
description='Libsurvive is a set of tools and libraries that enable 6 dof tracking on lighthouse and vive based systems that is completely open source and can run on any device. It currently supports both SteamVR 1.0 and SteamVR 2.0 generation of devices and should support any tracked object commercially available.',
description=description,
url='https://github.com/cntools/libsurvive',
packages=['pysurvive'],
package_dir={'pysurvive': 'bindings/python/pysurvive'},
Expand Down