Skip to content

Commit ff41595

Browse files
T-256T-256
T-256
authored and
T-256
committed
correctly include scripts
1 parent 5cf7d9a commit ff41595

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ omit = [
101101
]
102102
include = [
103103
"httpcore/*",
104-
"scripts/*",
105104
"tests/*",
106105
]
107106

scripts/check

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export PREFIX=""
44
if [ -d 'venv' ] ; then
55
export PREFIX="venv/bin/"
66
fi
7-
export SOURCE_FILES="httpcore tests"
7+
export SOURCE_FILES="httpcore scripts tests"
88

99
set -x
1010

scripts/lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export PREFIX=""
44
if [ -d 'venv' ] ; then
55
export PREFIX="venv/bin/"
66
fi
7-
export SOURCE_FILES="httpcore tests"
7+
export SOURCE_FILES="httpcore scripts tests"
88

99
set -x
1010

scripts/unasync.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
from pprint import pprint
66

77
SUBS = [
8-
('from .._backends.auto import AutoBackend', 'from .._backends.sync import SyncBackend'),
8+
(
9+
"from .._backends.auto import AutoBackend",
10+
"from .._backends.sync import SyncBackend",
11+
),
912
("import trio as concurrency", "from tests import concurrency"),
1013
("AsyncIterator", "Iterator"),
1114
("Async([A-Z][A-Za-z0-9_]*)", r"\2"),
@@ -32,7 +35,7 @@
3235
USED_SUBS = set()
3336

3437

35-
def unasync_line(line):
38+
def unasync_line(line: str) -> str:
3639
for index, (regex, repl) in enumerate(COMPILED_SUBS):
3740
old_line = line
3841
line = re.sub(regex, repl, line)
@@ -41,15 +44,15 @@ def unasync_line(line):
4144
return line
4245

4346

44-
def unasync_file(in_path, out_path):
47+
def unasync_file(in_path: str, out_path: str) -> None:
4548
with open(in_path, "r") as in_file:
4649
with open(out_path, "w", newline="") as out_file:
4750
for line in in_file.readlines():
4851
line = unasync_line(line)
4952
out_file.write(line)
5053

5154

52-
def unasync_file_check(in_path, out_path):
55+
def unasync_file_check(in_path: str, out_path: str) -> None:
5356
with open(in_path, "r") as in_file:
5457
with open(out_path, "r") as out_file:
5558
for in_line, out_line in zip(in_file.readlines(), out_file.readlines()):
@@ -62,7 +65,7 @@ def unasync_file_check(in_path, out_path):
6265
sys.exit(1)
6366

6467

65-
def unasync_dir(in_dir, out_dir, check_only=False):
68+
def unasync_dir(in_dir: str, out_dir: str, check_only: bool = False) -> None:
6669
for dirpath, dirnames, filenames in os.walk(in_dir):
6770
for filename in filenames:
6871
if not filename.endswith(".py"):
@@ -77,7 +80,7 @@ def unasync_dir(in_dir, out_dir, check_only=False):
7780
unasync_file(in_path, out_path)
7881

7982

80-
def main():
83+
def main() -> None:
8184
check_only = "--check" in sys.argv
8285
unasync_dir("httpcore/_async", "httpcore/_sync", check_only=check_only)
8386
unasync_dir("tests/_async", "tests/_sync", check_only=check_only)

0 commit comments

Comments
 (0)