Skip to content

Commit aedba08

Browse files
committed
Modify config to expect the new project layout
1 parent 38ea63a commit aedba08

File tree

119 files changed

+33
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+33
-23
lines changed

MANIFEST.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ recursive-include docs *.sh
1818
recursive-include docs *.tiff
1919
recursive-include docs *.txt
2020
recursive-include docs Makefile
21-
recursive-include future *.au
22-
recursive-include future *.gif
23-
recursive-include future *.pem
24-
recursive-include future *.py
25-
recursive-include future *.txt
21+
recursive-include src *.py
22+
recursive-include src *.pem
23+
recursive-include tests *.au
24+
recursive-include tests *.gif
25+
recursive-include tests *.py
26+
recursive-include tests *.txt
2627

discover_tests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
import unittest
99

1010
if not hasattr(unittest.defaultTestLoader, 'discover'):
11-
import unittest2 as unittest
11+
try:
12+
import unittest2 as unittest
13+
except ImportError:
14+
raise ImportError('The unittest2 module is required to run tests on Python 2.6')
1215

1316
def additional_tests():
1417
setup_file = sys.modules['__main__'].__file__
1518
setup_dir = os.path.abspath(os.path.dirname(setup_file))
16-
testsuite = unittest.defaultTestLoader.discover(setup_dir)
19+
test_dir = os.path.join(setup_dir, 'tests')
20+
test_suite = unittest.defaultTestLoader.discover(test_dir)
1721
blacklist = []
1822
if '/home/travis' in __file__:
1923
# Skip some tests that fail on travis-ci
2024
blacklist.append('test_command')
21-
return exclude_tests(testsuite, blacklist)
25+
return exclude_tests(test_suite, blacklist)
2226

2327

2428
class SkipCase(unittest.TestCase):

src/futurize.py renamed to futurize.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
futurize.py
44
===========
55
6-
Like Armin Ronacher's ``modernize.py``, but using the ``future`` package rather than a direct dependency on ``six``'.
6+
This script is only used by the unit tests. Another script called
7+
"futurize" is created automatically (without the .py extension) by
8+
setuptools.
79
8-
futurize.py attempts to turn Py2 code into valid, clean Py3 code that is also
9-
compatible with Py2 when using the ``future`` package.
10+
futurize.py attempts to turn Py2 code into valid, clean Py3 code that is
11+
also compatible with Py2 when using the ``future`` package.
1012
1113
1214
Licensing

src/pasteurize.py renamed to pasteurize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
pasteurize.py
44
=============
55
6+
This script is only used by the unit tests. Another script called "pasteurize"
7+
is created automatically (without the .py extension) by setuptools.
8+
69
pasteurize.py attempts to turn Py3 code into relatively clean Py3 code that is
710
also compatible with Py2 when using the ``future`` package.
811

setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
#!/usr/bin/env python
22

3+
from __future__ import absolute_import
4+
35
import os
46
import os.path
57
import sys
68

7-
import future
8-
from future.standard_library import exclude_local_folder_imports
9-
109

11-
with exclude_local_folder_imports('configparser', 'reprlib'):
12-
try:
13-
from setuptools import setup
14-
except ImportError:
15-
from distutils.core import setup
10+
try:
11+
from setuptools import setup
12+
except ImportError:
13+
from distutils.core import setup
1614

1715

1816
if sys.argv[-1] == 'publish':
@@ -41,14 +39,14 @@
4139
"future.moves.tkinter",
4240
"future.moves.urllib",
4341
"future.moves.xmlrpc",
44-
"future.tests",
42+
"future.tests", # for future.tests.base
4543
# "future.tests.test_email",
4644
"future.utils",
4745
"past",
4846
"past.builtins",
4947
"past.types",
5048
"past.utils",
51-
"past.tests",
49+
# "past.tests",
5250
"past.translation",
5351
"libfuturize",
5452
"libfuturize.fixes",
@@ -84,16 +82,18 @@
8482
'check_rst.sh',
8583
'TESTING.txt',
8684
],
85+
'tests': ['*.py'],
8786
}
8887

8988
REQUIRES = []
9089
TEST_REQUIRES = []
9190
if sys.version_info[:2] == (2, 6):
9291
REQUIRES += ['importlib', 'argparse']
9392
TEST_REQUIRES += ['unittest2']
94-
VERSION = future.__version__
93+
import src.future
94+
VERSION = src.future.__version__
9595
DESCRIPTION = "Clean single-source support for Python 3 and 2"
96-
LONG_DESC = future.__doc__
96+
LONG_DESC = src.future.__doc__
9797
AUTHOR = "Ed Schofield"
9898
AUTHOR_EMAIL = "ed@pythoncharmers.com"
9999
URL="https://python-future.org"

tests/future/disabled/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.

src/future/tests/disabled/disabled_test_urllib2_localnet.py renamed to tests/future/disabled/disabled_test_urllib2_localnet.py

File renamed without changes.

0 commit comments

Comments
 (0)