diff --git a/pkgs/development/python-modules/bpylist2/default.nix b/pkgs/development/python-modules/bpylist2/default.nix new file mode 100644 index 000000000000..7becd01e194b --- /dev/null +++ b/pkgs/development/python-modules/bpylist2/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + pytestCheckHook, +}: + +buildPythonPackage { + pname = "bpylist2"; + version = "4.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "parabolala"; + repo = "bpylist2"; + rev = "ddb89e0b0301c6b298de6469221d99b5fe127b58"; + hash = "sha256-OBwDQZL5++LZgpQM96tmplAh1Pjme3KGSNFTKqKUn00="; + }; + + build-system = [ poetry-core ]; + + pythonImportsCheck = [ "bpylist2" ]; + nativeCheckInputs = [ pytestCheckHook ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace-fail "--pycodestyle" "" \ + --replace-fail "--pylint --pylint-rcfile=pylint.rc" "" \ + --replace-fail "--mypy" "" + ''; + + meta = { + description = "Parse and Generate binary plists and NSKeyedArchiver archives"; + license = lib.licenses.mit; + homepage = "https://github.com/parabolala/bpylist2"; + maintainers = with lib.maintainers; [ sigmanificient ]; + }; +} diff --git a/pkgs/development/python-modules/osxphotos/default.nix b/pkgs/development/python-modules/osxphotos/default.nix new file mode 100644 index 000000000000..b62e22d256aa --- /dev/null +++ b/pkgs/development/python-modules/osxphotos/default.nix @@ -0,0 +1,112 @@ +{ + stdenv, + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + + bitmath, + bpylist2, + click, + mako, + more-itertools, + objexplore, + packaging, + pathvalidate, + pip, + ptpython, + pytimeparse2, + pyyaml, + requests, + rich-theme-manager, + rich, + shortuuid, + strpdatetime, + tenacity, + textx, + toml, + wrapt, + wurlitzer, + xdg-base-dirs, + + pytestCheckHook, + pytest-mock, +}: + +buildPythonPackage rec { + pname = "osxphotos"; + version = "0.68.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "RhetTbull"; + repo = "osxphotos"; + rev = "refs/tags/v${version}"; + hash = "sha256-iPeidbPoF0AG6TJDWloXwpwzJ4oWEglKVLp2yywnyZs="; + }; + + build-system = [ setuptools ]; + dependencies = [ + bitmath + bpylist2 + click + mako + more-itertools + objexplore + packaging + pathvalidate + pip + ptpython + pytimeparse2 + pyyaml + requests + rich-theme-manager + rich + shortuuid + strpdatetime + tenacity + textx + toml + wrapt + wurlitzer + xdg-base-dirs + ]; + + pythonRelaxDeps = [ + "mako" + "more-itertools" + "objexplore" + "textx" + ]; + + pythonImportsCheck = [ "osxphotos" ]; + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + disabledTestPaths = [ "tests/test_comments.py" ]; + disabledTests = [ + "test_iphoto_info" + "test_from_to_date_tz" + "test_function_url" + "test_get_local_tz" + "test_datetime_naive_to_local" + "test_from_to_date_tz" + "test_query_from_to_date_alt_location" + "test_query_function_url" + ]; + + meta = { + description = "Export photos from Apple's macOS Photos app and query the Photos library database to access metadata about images"; + homepage = "https://github.com/RhetTbull/osxphotos"; + changelog = "https://github.com/RhetTbull/osxphotos/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ sigmanificient ]; + broken = stdenv.isDarwin; + }; +} diff --git a/pkgs/development/python-modules/rich-theme-manager/default.nix b/pkgs/development/python-modules/rich-theme-manager/default.nix new file mode 100644 index 000000000000..f465b77b6ef6 --- /dev/null +++ b/pkgs/development/python-modules/rich-theme-manager/default.nix @@ -0,0 +1,34 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + rich, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "rich-theme-manager"; + version = "0.11.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "RhetTbull"; + repo = "rich_theme_manager"; + rev = "refs/tags/v${version}"; + hash = "sha256-nSNG+lWOPmh66I9EmPvWqbeceY/cu+zBpgVlDTNuHc0="; + }; + + build-system = [ poetry-core ]; + dependencies = [ rich ]; + + pythonImportsCheck = [ "rich_theme_manager" ]; + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + description = "Define custom styles and themes for use with rich"; + license = lib.licenses.mit; + homepage = "https://github.com/RhetTbull/rich_theme_manager"; + maintainers = with lib.maintainers; [ sigmanificient ]; + }; +} diff --git a/pkgs/development/python-modules/strpdatetime/default.nix b/pkgs/development/python-modules/strpdatetime/default.nix new file mode 100644 index 000000000000..f7e758bd1c3f --- /dev/null +++ b/pkgs/development/python-modules/strpdatetime/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + textx, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "strpdatetime"; + version = "0.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "RhetTbull"; + repo = "strpdatetime"; + rev = "v${version}"; + hash = "sha256-eb3KJCFRkEt9KEP1gMQYuP50qXqItrexJhKvtJDHl9o="; + }; + + build-system = [ poetry-core ]; + + dependencies = [ textx ]; + pythonRelaxDeps = [ "textx" ]; + + patches = [ ./fix-locale.patch ]; + + pythonImportsCheck = [ "strpdatetime" ]; + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + description = "Parse strings into Python datetime objects"; + license = lib.licenses.psfl; + changelog = "https://github.com/RhetTbull/strpdatetime/blob/${src.rev}/CHANGELOG.md"; + homepage = "https://github.com/RhetTbull/strpdatetime"; + maintainers = with lib.maintainers; [ sigmanificient ]; + }; +} diff --git a/pkgs/development/python-modules/strpdatetime/fix-locale.patch b/pkgs/development/python-modules/strpdatetime/fix-locale.patch new file mode 100644 index 000000000000..d79bd63c6655 --- /dev/null +++ b/pkgs/development/python-modules/strpdatetime/fix-locale.patch @@ -0,0 +1,10 @@ +diff --git a/tests/test_strpdatetime.py b/tests/test_strpdatetime.py +index 6c371d6..a3d0232 100644 +--- a/tests/test_strpdatetime.py ++++ b/tests/test_strpdatetime.py +@@ -44,5 +44,4 @@ TEST_DATA = [ + @pytest.mark.parametrize("string, format, expected", TEST_DATA) + def test_datetime_strptime(string, format, expected): + """Test datetime_strptime""" +- locale.setlocale(locale.LC_ALL, "en_US.UTF-8") + assert strpdatetime(string, format) == expected diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7c4cc55a5389..7c5ac7cbb3fc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1775,6 +1775,8 @@ self: super: with self; { bpycv = callPackage ../development/python-modules/bpycv {}; + bpylist2 = callPackage ../development/python-modules/bpylist2 { }; + bpython = callPackage ../development/python-modules/bpython { }; bqplot = callPackage ../development/python-modules/bqplot { }; @@ -9602,6 +9604,8 @@ self: super: with self; { ossfs = callPackage ../development/python-modules/ossfs { }; + osxphotos = callPackage ../development/python-modules/osxphotos { }; + ots-python = callPackage ../development/python-modules/ots-python { }; outcome = callPackage ../development/python-modules/outcome { }; @@ -13600,6 +13604,8 @@ self: super: with self; { rich-rst = callPackage ../development/python-modules/rich-rst { }; + rich-theme-manager = callPackage ../development/python-modules/rich-theme-manager { }; + ring-doorbell = callPackage ../development/python-modules/ring-doorbell { }; rio-tiler = callPackage ../development/python-modules/rio-tiler { }; @@ -14952,6 +14958,8 @@ self: super: with self; { striprtf = callPackage ../development/python-modules/striprtf { }; + strpdatetime = callPackage ../development/python-modules/strpdatetime { }; + structlog = callPackage ../development/python-modules/structlog { }; stubserver = callPackage ../development/python-modules/stubserver { };