diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fed81e98a0ff2..d2130e366658d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -10578,6 +10578,12 @@ github = "jordanisaacs"; githubId = 19742638; }; + jorikvanveen = { + email = "vanveenjorik@protonmail.com"; + github = "jorikvanveen"; + githubId = 33939820; + name = "Jorik van Veen"; + }; jorise = { email = "info@jorisengbers.nl"; github = "JorisE"; diff --git a/pkgs/by-name/po/posting/package.nix b/pkgs/by-name/po/posting/package.nix new file mode 100644 index 0000000000000..4b72cb7875e4e --- /dev/null +++ b/pkgs/by-name/po/posting/package.nix @@ -0,0 +1,81 @@ +{ + lib, + fetchFromGitHub, + python3, +}: +let + py-pkgs = python.pkgs; + python = python3.override { + packageOverrides = self: super: { + # Current nixpkgs version is too outdated, causes crash on startup + pydantic-settings = ( + super.pydantic-settings.overrideAttrs (oldAttrs: rec { + version = "2.6.0"; + src = fetchFromGitHub { + owner = "pydantic"; + repo = "pydantic-settings"; + rev = "refs/tags/v${version}"; + hash = "sha256-gJThzYJg6OIkfmfi/4MVINsrvmg+Z+0xMhdlCj7Fn+w="; + }; + propagatedBuildInputs = [ + super.pydantic + super.python-dotenv + ]; + }) + ); + + # Current nixpkgs version is too outdated, posting maintainer explicitly warns against relaxing this dependency + textual = ( + super.textual.overrideAttrs (oldAttrs: rec { + version = "0.85.0"; + src = fetchFromGitHub { + owner = "Textualize"; + repo = "textual"; + rev = "refs/tags/v${version}"; + hash = "sha256-ROq/Pjq6XRgi9iqMlCzpLmgzJzLl21MI7148cOxHS3o="; + }; + }) + ); + }; + }; +in +py-pkgs.buildPythonApplication rec { + pname = "posting"; + version = "2.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "darrenburns"; + repo = "posting"; + rev = "refs/tags/${version}"; + sha256 = "sha256-6KtC5VuG3x07VTenpyDAJr9KO4jdTCFk1u/pSoyYPsc="; + }; + + patches = [ ./relax-pyproject.patch ]; + + nativeBuildInputs = [ py-pkgs.hatchling ]; + + propagatedBuildInputs = [ + py-pkgs.click + py-pkgs.xdg-base-dirs + py-pkgs.click-default-group + py-pkgs.pyperclip + py-pkgs.pyyaml + py-pkgs.python-dotenv + py-pkgs.watchfiles + py-pkgs.pydantic + py-pkgs.pydantic-settings + py-pkgs.httpx + py-pkgs.textual + py-pkgs.textual-autocomplete + ]; + + meta = { + description = "The modern API client that lives in your terminal."; + mainProgram = "posting"; + homepage = "https://posting.sh/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ jorikvanveen ]; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/by-name/po/posting/relax-pyproject.patch b/pkgs/by-name/po/posting/relax-pyproject.patch new file mode 100644 index 0000000000000..c6cab443e7bb1 --- /dev/null +++ b/pkgs/by-name/po/posting/relax-pyproject.patch @@ -0,0 +1,25 @@ +ndex cc30424..45badb6 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -9,17 +9,17 @@ dependencies = [ + "click>=8.1.7,<9.0.0", + "xdg-base-dirs>=6.0.1,<7.0.0", + "click-default-group>=1.2.4,<2.0.0", +- "httpx[brotli]>=0.27.2,<1.0.0", ++ "httpx[brotli]>=0.27.0,<1.0.0", + "pyperclip>=1.9.0,<2.0.0", +- "pydantic>=2.9.2,<3.0.0", ++ "pydantic>=2.8.2,<3.0.0", + "pyyaml>=6.0.2,<7.0.0", +- "pydantic-settings>=2.4.0,<3.0.0", ++ "pydantic-settings>=2.3.4,<3.0.0", + "python-dotenv>=1.0.1,<2.0.0", + "textual[syntax]==0.85.0", + # pinned intentionally + "textual-autocomplete==3.0.0a12", + # pinned intentionally +- "watchfiles>=0.24.0", ++ "watchfiles>=0.22.0", + ] + readme = "README.md" + requires-python = ">= 3.11" diff --git a/pkgs/development/python-modules/textual-autocomplete/default.nix b/pkgs/development/python-modules/textual-autocomplete/default.nix new file mode 100644 index 0000000000000..9b9a9848ef9e0 --- /dev/null +++ b/pkgs/development/python-modules/textual-autocomplete/default.nix @@ -0,0 +1,33 @@ +{ + lib, + python3, + fetchPypi, + poetry-core, + textual, + typing-extensions, +}: +python3.pkgs.buildPythonPackage rec { + pname = "textual_autocomplete"; + version = "3.0.0a12"; + pyproject = true; + + # Alpha versions of this packages are only available on Pypi for some reason + src = fetchPypi { + inherit pname version; + sha256 = "sha256-HSyeTSTH9XWryMYSy2q//0cG9qqrm5OVBrldroRUkwk="; + }; + + nativeBuildInputs = [ poetry-core ]; + + dependencies = [ + textual + typing-extensions + ]; + + meta = { + description = "Python library that provides autocomplete capabilities to textual"; + homepage = "https://pypi.org/project/textual-autocomplete"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ jorikvanveen ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e9a1128b354c..2957586b04128 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15544,6 +15544,8 @@ self: super: with self; { textual = callPackage ../development/python-modules/textual { }; + textual-autocomplete = callPackage ../development/python-modules/textual-autocomplete { }; + textual-dev = callPackage ../development/python-modules/textual-dev { }; textual-fastdatatable = callPackage ../development/python-modules/textual-fastdatatable { };