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 {}; honcho = pyFinal.callPackage ./python/honcho.nix {};
# erpnext dependencies # erpnext dependencies
gocardless-pro = pyFinal.callPackage ./python/gocardless-pro.nix {}; barcodenumber = pyFinal.callPackage ./python/barcodenumber.nix {};
redisearch = pyFinal.callPackage ./python/redisearch.nix {};
taxjar = pyFinal.callPackage ./python/taxjar.nix {};
# frappe dependencies # frappe dependencies
email-reply-parser = pyFinal.callPackage ./python/email-reply-parser.nix {}; email-reply-parser = pyFinal.callPackage ./python/email-reply-parser.nix {};
maxminddb-geolite2 = pyFinal.callPackage ./python/maxminddb-geolite2.nix {}; maxminddb-geolite2 = pyFinal.callPackage ./python/maxminddb-geolite2.nix {};
psycopg2-binary = pyFinal.callPackage ./python/psycopg2-binary.nix {}; psycopg2-binary = pyFinal.callPackage ./python/psycopg2-binary.nix {};
traceback-with-variables = pyFinal.callPackage ./python/traceback-with-variables.nix {}; traceback-with-variables = pyFinal.callPackage ./python/traceback-with-variables.nix {};
pydantic = pyFinal.callPackage ./python/pydantic.nix {};
# indirect dependencies versioningit = pyPrev.versioningit.overridePythonAttrs (oldAttrs: (rec {
# taxjar version = "2.2.1";
jsonobject = pyFinal.callPackage ./python/jsonobject.nix {}; src = pyPrev.fetchPypi {
# redisearch inherit version;
rejson = pyFinal.callPackage ./python/rejson.nix {}; 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 { plaid-python = pyPrev.plaid-python.overridePythonAttrs (oldAttrs: (rec {
version = "7.2.1"; 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 # Core dependencies
, pycountry , pycountry
, python-stdnum
, unidecode , unidecode
, redisearch , barcodenumber
, rapidfuzz , rapidfuzz
, holidays
# Integration dependencies # Integration dependencies
, gocardless-pro
, googlemaps , googlemaps
, plaid-python , plaid-python
, python-youtube , python-youtube
, taxjar , pypng
, tweepy
}: }:
let let
pinData = import ../srcs/pin.nix; pinData = import ../srcs/pin.nix;
@ -47,17 +45,16 @@ buildPythonPackage rec {
propagatedBuildInputs = [ propagatedBuildInputs = [
# Core dependencies # Core dependencies
pycountry pycountry
python-stdnum
unidecode unidecode
redisearch barcodenumber
rapidfuzz rapidfuzz
holidays
# Integration dependencies # Integration dependencies
gocardless-pro
googlemaps googlemaps
plaid-python plaid-python
python-youtube python-youtube
taxjar # used for QR code generation
tweepy pypng
]; ];
} }

View file

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