Skip to content

Commit

Permalink
Merge pull request #122 from wimglenn/2.0.1
Browse files Browse the repository at this point in the history
renamed default example parser plugins
  • Loading branch information
wimglenn committed Jul 22, 2023
2 parents b3e604b + a3a106a commit 0155244
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aocd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main():
"--example-parser",
nargs="?",
choices=plugins,
const="aocd_examples_canned",
const="reference",
help="get the example(s) data, if any",
)
if len(users) > 1:
Expand Down
5 changes: 3 additions & 2 deletions aocd/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _get_unique_real_inputs(year, day):
def main():
"""
Summarize an example parser's results with historical puzzles' prose, and
compare the performance against a reference implementation (aocd_examples_canned)
compare the performance against a reference implementation
"""
try:
from rich.console import Console
Expand All @@ -166,12 +166,13 @@ def main():
"-e",
"--example-parser",
choices=list(plugins),
default="aocd_examples_canned",
default="reference",
help="plugin to use for example extraction testing (default: %(default)s)",
)
parser.add_argument(
"-y",
"--years",
metavar="2015+",
nargs="+",
help="years to run the parser against (can specify multiple)",
choices=all_years,
Expand Down
4 changes: 2 additions & 2 deletions aocd/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def examples(self):
"""
return self._get_examples()

def _get_examples(self, parser_name="aocd_examples_canned"):
def _get_examples(self, parser_name="reference"):
# invoke a named example parser to extract examples from cached prose.
# logs warning and returns an empty list if the parser plugin raises an
# exception for any reason.
Expand Down Expand Up @@ -824,7 +824,7 @@ def _load_users():


@cache
def _load_example_parser(group="adventofcode.examples", name="aocd_examples_canned"):
def _load_example_parser(group="adventofcode.examples", name="reference"):
# lazy-loads a plugin used to parse sample data, and cache it
try:
# Python 3.10+ - group/name selectable entry points
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "advent-of-code-data"
version = "2.0.0"
version = "2.0.1"
description = "Get your puzzle data with a single import"
requires-python = ">=3.9"
classifiers = [
Expand All @@ -19,7 +19,7 @@ dependencies = [
"pebble",
"urllib3",
'tzdata ; platform_system == "Windows"',
"aocd-example-parser >= 2023.1",
"aocd-example-parser >= 2023.2",
]

[[project.authors]]
Expand Down

0 comments on commit 0155244

Please sign in to comment.