2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
2023-11-16 04:20:00 +00:00
|
|
|
, hatchling
|
|
|
|
, pydantic
|
|
|
|
, python-dotenv
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-examples
|
|
|
|
, pytest-mock
|
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
let self = buildPythonPackage rec {
|
2023-11-16 04:20:00 +00:00
|
|
|
pname = "pydantic-settings";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "2.1.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pydantic";
|
|
|
|
repo = "pydantic-settings";
|
|
|
|
rev = "v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-hU7u/AzaqCHKSUDHybsgXTW8IWi9hzBttPYDmMqdZbI=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pydantic
|
|
|
|
python-dotenv
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pydantic_settings" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-examples
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# expected to fail
|
|
|
|
"test_docs_examples[docs/index.md:212-246]"
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# ruff is a dependency of pytest-examples which is required to run the tests.
|
|
|
|
# We do not want all of the downstream packages that depend on pydantic-settings to also depend on ruff.
|
|
|
|
doCheck = false;
|
|
|
|
passthru.tests = {
|
|
|
|
pytest = self.overridePythonAttrs {
|
|
|
|
doCheck = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Settings management using pydantic";
|
|
|
|
homepage = "https://github.com/pydantic/pydantic-settings";
|
|
|
|
license = licenses.mit;
|
|
|
|
broken = lib.versionOlder pydantic.version "2.0.0";
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
}; in self
|