adventofcode 25.11__tar.gz → 26.1__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.
@@ -1,30 +1,32 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: adventofcode
3
- Version: 25.11
3
+ Version: 26.1
4
4
  Summary: Helper utilities for solving Advent of Code puzzles
5
- Project-URL: Documentation, https://github.com/anze3db/adventofcode#readme
6
- Project-URL: Issues, https://github.com/anze3db/adventofcode/issues
7
- Project-URL: Source, https://github.com/anze3db/adventofcode
8
- Project-URL: Mastodon, https://fosstodon.org/@anze3db
9
- Project-URL: Twitter, https://twitter.com/anze3db
5
+ Keywords:
6
+ Author: Anže Pečar
10
7
  Author-email: Anže Pečar <anze@pecar.me>
11
8
  License-Expression: MIT
12
- License-File: LICENSE
13
9
  Classifier: Development Status :: 4 - Beta
14
10
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3.10
16
11
  Classifier: Programming Language :: Python :: 3.11
17
12
  Classifier: Programming Language :: Python :: 3.12
18
13
  Classifier: Programming Language :: Python :: 3.13
19
14
  Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
20
16
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
17
  Classifier: Programming Language :: Python :: Implementation :: PyPy
22
- Requires-Python: >=3.10
23
- Requires-Dist: beautifulsoup4
18
+ Requires-Dist: requests
24
19
  Requires-Dist: percache
20
+ Requires-Dist: beautifulsoup4
25
21
  Requires-Dist: python-dotenv
26
- Requires-Dist: requests
27
22
  Requires-Dist: rich
23
+ Requires-Python: >=3.11
24
+ Project-URL: Documentation, https://github.com/anze3db/adventofcode#readme
25
+ Project-URL: Issues, https://github.com/anze3db/adventofcode/issues
26
+ Project-URL: Source, https://github.com/anze3db/adventofcode
27
+ Project-URL: Changelog, https://github.com/anze3db/adventofcode/blob/main/CHANGELOG.md
28
+ Project-URL: Mastodon, https://fosstodon.org/@anze3db
29
+ Project-URL: Twitter, https://twitter.com/anze3db
28
30
  Description-Content-Type: text/markdown
29
31
 
30
32
  # 🎄 adventofcode [![PyPI - Version](https://img.shields.io/pypi/v/adventofcode.svg)](https://pypi.org/project/adventofcode) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/adventofcode.svg)](https://pypi.org/project/adventofcode)
@@ -114,7 +116,6 @@ def part1(inp: str) -> str | int | None:
114
116
 
115
117
  def part2(inp: str) -> str | int | None:
116
118
  return None
117
-
118
119
  ```
119
120
  ## Session cookie
120
121
 
@@ -216,17 +217,17 @@ Alternatively, you can build your own workflow using the lower level AoC class
216
217
  ```python
217
218
  from adventofcode import AoC
218
219
 
219
- aoc = AoC() # defaults to current year and parses the day from the filename (e.g. 01.py will be day 1)
220
+ aoc = AoC() # defaults to current year and parses the day from the filename (e.g. 01.py will be day 1)
220
221
 
221
- aoc.print_p1() # prints the first part of the puzzle
222
- inp = aoc.get_input() # returns the input as a string
222
+ aoc.print_p1() # prints the first part of the puzzle
223
+ inp = aoc.get_input() # returns the input as a string
223
224
  # solve the puzzle here
224
225
  ...
225
- aoc.submit_p1('part 1 answer') # submits the answer to the first part of the puzzle
226
- aoc.print_p2() # prints the second part of the puzzle
226
+ aoc.submit_p1("part 1 answer") # submits the answer to the first part of the puzzle
227
+ aoc.print_p2() # prints the second part of the puzzle
227
228
  # solve the puzzle here
228
229
  ...
229
- aoc.submit_p2('part 2 answer') # submits the answer to the second part of the puzzle
230
+ aoc.submit_p2("part 2 answer") # submits the answer to the second part of the puzzle
230
231
  ```
231
232
 
232
233
  ### Happy solving 🎄
@@ -85,7 +85,6 @@ def part1(inp: str) -> str | int | None:
85
85
 
86
86
  def part2(inp: str) -> str | int | None:
87
87
  return None
88
-
89
88
  ```
