-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rich added to py deps; day 15 scaffolded
- Loading branch information
1 parent
8766c0f
commit 283f185
Showing
7 changed files
with
117 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,21 @@ version = "2024.12.1" | |
description = "Add your description here" | ||
readme = "README.md" | ||
requires-python = ">=3.13" | ||
dependencies = [ "click>=8.1.7", "httpx>=0.28.1", "toml>=0.10.2",] | ||
dependencies = [ | ||
"click>=8.1.7", | ||
"httpx>=0.28.1", | ||
"rich>=13.9.4", | ||
"toml>=0.10.2", | ||
] | ||
[[project.authors]] | ||
name = "Galen Rice" | ||
email = "[email protected]" | ||
|
||
[dependency-groups] | ||
dev = [ "pytest>=8.3.4",] | ||
dev = ["pytest>=8.3.4"] | ||
|
||
[build-system] | ||
requires = [ "hatchling",] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project.scripts] | ||
|
@@ -32,6 +37,7 @@ day11 = "grice_py_aoc_2024.day11.main:main" | |
day12 = "grice_py_aoc_2024.day12.main:main" | ||
day13 = "grice_py_aoc_2024.day13.main:main" | ||
day14 = "grice_py_aoc_2024.day14.main:main" | ||
day15 = "grice_py_aoc_2024.day15.main:main" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "-ra -q" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from __future__ import annotations | ||
|
||
import time | ||
from pathlib import Path | ||
|
||
DIR = Path(__file__).parent | ||
FILE = DIR.parents[3] / "inputs" / f"{DIR.stem}.txt" | ||
|
||
|
||
def part1(contents: str) -> int: | ||
total = 0 | ||
# TODO part 1 | ||
return total | ||
|
||
|
||
def part2(contents: str) -> int: | ||
total = 0 | ||
# TODO part 2 | ||
return total | ||
|
||
|
||
def main(): | ||
contents = FILE.read_text() | ||
|
||
_start1 = time.perf_counter() | ||
result1 = part1(contents=contents) | ||
_delta1 = time.perf_counter() - _start1 | ||
print(f">> Part 1: {result1} ({_delta1:.6f}s)") | ||
|
||
_start2 = time.perf_counter() | ||
result2 = part2(contents=contents) | ||
_delta2 = time.perf_counter() - _start2 | ||
print(f">> Part 2: {result2} ({_delta2:.6f}s)") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from .main import part1, part2 | ||
|
||
DIR = Path(__file__).parent | ||
TEST_FILE = DIR.parents[3] / "inputs/tests" / f"test_{DIR.stem}.txt" | ||
EXPECTED_PART_1 = 123 # TODO replace! | ||
EXPECTED_PART_2 = 456 # TODO replace! | ||
|
||
|
||
@pytest.mark.skip(reason=f"{DIR.stem} P1 incomplete") | ||
def test_part1(): | ||
contents = TEST_FILE.read_text() | ||
result = part1(contents=contents) | ||
assert result == EXPECTED_PART_1 | ||
|
||
|
||
@pytest.mark.skip(reason=f"{DIR.stem} P2 incomplete") | ||
def test_part2(): | ||
contents = TEST_FILE.read_text() | ||
result = part2(contents=contents) | ||
assert result == EXPECTED_PART_2 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.