Skip to content

Commit e29de8b

Browse files
committed
Fix config for check-unicode and format
1 parent 5391400 commit e29de8b

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ format: $(PYFORMAT) $(ISORT)
8383
$(FILES_TO_FORMAT) | xargs $(TOOL_PYTHON) scripts/enforce_header.py
8484
# isort will sort packages differently depending on whether they're installed
8585
$(FILES_TO_FORMAT) | xargs env -i PATH="$(PATH)" $(ISORT) -p hypothesis -ls -m 2 -w 75 \
86-
-a "from __future__ import absolute_import, print_function, division" \
87-
-rc src tests examples
86+
-a "from __future__ import absolute_import, print_function, division"
8887
$(FILES_TO_FORMAT) | xargs $(PYFORMAT) -i
8988

9089
lint: $(FLAKE8)

scripts/files-to-format.py

-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
from __future__ import division, print_function, absolute_import
1919

2020
import os
21-
import sys
2221

2322
import hypothesistooling as tools
2423

25-
sys.path.append(os.path.dirname(__file__)) # noqa
26-
2724

2825
def should_format_file(path):
2926
if os.path.basename(path) in ('header.py', 'test_lambda_formatting.py'):

scripts/hypothesistooling.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ def tags():
4040

4141
ROOT = subprocess.check_output([
4242
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
43-
SRC = os.path.join(ROOT, 'hypothesis-python', 'src')
4443

45-
assert os.path.exists(SRC)
44+
HYPOTHESIS_PYTHON = os.path.join(ROOT, 'hypothesis-python')
45+
46+
PYTHON_SRC = os.path.join(HYPOTHESIS_PYTHON, 'src')
47+
PYTHON_TESTS = os.path.join(HYPOTHESIS_PYTHON, 'tests')
48+
49+
assert os.path.exists(PYTHON_SRC)
4650

4751

4852
__version__ = None
4953
__version_info__ = None
5054

51-
VERSION_FILE = os.path.join(SRC, 'hypothesis/version.py')
55+
VERSION_FILE = os.path.join(PYTHON_SRC, 'hypothesis/version.py')
5256

5357
with open(VERSION_FILE) as o:
5458
exec(o.read())
@@ -121,7 +125,7 @@ def has_source_changes(version=None):
121125

122126
return subprocess.call([
123127
'git', 'diff', '--no-patch', '--exit-code', point_of_divergence,
124-
'HEAD', '--', SRC,
128+
'HEAD', '--', PYTHON_SRC,
125129
]) != 0
126130

127131

scripts/unicodechecker.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import unicodenazi
2727
from hypothesis import settings, unlimited
2828
from hypothesis.errors import HypothesisDeprecationWarning
29+
from hypothesistooling import PYTHON_TESTS
2930
from hypothesis.configuration import set_hypothesis_home_dir
3031

3132
warnings.filterwarnings('error', category=UnicodeWarning)
@@ -47,9 +48,7 @@
4748
'test_testdecorators',
4849
]
4950

50-
sys.path.append(os.path.join(
51-
os.path.dirname(__file__), '..', 'tests', 'cover',
52-
))
51+
sys.path.append(os.path.join(PYTHON_TESTS, 'cover'))
5352

5453
if __name__ == '__main__':
5554
for t in TESTS:

0 commit comments

Comments
 (0)