2022-12-04 12:56:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, requests
|
|
|
|
, pytestCheckHook
|
|
|
|
, tzlocal
|
|
|
|
, pytest-mock
|
|
|
|
, pytest-freezegun
|
|
|
|
, pytest-raisin
|
|
|
|
, pytest-socket
|
|
|
|
, requests-mock
|
2023-10-05 20:49:35 +00:00
|
|
|
, pook
|
|
|
|
, numpy
|
|
|
|
, rich
|
2022-12-04 12:56:51 +00:00
|
|
|
, pebble
|
|
|
|
, python-dateutil
|
|
|
|
, termcolor
|
|
|
|
, beautifulsoup4
|
|
|
|
, setuptools
|
|
|
|
, pythonOlder
|
2021-12-24 16:47:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aocd";
|
2023-09-15 12:05:45 +00:00
|
|
|
version = "2.0.1";
|
2023-10-05 20:49:35 +00:00
|
|
|
format = "pyproject";
|
2022-12-04 12:56:51 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
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
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
termcolor
|
|
|
|
beautifulsoup4
|
|
|
|
pebble
|
|
|
|
tzlocal
|
|
|
|
setuptools
|
2023-10-05 20:49:35 +00:00
|
|
|
rich # for example parser aoce. must either be here or checkInputs
|
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
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-24 16:47:18 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-freezegun
|
|
|
|
pytest-raisin
|
|
|
|
pytest-socket
|
2023-10-05 20:49:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pook
|
|
|
|
numpy
|
2021-12-24 16:47:18 +00:00
|
|
|
requests-mock
|
|
|
|
];
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|