2022-12-04 12:56:51 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-01-27 12:22:04 +00:00
|
|
|
aocd-example-parser,
|
|
|
|
beautifulsoup4,
|
2022-12-04 12:56:51 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-01-27 12:22:04 +00:00
|
|
|
numpy,
|
|
|
|
pebble,
|
|
|
|
pook,
|
2022-12-04 12:56:51 +00:00
|
|
|
pytest-freezegun,
|
2024-01-27 12:22:04 +00:00
|
|
|
pytest-mock,
|
2022-12-04 12:56:51 +00:00
|
|
|
pytest-raisin,
|
|
|
|
pytest-socket,
|
2024-01-27 12:22:04 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
python-dateutil,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
2022-12-04 12:56:51 +00:00
|
|
|
requests-mock,
|
2023-10-05 20:49:35 +00:00
|
|
|
rich,
|
2022-12-04 12:56:51 +00:00
|
|
|
setuptools,
|
2024-01-27 12:22:04 +00:00
|
|
|
termcolor,
|
|
|
|
tzlocal,
|
2021-12-24 16:47:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aocd";
|
2023-09-15 12:05:45 +00:00
|
|
|
version = "2.0.1";
|
2024-01-27 12:22:04 +00:00
|
|
|
pyproject = true;
|
2022-12-04 12:56:51 +00:00
|
|
|
|
2024-01-27 12:22:04 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2021-12-24 16:47:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wimglenn";
|
|
|
|
repo = "advent-of-code-data";
|
2022-06-21 09:07:42 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-09-15 12:05:45 +00:00
|
|
|
hash = "sha256-YZvcR97uHceloqwoP+azaBmj3GLusYNbItLIaeJ3QD0=";
|
2021-12-24 16:47:18 +00:00
|
|
|
};
|
|
|
|
|
2024-01-27 12:22:04 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
|
2021-12-24 16:47:18 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-01-27 12:22:04 +00:00
|
|
|
aocd-example-parser
|
|
|
|
beautifulsoup4
|
|
|
|
pebble
|
2021-12-24 16:47:18 +00:00
|
|
|
python-dateutil
|
|
|
|
requests
|
2024-01-27 12:22:04 +00:00
|
|
|
rich # for example parser aoce. must either be here or checkInputs
|
2021-12-24 16:47:18 +00:00
|
|
|
termcolor
|
|
|
|
tzlocal
|
2024-01-27 12:22:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
numpy
|
|
|
|
pook
|
|
|
|
pytest-freezegun
|
|
|
|
pytest-mock
|
|
|
|
pytest-raisin
|
|
|
|
pytest-socket
|
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
2021-12-24 16:47:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Too many failing tests
|
|
|
|
preCheck = "rm pytest.ini";
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_results"
|
|
|
|
"test_results_xmas"
|
|
|
|
"test_run_error"
|
|
|
|
"test_run_and_autosubmit"
|
|
|
|
"test_run_and_no_autosubmit"
|
|
|
|
"test_load_input_from_file"
|
2023-10-05 20:49:35 +00:00
|
|
|
"test_examples_cache" # IndexError: list index out of range
|
|
|
|
"test_example_partial" # ValueError: not enough values to unpack (expected 1, got 0)
|
|
|
|
"test_run_against_examples" # AssertionError: assert '2022/25 - The Puzzle Title' in ''
|
|
|
|
"test_aocd_no_examples" # SystemExit: 2
|
|
|
|
"test_aocd_examples" # SystemExit: 2
|
|
|
|
"test_aoce" # SystemExit: 1
|
|
|
|
|
|
|
|
# TypeError: sequence item 0: expected str instance, bool found
|
|
|
|
# Likely because they use `pook.get` to get a webpage
|
|
|
|
"test_submit_prevents_bad_guesses_too_high"
|
|
|
|
"test_submit_prevents_bad_guesses_too_low"
|
|
|
|
"test_submit_prevents_bad_guesses_known_incorrect"
|
|
|
|
"test_submit_correct_answer"
|
|
|
|
"test_correct_submit_reopens_browser_on_answer_page"
|
|
|
|
"test_server_error"
|
|
|
|
"test_submit_when_already_solved"
|
|
|
|
"test_submitted_too_recently_autoretry"
|
|
|
|
"test_submitted_too_recently_autoretry_quiet"
|
|
|
|
"test_submit_when_submitted_too_recently_no_autoretry"
|
|
|
|
"test_submit_wrong_answer "
|
|
|
|
"test_correct_submit_records_good_answer"
|
|
|
|
"test_submits_for_partb_when_already_submitted_parta"
|
|
|
|
"test_submit_when_parta_solved_but_answer_unsaved"
|
|
|
|
"test_submit_saves_both_answers_if_possible"
|
|
|
|
"test_submit_puts_level1_by_default"
|
|
|
|
"test_cannot_submit_same_bad_answer_twice"
|
|
|
|
"test_submit_float_warns"
|
2021-12-24 16:47:18 +00:00
|
|
|
];
|
|
|
|
|
2022-12-04 12:56:51 +00:00
|
|
|
pythonImportsCheck = [ "aocd" ];
|
2021-12-24 16:47:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Get your Advent of Code data with a single import statement";
|
2022-12-04 12:56:51 +00:00
|
|
|
homepage = "https://github.com/wimglenn/advent-of-code-data";
|
|
|
|
changelog = "https://github.com/wimglenn/advent-of-code-data/releases/tag/v${version}";
|
2021-12-24 16:47:18 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ aadibajpai ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|