Skip to content

Commit

Permalink
PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
derohde committed Aug 16, 2021
1 parent a464444 commit 2c7089d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
all: pre install

pre:
git submodule init
git submodule update

install:
python setup.py install --user

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
A fast, scalable and light-weight C++ Fréchet distance library, exposed to python and focused on (k,l)-clustering of polygonal curves.

### NOW USING PYBIND11 INSTEAD OF BOOST!
### NOW AVAILABLE VIA PIP

## Ingredients C++ Backend
`import Fred.backend as fred`
Expand Down Expand Up @@ -105,7 +106,7 @@ Thats it!

### Installation Procedure

- Variant 1: simply run `pip install git+https://github.com/derohde/Fred`
- Variant 1: simply run `pip install Fred-Frechet`
- Variant 2: clone repository and run `make` for installation into userdir

## Test
Expand Down
1 change: 0 additions & 1 deletion pybind11
Submodule pybind11 deleted from 617cb6
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
import platform
import subprocess

from glob import glob
from distutils.version import LooseVersion
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import setuptools

this_dir = os.path.dirname(os.path.abspath(__file__))

class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
def __init__(self, name, sourcedir=this_dir):
Extension.__init__(self, name,
include_dirs=[os.path.join(this_dir, 'include'), os.path.join(this_dir, 'pybind11')],
sources=sorted(glob("src/*.cpp")))
self.sourcedir = os.path.abspath(sourcedir)

class CMakeBuild(build_ext):
Expand Down Expand Up @@ -60,14 +64,17 @@ def build_extension(self, ext):
self.distribution.get_version())
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
subprocess.check_call(['git', 'init'])
subprocess.check_call(['git', 'submodule', 'add', 'https://github.com/pybind/pybind11.git'])
subprocess.check_call(['git', 'submodule', 'update', '--init', '--recursive'])
subprocess.check_call(['cmake', "{}".format(ext.sourcedir)] + cmake_args,
cwd=self.build_temp, env=env)
subprocess.check_call(['cmake', '--build', '.'] + build_args,
cwd=self.build_temp)

setup(
name='Fred-Frechet',
version='1.6',
version='1.7.2',
author='Dennis Rohde',
author_email='[email protected]',
description='Frechet Distance and Clustering Library',
Expand All @@ -78,5 +85,6 @@ def build_extension(self, ext):
ext_modules=[CMakeExtension('backend')],
install_requires=['cvxopt', 'matplotlib'],
cmdclass=dict(build_ext=CMakeBuild),
data_files=[('pybind11', ['.gitmodules'])],
zip_safe=False,
)

0 comments on commit 2c7089d

Please sign in to comment.