Skip to content

Commit

Permalink
Clean up warnings in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Jan 16, 2024
1 parent 153ce40 commit 3e02e28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/generate_charmap_table.py
Expand Up @@ -14,8 +14,8 @@
import tcod.tileset


def get_charmaps() -> Iterator[str]:
"""Return an iterator of the current character maps from tcod.tilest."""
def get_character_maps() -> Iterator[str]:
"""Return an iterator of the current character maps from tcod.tileset."""
for name in dir(tcod.tileset):
if name.startswith("CHARMAP_"):
yield name[len("CHARMAP_") :].lower()
Expand Down Expand Up @@ -60,7 +60,7 @@ def main() -> None:
parser.add_argument(
"charmap",
action="store",
choices=list(get_charmaps()),
choices=list(get_character_maps()),
type=str,
help="which character map to generate a table from",
)
Expand Down
8 changes: 3 additions & 5 deletions scripts/tag_release.py
Expand Up @@ -34,11 +34,9 @@ def parse_changelog(args: argparse.Namespace) -> tuple[str, str]:
)
assert match
header, changes, tail = match.groups()
tagged = "\n## [{}] - {}\n{}".format(
args.tag,
datetime.date.today().isoformat(), # Local timezone is fine, probably. # noqa: DTZ011
changes,
)

iso_date = datetime.datetime.now(tz=datetime.timezone.utc).date().isoformat()
tagged = f"\n## [{args.tag}] - {iso_date}\n{changes}"
if args.verbose:
print("--- Tagged section:")
print(tagged)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -39,7 +39,7 @@ def check_sdl_version() -> None:
return
needed_version = "{}.{}.{}".format(*SDL_VERSION_NEEDED)
try:
sdl_version_str = subprocess.check_output(["sdl2-config", "--version"], universal_newlines=True).strip()
sdl_version_str = subprocess.check_output(["sdl2-config", "--version"], universal_newlines=True).strip() # noqa: S603, S607
except FileNotFoundError as exc:
msg = (
f"libsdl2-dev or equivalent must be installed on your system and must be at least version {needed_version}."
Expand Down

0 comments on commit 3e02e28

Please sign in to comment.