Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

add setup.py file and smoke test

edgarriba981da63a01ea
diff --git a/setup.py b/setup.py
new file mode 100644
index 000000000..b2b4749f6
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,51 @@
+import os
+import io
+import re
+from setuptools import setup, find_packages
+
+
+def read(*names, **kwargs):
+ with io.open(
+ os.path.join(os.path.dirname(__file__), *names),
+ encoding=kwargs.get("encoding", "utf8")
+ ) as fp:
+ return fp.read()
+
+
+def find_version(*file_paths):
+ version_file = read(*file_paths)
+ version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
+ version_file, re.M)
+ if version_match:
+ return version_match.group(1)
+ raise RuntimeError("Unable to find version string.")
+
+
+readme = open('README.rst').read()
+
+
+VERSION = find_version('torchgeometry', '__init__.py')
+
+
+requirements = [
+ 'torch',
+]
+
+
+setup(
+ # Metadata
+ name='torchgeometry',
+ version=VERSION,
+ author='Edgar Riba',
+ author_email='[email protected]',
+ url='https://github.com/arraiy/geometry',
+ description='differential geometric computer vision for torch deep learning',
+ long_description=readme,
+ license='BSD',
+
+ # Package info
+ packages=find_packages(exclude=('test',)),
+
+ zip_safe=True,
+ install_requires=requirements,
+)
diff --git a/test/smoke_test.py b/test/smoke_test.py
new file mode 100644
index 000000000..604d30b8f
--- /dev/null
+++ b/test/smoke_test.py
@@ -0,0 +1,15 @@
+import unittest
+
+import torch
+import torchgeometry
+
+
+class Tester(unittest.TestCase):
+
+ def test_smoke(self):
+ x = torch.rand(1, 2, 3)
+ assert x.shape == (1, 2, 3), x.shape
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/torchgeometry/__init__.py b/torchgeometry/__init__.py
new file mode 100644
index 000000000..b8023d8bc
--- /dev/null
+++ b/torchgeometry/__init__.py
@@ -0,0 +1 @@
+__version__ = '0.0.1'