Skip to content

Commit

Permalink
Allow installing without reqs preinstalled
Browse files Browse the repository at this point in the history
With these changes, setuptools should properly install numpy
and cython as part of the setup process and then compile the
.pyx file.

Also added two dependencies that weren't previously listed:
matplotlib and scipy.
  • Loading branch information
tbekolay authored and studywolf committed Jun 29, 2017
1 parent c1114f1 commit e92f623
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 43 deletions.
15 changes: 12 additions & 3 deletions MANIFEST.in
@@ -1,3 +1,12 @@
include *.ttt
graft arm_files
graft vrep_files
include *.rst
include *.txt
recursive-include abr_control *.cpp
recursive-include abr_control *.dll
recursive-include abr_control *.dylib
recursive-include abr_control *.h
recursive-include abr_control *.msim
recursive-include abr_control *.py
recursive-include abr_control *.pyx
recursive-include abr_control *.so
recursive-include abr_control *.ttt
recursive-include examples *.py
20 changes: 11 additions & 9 deletions README.rst
Expand Up @@ -7,23 +7,22 @@ ABR_Control: Robotic arm control in Python
Installation
============

The ABR_Control library depends on NumPy, SymPy, CloudPickle, and Cython,
and we recommend that you install these libraries before ABR_Control.
If you're not sure how to do this, we recommend using
The ABR_Control library depends on NumPy, SymPy, SciPy, CloudPickle, and
Cython, and we recommend that you install these libraries before
ABR_Control. If you're not sure how to do this, we recommend using
`Anaconda <https://store.continuum.io/cshop/anaconda/>`_.
Note that installing in a clean environment will require compiling of the
dependent libraries, and will take a few minutes.

To install required libraries::

pip install -r requirements.txt
To install ABR_Control::

pip install abr_control

If you'd like to install ABR_Control from source,
clone this repository and run::

python setup.py develop build_ext -i
python setupy.py install
python setup.py develop

ABR_Control is tested to work on Python 3.4+.

Expand Down Expand Up @@ -93,7 +92,10 @@ the different interfaces and controllers.

By default all of the PyGame examples run with the three-link MapleSim arm.
You can also run the examples using the two-link Python arm by changing the
import statement at the top of the example scripts.
import statement at the top of the example scripts. Note that to run the PyGame
examples, you will also need to install Pygame::

pip install pygame

To run the VREP examples, have VREP version > 3.2 open, and load the .ttt
file from the corresponding `abr_control/arms/` folder for the arm of interest.
Expand Down
Empty file.
12 changes: 0 additions & 12 deletions abr_control/arms/threelink/arm_files/setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion abr_control/version.py
Expand Up @@ -3,4 +3,4 @@
dev = True

version = "{v}{dev}".format(v='.'.join(str(v) for v in version_info),
dev='.dev' if dev else '')
dev='.dev0' if dev else '')
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

38 changes: 25 additions & 13 deletions setup.py
@@ -1,12 +1,18 @@
# from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import io
import runpy
import numpy
import os

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


class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())


def read(*filenames, **kwargs):
Expand All @@ -20,9 +26,9 @@ def read(*filenames, **kwargs):


root = os.path.dirname(os.path.realpath(__file__))
version = runpy.run_path(os.path.join(root, 'abr_control',
'version.py'))['version']
long_description = read('README.rst')
version = runpy.run_path(
os.path.join(root, 'abr_control', 'version.py'))['version']
setup_requires = ["setuptools>=18.0", "cython", "numpy"]

setup(
name="abr_control",
Expand All @@ -32,14 +38,20 @@ def read(*filenames, **kwargs):
packages=find_packages(),
include_package_data=True,
scripts=[],
url="https://github.com/abr/control",
url="https://github.com/abr/abr_control",
license="Free for non-commercial use",
description="A library for controlling and interfacing with robots.",
long_description=long_description,
install_requires=["numpy", "cloudpickle", "cython", "sympy"],
long_description=read('README.rst'),
install_requires=setup_requires + [
"cloudpickle", "sympy", "nengo", "matplotlib", "scipy",
],
setup_requires=setup_requires,
cmdclass={'build_ext': build_ext},
ext_modules=[
Extension("abr_control/arms/threelink/arm_files/py3LinkArm",
Extension(
"abr_control.arms.threelink.arm_files.py3LinkArm",
sources=["abr_control/arms/threelink/arm_files/py3LinkArm.pyx"],
language="c++",
include_dirs=[numpy.get_include()])])
)
],
)

0 comments on commit e92f623

Please sign in to comment.