Skip to content

Commit

Permalink
Fix sdist for upcoming release
Browse files Browse the repository at this point in the history
  • Loading branch information
markflorisson committed Apr 11, 2013
1 parent 2a6baaa commit 17b9be9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 23 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include *.md *.py *.txt CHANGE_LOG AUTHORS
recursive-include docs *.ipynb *.txt *.py Makefile *.rst
recursive-include deps *
prune docs/_build
prune docs/gh-pages
71 changes: 48 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import print_function, division, absolute_import
import os
import sys
import shutil
import subprocess
from fnmatch import fnmatchcase
from distutils.util import convert_path
Expand All @@ -24,12 +25,15 @@

import versioneer

#------------------------------------------------------------------------
# Setup constants and arguments
#------------------------------------------------------------------------

versioneer.versionfile_source = 'numba/_version.py'
versioneer.versionfile_build = 'numba/_version.py'
versioneer.tag_prefix = ''
versioneer.parentdir_prefix = 'numba-'


cmdclass = versioneer.get_cmdclass()
cmdclass['build_ext'] = build_ext

Expand All @@ -38,6 +42,23 @@
}


numba_root = os.path.dirname(os.path.abspath(__file__))
deps_root = os.path.join(numba_root, 'deps')
pyext_root = os.path.join(deps_root, 'pyextensibletype')
pyext_dst = os.path.join(numba_root, "numba", "pyextensibletype")

def get_include():
"""Use numba.get_include() instead (make numba importable without
building it first)
"""
return os.path.join(numba_root, "numba", "include")

numba_include_dir = get_include()

#------------------------------------------------------------------------
# Package finding
#------------------------------------------------------------------------

def find_packages(where='.', exclude=()):
out = []
stack=[(convert_path(where), '')]
Expand All @@ -58,6 +79,9 @@ def find_packages(where='.', exclude=()):
out = [item for item in out if not fnmatchcase(item, pat)]
return out

#------------------------------------------------------------------------
# 2to3
#------------------------------------------------------------------------

def run_2to3():
import lib2to3.refactor
Expand All @@ -75,28 +99,15 @@ def run_2to3():
# Distribute options
# setup_args["use_2to3"] = True

if sys.version_info[0] >= 3:
run_2to3()

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

def get_include():
"""Use numba.get_include() instead (make numba importable without
building it first)
"""
return os.path.join(numba_root, "numba", "include")

def register_pyextensibletype():
import shutil

root = os.path.dirname(os.path.abspath(__file__))
deps_root = os.path.join(root, 'deps')
pyext_root = os.path.join(deps_root, 'pyextensibletype')
pyext_dst = os.path.join(root, "numba", "pyextensibletype")
#------------------------------------------------------------------------
# pyextensibletype
#------------------------------------------------------------------------

def cleanup_pyextensibletype():
if os.path.exists(pyext_dst):
shutil.rmtree(pyext_dst)

def register_pyextensibletype():
with open(os.path.join(deps_root, '__init__.py'), 'w'):
pass
with open(os.path.join(pyext_root, '__init__.py'), 'w'):
Expand All @@ -109,12 +120,26 @@ def register_pyextensibletype():

return exts

# TODO: Finish and release pyextensibletype
extensibletype_extensions = register_pyextensibletype()
#------------------------------------------------------------------------
# Generate code for build
#------------------------------------------------------------------------

numba_include_dir = get_include()
build = set(sys.argv) & set(['build', 'build_ext', 'install'])
cleanup_pyextensibletype()

if build:
gen_type_conversion.run()
# TODO: Finish and release pyextensibletype
extensibletype_extensions = register_pyextensibletype()
else:
extensibletype_extensions = []

if sys.version_info[0] >= 3:
run_2to3()

gen_type_conversion.run()
#------------------------------------------------------------------------
# setup
#------------------------------------------------------------------------

setup(
name="numba",
Expand Down

0 comments on commit 17b9be9

Please sign in to comment.