90
89
  ## Session cookie
91
90
 
@@ -187,17 +186,17 @@ Alternatively, you can build your own workflow using the lower level AoC class
187
186
  ```python
188
187
  from adventofcode import AoC
189
188
 
190
- aoc = AoC() # defaults to current year and parses the day from the filename (e.g. 01.py will be day 1)
189
+ aoc = AoC() # defaults to current year and parses the day from the filename (e.g. 01.py will be day 1)
191
190
 
192
- aoc.print_p1() # prints the first part of the puzzle
193
- inp = aoc.get_input() # returns the input as a string
191
+ aoc.print_p1() # prints the first part of the puzzle
192
+ inp = aoc.get_input() # returns the input as a string
194
193
  # solve the puzzle here
195
194
  ...
196
- aoc.submit_p1('part 1 answer') # submits the answer to the first part of the puzzle
197
- aoc.print_p2() # prints the second part of the puzzle
195
+ aoc.submit_p1("part 1 answer") # submits the answer to the first part of the puzzle
196
+ aoc.print_p2() # prints the second part of the puzzle
198
197
  # solve the puzzle here
199
198
  ...
200
- aoc.submit_p2('part 2 answer') # submits the answer to the second part of the puzzle
199
+ aoc.submit_p2("part 2 answer") # submits the answer to the second part of the puzzle
201
200
  ```
202
201
 
203
202
  ### Happy solving 🎄
@@ -0,0 +1,136 @@
1
+ [project]
2
+ name = "adventofcode"
3
+ version = "26.1"
4
+ description = "Helper utilities for solving Advent of Code puzzles"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ keywords = []
9
+ classifiers = [
10
+ "Development Status :: 4 - Beta",
11
+ "Programming Language :: Python",
12
+ "Programming Language :: Python :: 3.11",
13
+ "Programming Language :: Python :: 3.12",
14
+ "Programming Language :: Python :: 3.13",
15
+ "Programming Language :: Python :: 3.14",
16
+ "Programming Language :: Python :: 3.15",
17
+ "Programming Language :: Python :: Implementation :: CPython",
18
+ "Programming Language :: Python :: Implementation :: PyPy",
19
+ ]
20
+ dependencies = [
21
+ "requests",
22
+ "percache",
23
+ "beautifulsoup4",
24
+ "python-dotenv",
25
+ "rich",
26
+ ]
27
+
28
+ [[project.authors]]
29
+ name = "Anže Pečar"
30
+ email = "anze@pecar.me"
31
+
32
+ [project.urls]
33
+ Documentation = "https://github.com/anze3db/adventofcode#readme"
34
+ Issues = "https://github.com/anze3db/adventofcode/issues"
35
+ Source = "https://github.com/anze3db/adventofcode"
36
+ Changelog = "https://github.com/anze3db/adventofcode/blob/main/CHANGELOG.md"
37
+ Mastodon = "https://fosstodon.org/@anze3db"
38
+ Twitter = "https://twitter.com/anze3db"
39
+
40
+ [project.scripts]
41
+ adventofcode = "adventofcode.cli:main"
42
+ aoc = "adventofcode.cli:main"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "flakytest",
47
+ "pytest>=8",
48
+ "ruff>=0.17.0",
49
+ ]
50
+
51
+ [build-system]
52
+ requires = ["uv_build>=0.8.0,<0.14.0"]
53
+ build-backend = "uv_build"
54
+
55
+ [tool.pytest.ini_options]
56
+ testpaths = ["tests"]
57
+
58
+ [tool.ruff]
59
+ target-version = "py311"
60
+ line-length = 120
61
+
62
+ [tool.ruff.lint]
63
+ select = [
64
+ "A",
65
+ "ARG",
66
+ "B",
67
+ "C",
68
+ "DTZ",
69
+ "E",
70
+ "EM",
71
+ "F",
72
+ "FBT",
73
+ "I",
74
+ "ICN",
75
+ "ISC",
76
+ "N",
77
+ "PLC",
78
+ "PLE",
79
+ "PLR",
80
+ "PLW",
81
+ "Q",
82
+ "RUF",
83
+ "S",
84
+ "T",
85
+ "TID",
86
+ "UP",
87
+ "W",
88
+ "YTT",
89
+ ]
90
+ ignore = [
91
+ "B027",
92
+ "FBT003",
93
+ "S105",
94
+ "S106",
95
+ "S107",
96
+ "C901",
97
+ "PLR0911",
98
+ "PLR0912",
99
+ "PLR0913",
100
+ "PLR0915",
101
+ "S101",
102
+ "PLR2004",
103
+ "ISC001",
104
+ ]
105
+ unfixable = ["F401"]
106
+
107
+ [tool.ruff.lint.isort]
108
+ known-first-party = ["adventofcode"]
109
+
110
+ [tool.ruff.lint.flake8-tidy-imports]
111
+ ban-relative-imports = "all"
112
+
113
+ [tool.ruff.lint.per-file-ignores]
114
+ "tests/**/*" = [
115
+ "PLR2004",
116
+ "S101",
117
+ "TID252",
118
+ ]
119
+ "scripts/release.py" = [
120
+ "DTZ011",
121
+ "EM101",
122
+ "EM102",
123
+ "FBT001",
124
+ "FBT002",
125
+ "PLR0917",
126
+ "PLW2901",
127
+ "S603",
128
+ "T201",
129
+ ]
130
+ "tests/test_release_script.py" = [
131
+ "ARG001",
132
+ "ARG005",
133
+ "PLC0415",
134
+ "S603",
135
+ "S607",
136
+ ]
@@ -1,13 +1,10 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
1
  [project]
