Skip to content

Commit d1dc70b

Browse files
committed
fix: correct reference to the solutions module
1 parent 5806591 commit d1dc70b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

aoc/utils/initalise.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def initialise(
4242
Note:
4343
- Expects solution modules to be named `dayXX.py` where `XX` is zero-padded day number
4444
- Expects each solution module to have a `Solution` class
45-
- Solution modules should be in the `solutions` package
45+
- Solution modules should be in the `{year}.solutions` package
4646
- Parameters match those expected by SolutionBase.__init__
4747
"""
48-
module_name = f"solutions.day{day:02d}"
48+
module_name = f"{year}.solutions.day{day:02d}"
4949
solution_module = import_module(module_name)
5050

51-
solution_class: type[SolutionBase] = solution_module.Solution
51+
solution_class = solution_module.Solution
5252

5353
if not issubclass(solution_class, SolutionBase):
5454
err_msg = f"Solution class for day {day} must inherit from SolutionBase"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "aoc2024"
2+
name = "aoc"
33
version = "0.1.0"
44
description = "Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as interview prep, company training, university coursework, practice problems, a speed contest, or to challenge each other."
55
authors = [{ name = "mallory.brickerd", email = "[email protected]" }]
@@ -10,7 +10,6 @@ dependencies = [
1010
"requests<3.0.0,>=2.32.3",
1111
"bs4<1.0.0,>=0.0.2",
1212
"networkx<4.0.0,>=3.4.2",
13-
"pre-commit>=4.1.0",
1413
]
1514

1615
[dependency-groups]
@@ -21,6 +20,7 @@ dev = [
2120
"types-beautifulsoup4>=4.12.0,<5.0.0",
2221
"types-networkx>=3.4.2",
2322
"pytest>=8.3.4,<9",
23+
"pre-commit>=4.5.0",
2424
]
2525

2626
[tool.hatch.build.targets.sdist]

templates/tests/sample.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from aoc.models.tester import TestSolutionUtility
22

33
def test_day{day:02d}_part1():
44
TestSolutionUtility.run_test(
5+
year={year},
56
day={day},
67
is_raw=False,
78
part_num=1,
@@ -10,6 +11,7 @@ def test_day{day:02d}_part1():
1011

1112
def test_day{day:02d}_part2():
1213
TestSolutionUtility.run_test(
14+
year={year},
1315
day={day},
1416
is_raw=False,
1517
part_num=2,

0 commit comments

Comments
 (0)