mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 19:02:57 +00:00
python3Packages.pydantic: 1.0 -> 1.3 enable tests move to github
This commit is contained in:
parent
93aa213aca
commit
470566c0c8
@ -1,21 +1,25 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, fetchFromGitHub
|
||||
, ujson
|
||||
, email_validator
|
||||
, typing-extensions
|
||||
, python
|
||||
, isPy3k
|
||||
, pytest
|
||||
, pytestcov
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pydantic";
|
||||
version = "1.0";
|
||||
version = "1.3";
|
||||
disabled = !isPy3k;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "bf474cebe007701806f5f8b076fb8508116606e5c721734bb855bfec4185263c";
|
||||
src = fetchFromGitHub {
|
||||
owner = "samuelcolvin";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0s85nzlsyj97j54zsgv569hkzv617z0vqsifsxkkyiimgbvnx7g8";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@ -24,22 +28,13 @@ buildPythonPackage rec {
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytest
|
||||
pytestcov
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
${python.interpreter} -c """
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
from pydantic import BaseModel
|
||||
|
||||
class User(BaseModel):
|
||||
id: int
|
||||
name = 'John Doe'
|
||||
signup_ts: datetime = None
|
||||
friends: List[int] = []
|
||||
|
||||
external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
|
||||
user = User(**external_data)
|
||||
assert user.id is "123"
|
||||
"""
|
||||
pytest
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user