6
2
  name = "adventofcode"
7
- dynamic = ["version"]
3
+ # CalVer: YY.N = the Nth release of 20YY (26.1, 26.2, ..., 27.1). Bumped by scripts/release.py.
4
+ version = "26.1"
8
5
  description = 'Helper utilities for solving Advent of Code puzzles'
9
6
  readme = "README.md"
10
- requires-python = ">=3.10"
7
+ requires-python = ">=3.11"
11
8
  license = "MIT"
12
9
  keywords = []
13
10
  authors = [
@@ -16,11 +13,11 @@ authors = [
16
13
  classifiers = [
17
14
  "Development Status :: 4 - Beta",
18
15
  "Programming Language :: Python",
19
- "Programming Language :: Python :: 3.10",
20
16
  "Programming Language :: Python :: 3.11",
21
17
  "Programming Language :: Python :: 3.12",
22
18
  "Programming Language :: Python :: 3.13",
23
19
  "Programming Language :: Python :: 3.14",
20
+ "Programming Language :: Python :: 3.15",
24
21
  "Programming Language :: Python :: Implementation :: CPython",
25
22
  "Programming Language :: Python :: Implementation :: PyPy",
26
23
  ]
@@ -36,6 +33,7 @@ dependencies = [
36
33
  Documentation = "https://github.com/anze3db/adventofcode#readme"
37
34
  Issues = "https://github.com/anze3db/adventofcode/issues"
38
35
  Source = "https://github.com/anze3db/adventofcode"
36
+ Changelog = "https://github.com/anze3db/adventofcode/blob/main/CHANGELOG.md"
39
37
  Mastodon = "https://fosstodon.org/@anze3db"
40
38
  Twitter = "https://twitter.com/anze3db"
41
39
 
@@ -43,54 +41,25 @@ Twitter = "https://twitter.com/anze3db"
43
41
  adventofcode = "adventofcode.cli:main"
44
42
  aoc = "adventofcode.cli:main"
45
43
 
46
- [tool.hatch.version]
47
- path = "src/adventofcode/__about__.py"
48
-
49
- [tool.hatch.envs.default]
50
- dependencies = [
51
- "coverage[toml]>=6.5",
52
- "pytest",
53
- "flakytest"
54
- ]
55
- [tool.hatch.envs.default.scripts]
56
- test = "pytest {args:tests}"
57
- test-cov = "coverage run -m pytest {args:tests}"
58
- cov-report = [
59
- "- coverage combine",
60
- "coverage report",
61
- ]
62
- cov = [
63
- "test-cov",
64
- "cov-report",
44
+ [dependency-groups]
45
+ dev = [
46
+ "flakytest",
47
+ "pytest>=8",
48
+ "ruff>=0.17.0",
65
49
  ]
66
50
 
67
- [[tool.hatch.envs.all.matrix]]
68
- python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
51
+ [build-system]
52
+ requires = ["uv_build>=0.8.0,<0.14.0"]
53
+ build-backend = "uv_build"
69
54
 
70
- [tool.hatch.envs.lint]
71
- detached = true
72
- dependencies = [
73
- "ruff>=0.1.6",
74
- ]
75
- [tool.hatch.envs.lint.scripts]
76
- typing = "mypy --install-types --non-interactive {args:src/adventofcode tests}"
77
- style = [
78
- "ruff {args:.}",
79
- "ruff format --check {args:.}",
80
- ]
81
- fmt = [
82
- "ruff format {args:.}",
83
- "ruff --fix {args:.}",
84
- "style",
85
- ]
86
- all = [
87
- "style",
88
- "typing",
89
- ]
55
+ [tool.pytest.ini_options]
56
+ testpaths = ["tests"]
90
57
 
91
58
  [tool.ruff]
92
- target-version = "py310"
59
+ target-version = "py311"
93
60
  line-length = 120
61
+
62
+ [tool.ruff.lint]
94
63
  select = [
95
64
  "A",
96
65
  "ARG",
@@ -134,31 +103,15 @@ unfixable = [
134
103
  "F401",
135
104
  ]
136
105
 
137
- [tool.ruff.isort]
106
+ [tool.ruff.lint.isort]
138
107
  known-first-party = ["adventofcode"]
139
108
 
140
- [tool.ruff.flake8-tidy-imports]
109
+ [tool.ruff.lint.flake8-tidy-imports]
141
110
  ban-relative-imports = "all"
142
111
 
143
- [tool.ruff.per-file-ignores]
112
+ [tool.ruff.lint.per-file-ignores]
144
113
  # Tests can use magic values, assertions, and relative imports
145
114
  "tests/**/*" = ["PLR2004", "S101", "TID252"]
146
-
147
- [tool.coverage.run]
148
- source_pkgs = ["adventofcode", "tests"]
149
- branch = true
150
- parallel = true
151
- omit = [
152
- "src/adventofcode/__about__.py",
153
- ]
154
-
155
- [tool.coverage.paths]
156
- adventofcode = ["src/adventofcode", "*/adventofcode/src/adventofcode"]
157
- tests = ["tests", "*/adventofcode/tests"]
158
-
159
- [tool.coverage.report]
160
- exclude_lines = [
161
- "no cov",
162
- "if __name__ == .__main__.:",
163
- "if TYPE_CHECKING:",
164
- ]
115
+ # The release script is shared with django-tui, potatoq and flakytest-python: keep it in sync rather than lint-clean
116
+ "scripts/release.py" = ["DTZ011", "EM101", "EM102", "FBT001", "FBT002", "PLR0917", "PLW2901", "S603", "T201"]
117
+ "tests/test_release_script.py" = ["ARG001", "ARG005", "PLC0415", "S603", "S607"]
@@ -0,0 +1,6 @@
1
+ from importlib import metadata as _metadata
2
+
3
+ try:
4
+ __version__ = _metadata.version("adventofcode")
5
+ except _metadata.PackageNotFoundError: # running from a source tree without install
6
+ __version__ = "0+unknown"
@@ -1,4 +1,4 @@
1
- import datetime
1
+ import datetime as dt
2
2
  import os
3
3
  import re
4
4
  import sys
@@ -25,8 +25,8 @@ AOC_URL = "https://adventofcode.com"
25
25
 
26
26
 
27
27
  AOC_SESSION = os.getenv("AOC_SESSION")
28
- est = datetime.timezone(datetime.timedelta(hours=-5))
29
- today_est = datetime.datetime.now(tz=est).date()
28
+ est = dt.timezone(dt.timedelta(hours=-5))
29
+ today_est = dt.datetime.now(tz=est).date()
30
30
 
31
31
  AOC_YEAR = int(os.getenv("AOC_YEAR", str(today_est.year)))
32
32
 
@@ -1,5 +1,5 @@
1
1
  import argparse
2
- import datetime
2
+ import datetime as dt
3
3
  import importlib.util
4
4
  import os
5
5
  import re
@@ -20,8 +20,8 @@ from adventofcode.utils import PART_1_RETURN_STR, PART_2_RETURN_STR, format_time
20
20
 
21
21
  load_dotenv(Path(".env").absolute().as_posix())
22
22
 
23
- est = datetime.timezone(datetime.timedelta(hours=-5))
24
- today_est = datetime.datetime.now(tz=est).date()
23
+ est = dt.timezone(dt.timedelta(hours=-5))
24
+ today_est = dt.datetime.now(tz=est).date()
25
25
 
26
26
  AOC_YEAR = int(os.getenv("AOC_YEAR", str(today_est.year)))
27
27
 
@@ -182,7 +182,7 @@ def run_day(filepath: Path) -> DayResult:
182
182
  match = re.match(r"(\d\d)", filepath.stem)
183
183
  day_num = int(match.group(1)) if match else 0
184
184
  day_num_str, variant = split_day_name(filepath.stem)
185
- if datetime.date(AOC_YEAR, 12, day_num) > today_est:
185
+ if dt.date(AOC_YEAR, 12, day_num) > today_est:
186
186
  return DayResult(day=filepath.stem, day_num=day_num_str, variant=variant, status="🕑")
187
187
 
188
188
  result = DayResult(day=filepath.stem, day_num=day_num_str, variant=variant)
@@ -613,10 +613,11 @@ def run(filepath: Path, benchmark: bool = False) -> None: # noqa: FBT001, FBT00
613
613
  match = re.match(r"(\d\d)", filepath.stem)
614
614
  if not match:
615
615
  return
616
+ day = int(match.group(1))
616
617
  aoc = AoC(
617
618
  part_1=module.part1,
618
619
  part_2=module.part2,
619
- day=int(match.group(1)),
620
+ day=day,
620
621
  year=AOC_YEAR,
621
622
  )
622
623
  if hasattr(module, "part1_asserts"):
@@ -629,6 +630,9 @@ def run(filepath: Path, benchmark: bool = False) -> None: # noqa: FBT001, FBT00
629
630
  aoc.submit_p1_benchmark()
630
631
  else:
631
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
632
636
  if hasattr(module, "part2_asserts"):
633
637
  for test_input, expected in module.part2_asserts:
634
638
  aoc.assert_p2(test_input, expected)
@@ -1,40 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- permissions:
8
- contents: read
9
-
10
- jobs:
11
- deploy:
12
-
13
- runs-on: ubuntu-latest
14
- strategy:
15
- matrix:
16
- python-version: ["3.14"]
17
-
18
- environment: release
19
- permissions:
20
- id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
21
-
22
- steps:
23
- - uses: actions/checkout@v4
24
- - name: Set up Python ${{ matrix.python-version }}
25
- uses: actions/setup-python@v4
26
- with:
27
- python-version: ${{ matrix.python-version }}
28
- cache: 'pip'
29
- - name: Install dependencies
30
- run: |
31
- python -m pip install --upgrade pip
32
- pip install hatch
33
- - name: Build package
34
- run: hatch build
35
- - name: Test package
36
- run: hatch run test
37
- env:
38
- FLAKYTEST_SECRET_TOKEN: ${{ secrets.FLAKYTEST_SECRET_TOKEN }}
39
- - name: Publish package distributions to PyPI
40
- uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,2 +0,0 @@
1
- dist
2
- .cache.db
@@ -1,16 +0,0 @@
1
- # See https://pre-commit.com for more information
2
- # See https://pre-commit.com/hooks.html for more hooks
3
- repos:
4
- - repo: https://github.com/pre-commit/pre-commit-hooks
5
- rev: v6.0.0
6
- hooks:
7
- - id: trailing-whitespace
8
- - id: end-of-file-fixer
9
- - id: check-yaml
10
- - id: check-added-large-files
11
- - repo: https://github.com/astral-sh/ruff-pre-commit
12
- # Ruff version.
13
- rev: v0.14.7
14
- hooks:
15
- - id: ruff
16
- - id: ruff-format
@@ -1,173 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Calendar Versioning](https://calver.org).
7
-
8
- ## [25.11]
9
-
10
- ### Fixed
11
-
12
- * Variant column not showing for certain file patterns
13
-
14
- ## [25.10]
15
-
16
- ### Added
17
-
18
- * When you have alternative solutions only the fastest one is now counted in the totals row and the display in the table was improved:
19
-
20
- | Day | Variant | Status | Part 1 Time | Part 2 Time | Total Time |
21
- |----:|:--------|:------:|------------:|------------:|-----------:|
22
- | 01 | | ✅ | 0.54ms 🟢 | 0.63ms 🟢 | 1.17ms 🟢 |
23
- | 02 | | ✅ | 0.08ms 🟢 | 0.13ms 🟢 | 0.21ms 🟢 |
24
- | 03 | | ✅ | 0.38ms 🟢 | 0.98ms 🟢 | 1.36ms 🟢 |
25
- | 04 | numpy | ✅ | 0.80ms 🟢 | 4.48ms 🟢 | 5.28ms 🟢 |
26
- | ~~04~~ | | ✅ | 5.87ms ⚪ | 14.37ms ⚪ | 20.24ms ⚪ |
27
- | 05 | | ✅ | 0.28ms 🟢 | 0.09ms 🟢 | 0.37ms 🟢 |
28
- | 06 | | ✅ | 0.79ms 🟢 | 1.25ms 🟢 | 2.04ms 🟢 |
29
- | 07 | | ✅ | 1.21ms 🟢 | 1.43ms 🟢 | 2.64ms 🟢 |
30
- | 08 | | 🕑 | - | - | - |
31
- | 09 | | 🕑 | - | - | - |
32
- | 10 | | 🕑 | - | - | - |
33
- | 11 | | 🕑 | - | - | - |
34
- | 12 | | 🕑 | - | - | - |
35
- | **Total** | | | 4.08ms 🟢 | 8.99ms 🟢 | 13.07ms 🟢 |
36
-
37
- Legend:
38
- * 🟢 < 100ms
39
- * 🟡 100ms - 1s
40
- * 🔴 > 1s
41
- * ⚪ Not included in total
42
-
43
- ## Fixed
44
-
45
- * Fix benchmark help text (by @baloncek2662)
46
-
47
- ## [25.9]
48
-
49
- ### Added
50
-
51
- * Ability to benchmark a single file. Thank you @baloncek2662 ❤️
52
-
53
- ### Fixed
54
-
55
- * Crash on Windows. Thank you @tfs-sean-disanti ❤️
56
-
57
- ## [25.8]
58
-
59
- ### Added
60
-
61
- * Ability to benchmark different solution for one day. Requested by @rodrigogiraoserrao ❤️
62
- * More stable benchmarking (using [Timer.autorange](https://docs.python.org/3/library/timeit.html#timeit.Timer.autorange))
63
-
64
- ### Fixed
65
-
66
- * Improved the README.md template
67
-
68
- ## [25.7]
69
-
70
- ### Fixed
71
-
72
- * Image issue in README not showing on PyPI
73
-
74
- ## [25.6]
75
-
76
- ### Fixed
77
-
78
- * Image issue in README
79
-
80
- ## [25.5]
81
-
82
- ### Fixed
83
-
84
- * Readme improvements
85
-
86
- ## [25.4]
87
-
88
- ### Added
89
-
90
- * New `uv run adventofcode run` command that removes the need for boilerplate in your solutions.
91
-
92
- ### Fixed
93
-
94
- * Outputs are now cleaner and less verbose.
95
- * Generated templates with `uv run adventofcode init` now include a docstring with instructions on how to run it. All the AoC class boilerplate has been removed.
96
-
97
- ## [25.3]
98
-
99
- ### Fixed
100
-
101
- * Missing `uv run` commands in README. Thank you @baloncek2662! ❤️
102
-
103
- ## [25.2]
104
-
105
- ### Added
106
-
107
- * Add `adventofcode benchmark` to the README.
108
-
109
- ## [25.1]
110
-
111
- ### Added
112
-
113
- * `adventofcode benchmark` command that generates benchmark results both in the console and in the README. Example README:
114
-
115
-
116
- | Day | Status | Part 1 Time | Part 2 Time | Total Time |
117
- |:---:|:------:|------------:|------------:|-----------:|
118
- | 01 | ✅ | 2.1ms 🟢 | 0.6ms 🟢 | 2.6ms 🟢 |
119
- | 02 | ✅ | 1.9ms 🟢 | 1.2ms 🟢 | 3.1ms 🟢 |
120
- | 03 | ✅ | 1.5ms 🟢 | 0.5ms 🟢 | 2.0ms 🟢 |
121
- | 04 | ✅ | 22.5ms 🟢 | 5.2ms 🟢 | 27.8ms 🟢 |
122
- | 05 | ✅ | 3.6ms 🟢 | 4.1ms 🟢 | 7.7ms 🟢 |
123
- | 06 | ✅ | 3.6ms 🟢 | 4.14s 🔴 | 4.14s 🔴 |
124
- | 07 | ✅ | 33.8ms 🟢 | 1.07s 🔴 | 1.11s 🔴 |
125
- | 08 | ✅ | 1.0ms 🟢 | 0.7ms 🟢 | 1.7ms 🟢 |
126
- | 09 | ✅ | 6.3ms 🟢 | 1.08s 🔴 | 1.09s 🔴 |
127
- | 10 | ✅ | 3.2ms 🟢 | 3.2ms 🟢 | 6.4ms 🟢 |
128
- | 11 | ✅ | 1.7ms 🟢 | 45.0ms 🟢 | 46.7ms 🟢 |
129
- | 12 | ✅ | 33.3ms 🟢 | 31.0ms 🟢 | 64.4ms 🟢 |
130
- | 13 | ✅ | 118.1ms 🟡 | 360.8ms 🟡 | 478.9ms 🟡 |
131
- | 14 | ✅ | 3.7ms 🟢 | 411.4ms 🟡 | 415.1ms 🟡 |
132
- | 15 | ✅ | 3.5ms 🟢 | 5.0ms 🟢 | 8.4ms 🟢 |
133
- | 16 | ✅ | 87.1ms 🟢 | 133.9ms 🟡 | 221.1ms 🟡 |
134
- | 17 | ✅ | 0.7ms 🟢 | 21.0ms 🟢 | 21.7ms 🟢 |
135
- | 18 | ✅ | 7.2ms 🟢 | 7.49s 🔴 | 7.50s 🔴 |
136
- | 19 | ✅ | 9.7ms 🟢 | 111.7ms 🟡 | 121.4ms 🟡 |
137
- | 20 | ✅ | 50.54s 🔴 | 4.46s 🔴 | 54.99s 🔴 |
138
- | 21 | ✅ | 0.4ms 🟢 | 0.3ms 🟢 | 0.8ms 🟢 |
139
- | 22 | ✅ | 603.7ms 🟡 | 1.90s 🔴 | 2.50s 🔴 |
140
- | 23 | ✅ | 255.0ms 🟡 | 263.4ms 🟡 | 518.4ms 🟡 |
141
- | 24 | ⚠️ | 1.4ms 🟢 | - | 1.4ms 🟢 |
142
- | 25 | ✅ | 7.2ms 🟢 | - | 7.2ms 🟢 |
143
- | **Total** | | 51.75s 🔴 | 21.53s 🔴 | 73.28s 🔴 |
144
-
145
- Legend:
146
- * 🟢 < 100ms
147
- * 🟡 100ms - 1s
148
- * 🔴 > 1s
149
-
150
- ## [25.0]
151
-
152
- ### Added
153
-
154
- * Command line tool for scaffolding all the days (`adventofcode init`)
155
- * Support for Python 3.13 and 3.14
156
-
157
- ### Removed
158
-
159
- * `part_1_no_splitlines` and `part_2_no_splitlines` parameters. `part_1` and `part_2` now receive a `str` instead of `list[str]`. This was done to simplify the API.
160
- * Support for Python 3.8 and 3.9
161
-
162
- ## [23.0b1]
163
-
164
- ### Added
165
-
166
- * `assert_p1` and `assert_p2` methods to `AoC` class. Used for easily asserting your solutions against sample inputs.
167
- * `part_1`, `part_2` optional arguments to the `AoC` class. Used to pass in a Callable that will return the correct result for the given input. The callable will be called by `assert_p1`, `assert_p2`, `submit_p1` and `submit_p2` methods.
168
- * `part_1_no_splitlines` and `part_2_no_splitlines` optional arguments to `AoC` class. Used as an alternative to `part_1` and `part_2` for the rare cases when the input should not be split into lines.
169
-
170
-
171
- ## [2023.0b0] - 2023-12-07
172
-
173
- Initial release
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Anže Pečar
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
Binary file
File without changes
@@ -1 +0,0 @@
1
- __version__ = "25.11"
File without changes
@@ -1,28 +0,0 @@
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