python3Packages.perplexityai: init at 0.38.0

This commit is contained in:
Sarah Clark
2026-06-09 14:06:31 -07:00
parent b261a7360f
commit 9bbc5f80be
2 changed files with 104 additions and 0 deletions
@@ -0,0 +1,102 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
hatch-fancy-pypi-readme,
hatchling,
# dependencies (incl. optional)
anyio,
distro,
httpx,
pydantic,
sniffio,
typing-extensions,
aiohttp,
httpx-aiohttp,
# tests
pyright,
mypy,
respx,
pytest,
pytest-asyncio,
ruff,
time-machine,
nox,
dirty-equals,
importlib-metadata,
rich,
pytest-xdist,
}:
buildPythonPackage (finalAttrs: {
pname = "perplexityai";
version = "0.38.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "perplexityai";
repo = "perplexity-py";
tag = "v${finalAttrs.version}";
hash = "sha256-Yp5A3aoKtAjWRPZ1Un2OYwezZohWirNm2JhAWLhd6uQ=";
};
# Can't use relaxPythonDeps as this is a version lock in the build system
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"hatchling==1.26.3"' '"hatchling"'
'';
build-system = [
hatch-fancy-pypi-readme
hatchling
];
dependencies = [
anyio
distro
httpx
pydantic
sniffio
typing-extensions
];
optional-dependencies = {
aiohttp = [
aiohttp
httpx-aiohttp
];
};
nativeCheckInputs = [
pyright
mypy
respx
pytest
pytest-asyncio
ruff
time-machine
nox
dirty-equals
importlib-metadata
rich
pytest-xdist
]
++ finalAttrs.passthru.optional-dependencies.aiohttp;
pythonImportsCheck = [
"perplexity"
];
meta = {
description = "API for Perplexity AI";
homepage = "https://github.com/perplexityai/perplexity-py";
changelog = "https://github.com/perplexityai/perplexity-py/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ sarahec ];
};
})
+2
View File
@@ -12558,6 +12558,8 @@ self: super: with self; {
permissionedforms = callPackage ../development/python-modules/permissionedforms { };
perplexityai = callPackage ../development/python-modules/perplexityai { };
persim = callPackage ../development/python-modules/persim { };
persist-queue = callPackage ../development/python-modules/persist-queue { };