fix: python deps cleanup

This commit is contained in:
teutat3s 2024-01-06 17:15:26 +01:00
parent 508769f12e
commit 139cc86d20
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
10 changed files with 131 additions and 175 deletions

View file

@ -12,22 +12,30 @@ final: prev: {
honcho = pyFinal.callPackage ./python/honcho.nix {};
# erpnext dependencies
gocardless-pro = pyFinal.callPackage ./python/gocardless-pro.nix {};
redisearch = pyFinal.callPackage ./python/redisearch.nix {};
taxjar = pyFinal.callPackage ./python/taxjar.nix {};
barcodenumber = pyFinal.callPackage ./python/barcodenumber.nix {};
# frappe dependencies
email-reply-parser = pyFinal.callPackage ./python/email-reply-parser.nix {};
maxminddb-geolite2 = pyFinal.callPackage ./python/maxminddb-geolite2.nix {};
psycopg2-binary = pyFinal.callPackage ./python/psycopg2-binary.nix {};
traceback-with-variables = pyFinal.callPackage ./python/traceback-with-variables.nix {};
pydantic = pyFinal.callPackage ./python/pydantic.nix {};
# indirect dependencies
# taxjar
jsonobject = pyFinal.callPackage ./python/jsonobject.nix {};
# redisearch
rejson = pyFinal.callPackage ./python/rejson.nix {};
versioningit = pyPrev.versioningit.overridePythonAttrs (oldAttrs: (rec {
version = "2.2.1";
src = pyPrev.fetchPypi {
inherit version;
inherit (oldAttrs) pname;
hash = "sha256-DlgkLXq9phrmNZalSUrp7WMayF2Ls8yOF24yU8pLy7U=";
};
}));
fastapi = pyPrev.fastapi.overridePythonAttrs (oldAttrs: (rec {
propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [
pyPrev.pydantic-settings
pyPrev.pydantic-extra-types
];
}));
plaid-python = pyPrev.plaid-python.overridePythonAttrs (oldAttrs: (rec {
version = "7.2.1";

15
python/barcodenumber.nix Normal file
View file

@ -0,0 +1,15 @@
{
buildPythonPackage,
fetchPypi,
}:
buildPythonPackage rec {
pname = "barcodenumber";
version = "0.2.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-nW8+m32i42kLR4oC4lrKoBkFYgKHgpZPGAFNJvtLMhc=";
};
propagatedBuildInputs = [ ];
nativeBuildInputs = [ ];
doCheck = false;
}

View file

@ -6,18 +6,16 @@
# Core dependencies
, pycountry
, python-stdnum
, unidecode
, redisearch
, barcodenumber
, rapidfuzz
, holidays
# Integration dependencies
, gocardless-pro
, googlemaps
, plaid-python
, python-youtube
, taxjar
, tweepy
, pypng
}:
let
pinData = import ../srcs/pin.nix;
@ -47,17 +45,16 @@ buildPythonPackage rec {
propagatedBuildInputs = [
# Core dependencies
pycountry
python-stdnum
unidecode
redisearch
barcodenumber
rapidfuzz
holidays
# Integration dependencies
gocardless-pro
googlemaps
plaid-python
python-youtube
taxjar
tweepy
# used for QR code generation
pypng
];
}

View file

@ -8,12 +8,13 @@
, babel
, click
, filelock
, filetype
, gitpython
, jinja2
, pillow
, pyjwt
, pymysql
, pypdf2
, pypdf
, pypika
, pyqrcode
, pyyaml
@ -30,7 +31,6 @@
, cryptography
, email-reply-parser
, git-url-parse
, gitdb
, gunicorn
, html5lib
, ipython
@ -47,12 +47,9 @@
, premailer
, psutil
, psycopg2-binary
, pyasn1
, pycountry
, pycryptodome
, pydantic
, pyopenssl
, pyotp
, pypng
, python-dateutil
, pytz
, rauth
@ -63,11 +60,11 @@
, rq
, rsa
, semantic-version
, sentry-sdk
, sqlparse
, tenacity
, terminaltables
, traceback-with-variables
, urllib3
, xlrd
, zxcvbn
, markdownify
@ -76,7 +73,6 @@
, boto3
, dropbox
, google-api-python-client
, google-auth-httplib2
, google-auth-oauthlib
, google-auth
, posthog
@ -100,48 +96,18 @@ buildPythonPackage rec {
format = "pyproject";
nativeBuildInputs = [ pythonRelaxDepsHook flit-core ];
pythonRelaxDeps = [
"Babel"
"beautifulsoup4"
"boto3"
"cairocffi"
"Click"
"croniter"
"cryptography"
"filelock"
"google-api-python-client"
"google-auth"
"hiredis"
"ipython"
"openpyxl"
"phonenumbers"
"Pillow"
"pyasn1"
"pycountry"
"pycryptodome"
"PyJWT"
"PyMySQL"
"pyOpenSSL"
"pyotp"
"pypng"
"pytz"
"redis"
"requests"
"rq"
"tenacity"
"WeasyPrint"
];
propagatedBuildInputs = [
babel
click
filelock
filetype
gitpython
jinja2
pillow
pyjwt
pymysql
pypdf2
pypdf
pypika
pyqrcode
pyyaml
@ -158,7 +124,6 @@ buildPythonPackage rec {
cryptography
email-reply-parser
git-url-parse
gitdb
gunicorn
html5lib
ipython
@ -175,12 +140,9 @@ buildPythonPackage rec {
premailer
psutil
psycopg2-binary
pyasn1
pycountry
pycryptodome
pydantic
pyopenssl
pyotp
pypng
python-dateutil
pytz
rauth
@ -191,11 +153,11 @@ buildPythonPackage rec {
rq
rsa
semantic-version
sentry-sdk
sqlparse
tenacity
terminaltables
traceback-with-variables
urllib3
xlrd
zxcvbn
markdownify
@ -204,7 +166,6 @@ buildPythonPackage rec {
boto3
dropbox
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
google-auth
posthog

View file

@ -1,19 +0,0 @@
{
buildPythonPackage,
fetchPypi,
requests,
six
}:
buildPythonPackage rec {
pname = "gocardless-pro";
version = "1.22.0";
src = fetchPypi {
pname = "gocardless_pro";
inherit version;
sha256 = "sha256-i4gBeJvl/aCujeXGvJG+z1Wp2aczKg8clnfMyK8fz/w=";
};
propagatedBuildInputs = [
requests
six
];
}

View file

@ -1,17 +0,0 @@
{
buildPythonPackage,
fetchPypi,
cython,
six
}:
buildPythonPackage rec {
pname = "jsonobject";
version = "2.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-UpijeVA+Q+/Aq0AC10LA/LuhqWKO3azE6lR7cThRRGY=";
};
propagatedBuildInputs = [ six ];
nativeBuildInputs = [ cython ];
doCheck = false;
}

85
python/pydantic.nix Normal file
View file

@ -0,0 +1,85 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, hatchling
, hatch-fancy-pypi-readme
, libxcrypt
, annotated-types
, pydantic-core
, typing-extensions
, email-validator
, dirty-equals
, faker
, pytestCheckHook
, pytest-mock
}:
buildPythonPackage rec {
pname = "pydantic";
version = "2.3.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "pydantic";
repo = "pydantic";
rev = "refs/tags/v${version}";
hash = "sha256-toqrWg8bYzc3UmvG/YmXawfmT8nqaA9fxy24k1cdj+M=";
};
buildInputs = lib.optionals (pythonOlder "3.9") [
libxcrypt
];
nativeBuildInputs = [
hatch-fancy-pypi-readme
hatchling
];
propagatedBuildInputs = [
annotated-types
pydantic-core
typing-extensions
];
passthru.optional-dependencies = {
email = [
email-validator
];
};
nativeCheckInputs = [
dirty-equals
faker
pytest-mock
pytestCheckHook
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
preCheck = ''
export HOME=$(mktemp -d)
substituteInPlace pyproject.toml \
--replace "'--benchmark-columns', 'min,mean,stddev,outliers,rounds,iterations'," "" \
--replace "'--benchmark-group-by', 'group'," "" \
--replace "'--benchmark-warmup', 'on'," "" \
--replace "'--benchmark-disable'," ""
'';
disabledTestPaths = [
"tests/benchmarks"
# avoid cyclic dependency
"tests/test_docs.py"
];
pythonImportsCheck = [ "pydantic" ];
meta = with lib; {
description = "Data validation and settings management using Python type hinting";
homepage = "https://github.com/pydantic/pydantic";
changelog = "https://github.com/pydantic/pydantic/blob/v${version}/HISTORY.md";
license = licenses.mit;
maintainers = with maintainers; [ wd15 ];
};
}

View file

@ -1,28 +0,0 @@
{ buildPythonPackage
, fetchPypi
, pythonRelaxDepsHook
, unittestCheckHook
, redis
, rejson
, hiredis
}:
buildPythonPackage rec {
pname = "redisearch";
version = "2.1.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-V1rNWhOhB/8AXUVyoTa1A7Evpb8mr8N70R9qkj8exzw=";
};
nativeBuildInputs = [ pythonRelaxDepsHook ];
pythonRelaxDeps = [
"redis"
];
propagatedBuildInputs = [
redis
rejson
hiredis
];
nativeCheckInputs = [
unittestCheckHook
];
}

View file

@ -1,24 +0,0 @@
{ buildPythonPackage
, pythonRelaxDepsHook
, unittestCheckHook
, fetchPypi
, redis
, six
}:
buildPythonPackage rec {
pname = "rejson";
version = "0.5.6";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-vs3hNSAAUAi3ls5WyxKOsiUC18addIJv81HNQ79zvJc=";
};
nativeBuildInputs = [ pythonRelaxDepsHook ];
pythonRelaxDeps = [
"redis"
];
propagatedBuildInputs = [
redis
six
];
doCheck = false;
}

View file

@ -1,22 +0,0 @@
{
buildPythonPackage,
fetchPypi,
jsonobject,
requests,
mock
}:
buildPythonPackage rec {
pname = "taxjar";
version = "1.9.2";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-c8lkCLzEmNTuBYLyVNRQq4SLSveDpNKKf6NHxHpg7Ec=";
};
propagatedBuildInputs = [
jsonobject
requests
];
checkInputs = [
mock
];
}