Skip to content

Commit 740d57c

Browse files
committed
Reorganize build imports. Add build imports to path.
1 parent 834d12d commit 740d57c

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

build_libtcod.py

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

3-
import os
4-
import sys
5-
63
import glob
4+
import os
5+
import platform
76
import re
8-
from typing import List, Tuple, Any, Dict, Iterable, Iterator, Set
9-
10-
from cffi import FFI # type: ignore
11-
127
import shutil
138
import subprocess
14-
import platform
9+
import sys
1510
import zipfile
16-
17-
import parse_sdl2
11+
from typing import Any, Dict, Iterable, Iterator, List, Set, Tuple
1812

1913
try:
2014
from urllib import urlretrieve # type: ignore
2115
except ImportError:
2216
from urllib.request import urlretrieve
2317

18+
from cffi import FFI # type: ignore
19+
20+
sys.path.append(os.path.dirname(__file__))
21+
22+
import parse_sdl2 # noqa: E402
23+
2424
# The SDL2 version to parse and export symbols from.
2525
SDL2_PARSE_VERSION = os.environ.get("SDL_VERSION", "2.0.5")
2626

@@ -460,8 +460,8 @@ def generate_enums(prefix: str) -> Iterator[str]:
460460

461461
def write_library_constants() -> None:
462462
"""Write libtcod constants into the tcod.constants module."""
463-
from tcod._libtcod import lib, ffi
464463
import tcod.color
464+
from tcod._libtcod import ffi, lib
465465

466466
with open("tcod/constants.py", "w") as f:
467467
all_names = []

parse_sdl2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os.path
2-
import sys
3-
42
import platform
53
import re
4+
import sys
65
from typing import Iterator
76

87
import cffi # type: ignore

0 commit comments

Comments
 (0)