adventofcode 25.10__tar.gz → 25.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ repos:
10
10
  - id: check-added-large-files
11
11
  - repo: https://github.com/astral-sh/ruff-pre-commit
12
12
  # Ruff version.
13
- rev: v0.14.7
13
+ rev: v0.14.8
14
14
  hooks:
15
15
  - id: ruff
16
16
  - id: ruff-format
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Calendar Versioning](https://calver.org).
7
7
 
8
+ ## [25.12]
9
+
10
+ ### Fixed
11
+
12
+ * Fixed running last day with no part 2.
13
+
14
+ ## [25.11]
15
+
16
+ ### Fixed
17
+
18
+ * Variant column not showing for certain file patterns
19
+
8
20
  ## [25.10]
9
21
 
10
22
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: adventofcode
3
- Version: 25.10
3
+ Version: 25.12
4
4
  Summary: Helper utilities for solving Advent of Code puzzles
5
5
  Project-URL: Documentation, https://github.com/anze3db/adventofcode#readme
6
6
  Project-URL: Issues, https://github.com/anze3db/adventofcode/issues
@@ -0,0 +1 @@
1
+ __version__ = "25.12"
@@ -158,12 +158,23 @@ def split_day_name(day_name: str) -> tuple[str, str]:
158
158
  '01' -> ('01', '')
159
159
  '01-alt' -> ('01', 'alt')
160
160
  '03-numpy' -> ('03', 'numpy')
161
+ '03_numpy' -> ('03', 'numpy')
162
+ 'numpy03' -> ('03', 'numpy')
163
+ 'fast03numpy' -> ('03', 'fast-numpy')
161
164
  """
162
- match = re.match(r"(\d\d)(?:-(.+))?", day_name)
165
+ match = re.search(r"(\d\d)", day_name)
163
166
  if match:
164
167
  day_num = match.group(1)
165
- variant = match.group(2) or ""
168
+ # Extract parts before and after the day number
169
+ before = day_name[: match.start()].rstrip("-_")
170
+ after = day_name[match.end() :].lstrip("-_")
171
+ # Combine before and after parts with a hyphen if both exist
172
+ if before and after:
173
+ variant = f"{before}-{after}"
174
+ else:
175
+ variant = before or after
166
176
  return day_num, variant
177
+
167
178
  return day_name, ""
168
179
 
169
180
 
@@ -602,10 +613,11 @@ def run(filepath: Path, benchmark: bool = False) -> None: # noqa: FBT001, FBT00
602
613
  match = re.match(r"(\d\d)", filepath.stem)
603
614
  if not match:
604
615
  return
616
+ day = int(match.group(1))
605
617
  aoc = AoC(
606
618
  part_1=module.part1,
607
619
  part_2=module.part2,
608
- day=int(match.group(1)),
620
+ day=day,
609
621
  year=AOC_YEAR,
610
622
  )
611
623
  if hasattr(module, "part1_asserts"):
@@ -618,6 +630,9 @@ def run(filepath: Path, benchmark: bool = False) -> None: # noqa: FBT001, FBT00
618
630
  aoc.submit_p1_benchmark()
619
631
  else:
620
632
  aoc.submit_p1()
633
+ if (AOC_YEAR < 2025 and day == 25) or (AOC_YEAR >= 2025 and day == 12):
634
+ console.log("[green]No part 2 for Day 25 ⭐[/green]\n")
635
+ return
621
636
  if hasattr(module, "part2_asserts"):
622
637
  for test_input, expected in module.part2_asserts:
623
638
  aoc.assert_p2(test_input, expected)
@@ -0,0 +1,28 @@
1
+ import pytest
2
+
3
+ from src.adventofcode.cli import split_day_name
4
+
5
+
6
+ def test_version():
7
+ from src.adventofcode.__about__ import __version__ # noqa: PLC0415
8
+
9
+ assert __version__
10
+
11
+
12
+ @pytest.mark.parametrize(
13
+ ("day_name", "expected"),
14
+ [
15
+ ("01", ("01", "")),
16
+ ("01-alt", ("01", "alt")),
17
+ ("03-numpy", ("03", "numpy")),
18
+ ("03_numpy", ("03", "numpy")),
19
+ ("fast-03", ("03", "fast")),
20
+ ("maybe-03-fast", ("03", "maybe-fast")),
21
+ ("fast03", ("03", "fast")),
22
+ ("maybe03fast", ("03", "maybe-fast")),
23
+ ("maybe_03_fast", ("03", "maybe-fast")),
24
+ ("numpy03", ("03", "numpy")),
25
+ ],
26
+ )
27
+ def test_split_day_name(day_name: str, expected: tuple[str, str]):
28
+ assert split_day_name(day_name) == expected
@@ -1 +0,0 @@
1
- __version__ = "25.10"
@@ -1,4 +0,0 @@
1
- def test_version():
2
- from src.adventofcode.__about__ import __version__ # noqa: PLC0415
3
-
4
- assert __version__
File without changes
File without changes
File without changes