Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[staging-next] fix python modules #324820

Merged
merged 14 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pkgs/development/python-modules/ansible-runner/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
importlib-metadata,
mock,
openssh,
packaging,
pexpect,
psutil,
pytest-mock,
pytest-timeout,
pytest-xdist,
Expand All @@ -19,33 +19,35 @@
pyyaml,
setuptools,
setuptools-scm,
six,
}:

buildPythonPackage rec {
pname = "ansible-runner";
version = "2.4.0";
pyproject = true;

disabled = pythonOlder "3.8";
disabled = pythonOlder "3.9";

src = fetchPypi {
inherit pname version;
hash = "sha256-gtArJUiDDzelNRe2XII8SvNxBpQGx9ITtckEHUXgxbY=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace '"setuptools>=45, <=69.0.2", "setuptools-scm[toml]>=6.2, <=8.0.4"' '"setuptools", "setuptools-scm"'
'';

build-system = [
setuptools
setuptools-scm
];

dependencies = [
ansible-core
psutil
packaging
pexpect
python-daemon
pyyaml
six
] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];

nativeCheckInputs = [
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/anthropic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
hatch-fancy-pypi-readme,
hatchling,
httpx,
jiter,
pydantic,
pytest-asyncio,
pytestCheckHook,
Expand Down Expand Up @@ -42,6 +43,7 @@ buildPythonPackage rec {
anyio
distro
httpx
jiter
sniffio
pydantic
tokenizers
Expand Down
14 changes: 6 additions & 8 deletions pkgs/development/python-modules/clarifai/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,18 @@ buildPythonPackage rec {
hash = "sha256-zAjGVICrYgai6GFpcJyigKxn7kNEZKclggR5ktzrCQ0=";
};

pythonRelaxDeps = [ "clarifai-grpc" ];

pythonRemoveDeps = [ "opencv-python" ];
pythonRelaxDeps = [
"clarifai-grpc"
"schema"
];

build-system = [ setuptools ];


dependencies = [
clarifai-grpc
inquirerpy
llama-index-core
numpy
opencv4
pandas
pillow
pypdf
pyyaml
rich
schema
Expand All @@ -73,6 +69,8 @@ buildPythonPackage rec {
disabledTests = [
# Test requires network access and API key
"test_export_workflow_general"
"test_validate_invalid_id"
"test_validate_invalid_hex_id"
];

disabledTestPaths = [
Expand Down
52 changes: 52 additions & 0 deletions pkgs/development/python-modules/dbt-adapters/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
agate,
dbt-common,
mashumaro,
protobuf,
pytz,
typing-extensions,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "dbt-adapters";
version = "1.3.2";
pyproject = true;

src = fetchFromGitHub {
owner = "dbt-labs";
repo = "dbt-adapters";
rev = "refs/tags/v${version}";
hash = "sha256-Erx/j1x+I4ypPqBFzJRZk3ILr3ZG97Hvk4vXe2p6cDc=";
};

build-system = [ hatchling ];

dependencies = [
agate
dbt-common
mashumaro
protobuf
pytz
typing-extensions
] ++ mashumaro.optional-dependencies.msgpack;

pythonImportsCheck = [ "dbt.adapters" ];

# circular dependencies
doCheck = false;

nativeCheckInputs = [ pytestCheckHook ];

meta = {
description = "The set of adapter protocols and base functionality that supports integration with dbt-core";
homepage = "https://github.com/dbt-labs/dbt-adapters";
changelog = "https://github.com/dbt-labs/dbt-adapters/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ];
};
}
65 changes: 65 additions & 0 deletions pkgs/development/python-modules/dbt-common/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
agate,
colorama,
isodate,
jinja2,
jsonschema,
mashumaro,
pathspec,
protobuf,
python-dateutil,
requests,
typing-extensions,
pytest-mock,
pytest-xdist,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "dbt-common";
version = "1.3.0";
pyproject = true;

src = fetchFromGitHub {
owner = "dbt-labs";
repo = "dbt-common";
rev = "refs/tags/v${version}";
hash = "sha256-3UjwQy257ks21fQV0uZNKu5EsuzjlIAEcVtRWkR9x/4=";
};

build-system = [ hatchling ];

dependencies = [
agate
colorama
isodate
jinja2
jsonschema
mashumaro
pathspec
protobuf
python-dateutil
requests
typing-extensions
] ++ mashumaro.optional-dependencies.msgpack;

pythonImportsCheck = [ "dbt_common" ];

nativeCheckInputs = [
pytest-mock
pytest-xdist
pytestCheckHook
];

meta = {
description = "Shared common utilities for dbt-core and adapter implementations use";
homepage = "https://github.com/dbt-labs/dbt-common";
changelog = "https://github.com/dbt-labs/dbt-common/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ];
};
}
21 changes: 7 additions & 14 deletions pkgs/development/python-modules/dbt-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
lib,
agate,
buildPythonPackage,
cffi,
click,
colorama,
daff,
dbt-adapters,
dbt-common,
dbt-extractor,
dbt-semantic-interfaces,
fetchFromGitHub,
hologram,
idna,
isodate,
jinja2,
logbook,
mashumaro,
Expand All @@ -27,8 +25,6 @@
setuptools,
sqlparse,
typing-extensions,
urllib3,
werkzeug,
}:

buildPythonPackage rec {
Expand All @@ -50,6 +46,7 @@ buildPythonPackage rec {
pythonRelaxDeps = [
"agate"
"click"
"dbt-semantic-interfaces"
"mashumaro"
"networkx"
"logbook"
Expand All @@ -63,14 +60,12 @@ buildPythonPackage rec {

dependencies = [
agate
cffi
click
colorama
daff
dbt-adapters
dbt-common
dbt-extractor
dbt-semantic-interfaces
hologram
idna
isodate
jinja2
logbook
mashumaro
Expand All @@ -84,8 +79,6 @@ buildPythonPackage rec {
requests
sqlparse
typing-extensions
urllib3
werkzeug
] ++ mashumaro.optional-dependencies.msgpack;

# tests exist for the dbt tool but not for this package specifically
Expand Down
25 changes: 18 additions & 7 deletions pkgs/development/python-modules/dbt-postgres/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,39 @@
lib,
agate,
buildPythonPackage,
fetchFromGitHub,
dbt-adapters,
dbt-common,
dbt-core,
hatchling,
psycopg2,
pythonOlder,
setuptools,
}:

buildPythonPackage {
buildPythonPackage rec {
pname = "dbt-postgres";
version = "1.8.2";
pyproject = true;

inherit (dbt-core) version src;
disabled = pythonOlder "3.8";

disabled = pythonOlder "3.7";

sourceRoot = "${dbt-core.src.name}/plugins/postgres";
src = fetchFromGitHub {
owner = "dbt-labs";
repo = "dbt-postgres";
rev = "refs/tags/v${version}";
hash = "sha256-E7Y2lY8aCiAZx5sLWwpOBLTrdOsCQAdWWJTvR2jGOaA=";
};

env.DBT_PSYCOPG2_NAME = "psycopg2";

build-system = [ setuptools ];
build-system = [ hatchling ];

pythonRemoveDeps = [ "psycopg2-binary" ];

dependencies = [
agate
dbt-adapters
dbt-common
dbt-core
psycopg2
];
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/duckdb-engine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pandas,
poetry-core,
pytest-remotedata,
snapshottest,
sqlalchemy,
typing-extensions,
}:
Expand Down Expand Up @@ -44,6 +45,7 @@ buildPythonPackage rec {
hypothesis
pandas
pytest-remotedata
snapshottest
typing-extensions
];

Expand Down
11 changes: 11 additions & 0 deletions pkgs/development/python-modules/gpytorch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
linear-operator,
scikit-learn,
setuptools,
Expand All @@ -23,6 +24,16 @@ buildPythonPackage rec {
hash = "sha256-cpkfjx5G/4duL1Rr4nkHTHi03TDcYbcx3bKP2Ny7Ijo=";
};

patches = [
(fetchpatch {
# https://github.com/cornellius-gp/gpytorch/pull/2545
name = "scipy-1.14-compatibility.patch";
url = "https://github.com/cornellius-gp/gpytorch/commit/2562be472521b8aec366de2619e3130a96fab982.patch";
excludes = [ "setup.py" ];
hash = "sha256-znOFpN6go2iIxP24VjJLKF3Laxcr4xV/IyP2y36g4QY=";
})
];

nativeBuildInputs = [
setuptools
setuptools-scm
Expand Down
Loading