Permalink
Browse files

Rearrange files to make a proper package.

Based loosely on a patch by Christopher Hoover.
  • Loading branch information...
DanielStutzbach committed Dec 7, 2012
1 parent 5c57bfc commit 1659b6aabcbdb55bd8b97ec112a6857c96837c4c
View
@@ -1,15 +1,15 @@
-include _blist.c
-include blist.py
-include _sorteddict.py
-include _sortedlist.py
-include _btuple.py
+include blist/_blist.c
+include blist/__init__.py
+include blist/_sorteddict.py
+include blist/_sortedlist.py
+include blist/_btuple.py
include setup.py
include test_blist.py
-include test/*.py
+include blist/test/*.py
include README.rst
include LICENSE
include prototype/blist.py
include distribute_setup.py
include speed_test.py
include blist.rst
-include blist.h
+include blist/blist.h
View
@@ -1,8 +0,0 @@
-from _blist import *
-import collections
-if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+
- from _sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset
- from _sorteddict import sorteddict
- from _btuple import btuple
- collections.MutableSequence.register(blist)
-del collections
View
@@ -0,0 +1,8 @@
+from blist._blist import *
+import collections
+if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+
+ from blist._sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset
+ from blist._sorteddict import sorteddict
+ from blist._btuple import btuple
+ collections.MutableSequence.register(blist)
+del collections
@@ -7217,7 +7217,7 @@ PyTypeObject PyBList_Type = {
#ifdef BLIST_IN_PYTHON
"__internal_blist",
#else
- "_blist.__internal_blist",
+ "blist._blist.__internal_blist",
#endif
sizeof(PyBList),
0,
@@ -7264,7 +7264,7 @@ PyTypeObject PyRootBList_Type = {
#ifdef BLIST_IN_PYTHON
"list",
#else
- "_blist.blist",
+ "blist.blist",
#endif
sizeof(PyBListRoot),
0,
@@ -1,4 +1,4 @@
-from _blist import blist
+from blist._blist import blist
from ctypes import c_int
import collections
class btuple(collections.Sequence):
@@ -1,6 +1,6 @@
-from _sortedlist import sortedset
+from blist._sortedlist import sortedset
import collections, sys
-from _blist import blist
+from blist._blist import blist
class missingdict(dict):
def __missing__(self, key):
@@ -1,4 +1,4 @@
-from _blist import blist
+from blist._blist import blist
import collections, bisect, weakref, operator, itertools, sys, threading
try: # pragma: no cover
izip = itertools.izip
File renamed without changes.
File renamed without changes.
@@ -1,14 +1,12 @@
# Based on Python's tuple_tests.py, licensed under the Python License
# Agreement
-import unittest
import sys
-from . import seq_tests
-import blist
import random
import gc
-from _btuple import btuple
-import gc
+from blist import btuple
+from blist.test import unittest
+from blist.test import seq_tests
class bTupleTest(seq_tests.CommonTest):
type2test = btuple
@@ -8,8 +8,9 @@
import sys
import os
-from . import unittest
-from test import test_support, seq_tests
+from blist.test import unittest
+from blist.test import test_support
+from blist.test import seq_tests
from decimal import Decimal
@@ -1,8 +1,9 @@
# This file taken from Python, licensed under the Python License Agreement
# tests common to dict and UserDict
-import unittest, sys
+import sys
import collections
+from blist.test import unittest
try:
from collections import UserDict # Python 3
except ImportError:
@@ -5,8 +5,8 @@
Tests common to tuple, list and UserList.UserList
"""
-from . import unittest
-from test import test_support
+from blist.test import test_support
+from blist.test import unittest
import sys
# Various iterables
@@ -1,5 +1,5 @@
-from . import mapping_tests
import blist
+from blist.test import mapping_tests
def CmpToKey(mycmp):
'Convert a cmp= function into a key= function'
@@ -1,11 +1,12 @@
# This file based loosely on Python's list_tests.py.
-import unittest, collections, operator
import sys
-from . import list_tests, seq_tests
-import blist
-import random
+import collections, operator
import gc
+import random
+import blist
+from blist.test import unittest
+from blist.test import list_tests, seq_tests
def CmpToKey(mycmp):
'Convert a cmp= function into a key= function'
@@ -1,6 +1,6 @@
from __future__ import print_function
-from . import unittest
-from test import test_support, list_tests
+from blist.test import unittest
+from blist.test import test_support, list_tests
class ListTest(list_tests.CommonTest):
type2test = list
@@ -2,8 +2,6 @@
from __future__ import print_function
-import unittest
-from . import test_support as support
import gc
import weakref
import operator
@@ -14,6 +12,9 @@
import warnings
import collections
+from blist.test import unittest
+from blist.test import test_support as support
+
from blist import sortedset as set
class PassThru(Exception):
@@ -3,7 +3,7 @@
from __future__ import print_function
"""Supporting definitions for the Python regression tests."""
-if __name__ != 'test.test_support':
+if __name__ != 'blist.test.test_support':
raise ImportError('test_support must be imported from the test package')
import sys
File renamed without changes.
View
@@ -22,11 +22,11 @@
url='http://stutzbachenterprises.com/blist/',
license = "BSD",
keywords = "blist list b+tree btree fast copy-on-write sparse array sortedlist sorted sortedset weak weaksortedlist weaksortedset sorteddict btuple",
- ext_modules=[Extension('_blist', ['_blist.c'],
+ ext_modules=[Extension('blist._blist', ['blist/_blist.c'],
define_macros=define_macros,
)],
+ packages=['blist'],
provides = ['blist'],
- py_modules=['blist', '_sortedlist', '_sorteddict', '_btuple'],
test_suite = "test_blist.test_suite",
zip_safe = False, # zips are broken on cygwin for C extension modules
classifiers = [
View
@@ -37,10 +37,11 @@
import os
import unittest, operator
-import blist, pickle, _blist
+import blist, pickle
+from blist import _blist
#BList = list
-from test import test_support, list_tests, sortedlist_tests, btuple_tests
-from test import sorteddict_tests, test_set
+from blist.test import test_support, list_tests, sortedlist_tests, btuple_tests
+from blist.test import sorteddict_tests, test_set
limit = _blist._limit
n = 512//8 * limit

0 comments on commit 1659b6a

Please sign in to comment.