Skip to content

Commit

Permalink
wrestling w numpy build. about to remove dependency
Browse files Browse the repository at this point in the history
Former-commit-id: 7acc2bf
  • Loading branch information
brooksandrew committed Sep 10, 2017
1 parent f6fde45 commit dc24623
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ ENV/

# Mac
.DS_Store

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include postman_problems/examples/sleeping_giant/edgelist_sleeping_giant.csv
include postman_problems/examples/sleeping_giant/nodelist_sleeping_giant.csv
include postman_problems/examples/seven_bridges/edgelist_seven_bridges.csv
include postman_problems/examples/seven_bridges/nodelist_seven_bridges.csv
27 changes: 22 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
import os
from setuptools import setup

# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
from setuptools.command.build_ext import build_ext as _build_ext


def read(fname):
"""
Utility function to read the README file.
Used for the long_description. It's nice, because now 1) we have a top level
README file and 2) it's easier to type in the README file than to put a raw
string in below ...
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()


class build_ext(_build_ext):
"""
Hack needed to build numpy properly
See: https://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py
"""
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())

setup(
name='postman_problems',
version='0.1dev',
Expand All @@ -35,6 +50,8 @@ def read(fname):
'console_scripts': ['chinese_postman=postman_problems.chinese_postman:main']
},
python_requires='>=3.5',
cmdclass={'build_ext':build_ext},
setup_requires='numpy',
install_requires=[
'pandas',
'networkx',
Expand Down

0 comments on commit dc24623

Please sign in to comment.