From 58bd31cfa171b07c97f5f87f96a52a4bea187319 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Oct 2022 13:33:13 +0200 Subject: [PATCH 1/4] python310Packages.sentry-sdk: 1.9.9 -> 1.9.10 --- pkgs/development/python-modules/sentry-sdk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sentry-sdk/default.nix b/pkgs/development/python-modules/sentry-sdk/default.nix index 70635de5e4f7..cd052afdacb3 100644 --- a/pkgs/development/python-modules/sentry-sdk/default.nix +++ b/pkgs/development/python-modules/sentry-sdk/default.nix @@ -46,7 +46,7 @@ buildPythonPackage rec { pname = "sentry-sdk"; - version = "1.9.9"; + version = "1.9.10"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -55,7 +55,7 @@ buildPythonPackage rec { owner = "getsentry"; repo = "sentry-python"; rev = version; - hash = "sha256-DIiShIiTHmJdOtf1WYi4ofJdZnsg13VczVvGW+ngE+I="; + hash = "sha256-ZrteALD+HsqUwkFDPih8adxNP5TO5JqdPFI8oMBphY4="; }; propagatedBuildInputs = [ From dbbb1e5ee438cabbbc8f76beb2dc0928956394eb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Oct 2022 16:51:58 +0200 Subject: [PATCH 2/4] python310Packages.pyreadstat: enable tests - add pythonImportsCheck - use module name --- .../python-modules/pyreadstat/default.nix | 43 +++++++++++++++---- pkgs/top-level/python-packages.nix | 4 +- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pyreadstat/default.nix b/pkgs/development/python-modules/pyreadstat/default.nix index 499aa97db8c7..4992d260471c 100644 --- a/pkgs/development/python-modules/pyreadstat/default.nix +++ b/pkgs/development/python-modules/pyreadstat/default.nix @@ -1,14 +1,26 @@ -{ lib, buildPythonPackage, fetchFromGitHub, cython, zlib, pandas, readstat }: +{ lib +, buildPythonPackage +, cython +, fetchFromGitHub +, pandas +, python +, pythonOlder +, readstat +, zlib +}: buildPythonPackage rec { pname = "pyreadstat"; version = "1.1.9"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "Roche"; repo = "pyreadstat"; rev = "v${version}"; - sha256 = "16aa16ybh3ikmlxsg8zm19x9k6r4gpd0sxqagv318w76jjyw1nrs"; + hash = "sha256-OtvAvZTmcBTGfgp3Ddp9JJuZegr1o6c7rTMOuLwJSpk="; }; nativeBuildInputs = [ @@ -24,11 +36,26 @@ buildPythonPackage rec { pandas ]; - meta = { - homepage = "https://github.com/Roche/pyreadstat"; - description = "Python package to read SAS, SPSS and Stata files into pandas data frames using the readstat C library"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ swflint ]; - }; + pythonImportsCheck = [ + "pyreadstat" + ]; + preCheck = '' + export HOME=$(mktemp -d); + ''; + + checkPhase = '' + runHook preCheck + + ${python.interpreter} tests/test_basic.py + + runHook postCheck + ''; + + meta = with lib; { + description = "Python package to read SAS, SPSS and Stata files into pandas data frames using the readstat C library"; + homepage = "https://github.com/Roche/pyreadstat"; + license = licenses.asl20; + maintainers = with maintainers; [ swflint ]; + }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 75cbf33b249e..f964503b7196 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8413,6 +8413,8 @@ in { pyramid_multiauth = callPackage ../development/python-modules/pyramid_multiauth { }; + pyreadstat = callPackage ../development/python-modules/pyreadstat { }; + pyrealsense2 = toPythonModule (pkgs.librealsense.override { enablePython = true; pythonPackages = self; @@ -9564,8 +9566,6 @@ in { readme_renderer = callPackage ../development/python-modules/readme_renderer { }; - readstats = callPackage ../development/python-modules/pyreadstat { }; - readthedocs-sphinx-ext = callPackage ../development/python-modules/readthedocs-sphinx-ext { }; rebulk = callPackage ../development/python-modules/rebulk { }; From 7e3eb4a0f93864b3dc5bbc48a45c1d1b3ece422a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Oct 2022 16:54:44 +0200 Subject: [PATCH 3/4] python310Packages.pandas-stubs: 1.2.0.39 -> 1.5.0.221003 --- .../python-modules/pandas-stubs/default.nix | 109 +++++++++++++++--- 1 file changed, 93 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/pandas-stubs/default.nix b/pkgs/development/python-modules/pandas-stubs/default.nix index c56847697769..a719f98e9d1d 100644 --- a/pkgs/development/python-modules/pandas-stubs/default.nix +++ b/pkgs/development/python-modules/pandas-stubs/default.nix @@ -1,39 +1,116 @@ { lib , buildPythonPackage -, isPy27 , fetchFromGitHub +, jinja2 +, matplotlib +, openpyxl +, pandas +, poetry-core +, scipy +, sqlalchemy +, tabulate +, pyarrow +, pyreadstat +, tables +, pytestCheckHook +, pythonOlder +, types-pytz , typing-extensions -, mypy +, xarray }: buildPythonPackage rec { pname = "pandas-stubs"; - version = "1.2.0.39"; + version = "1.5.0.221003"; + format = "pyproject"; - disabled = isPy27; + disabled = pythonOlder "3.8"; - # Use GitHub source since PyPi source does not include tests src = fetchFromGitHub { - owner = "VirtusLab"; + owner = "pandas-dev"; repo = pname; - rev = "2bd932777d1050ea8f86c527266a4cd205aa15b1"; - sha256 = "m2McU53NNvRwnWKN9GL8dW1eCGKbTi0471szRQwZu1Q="; + rev = "v${version}"; + sha256 = "sha256-RV0pOTPtlwBmYs3nu8+lNwVpl/VC/VzcXKOQMg9C3qk="; }; - propagatedBuildInputs = [ - typing-extensions + nativeBuildInputs = [ + poetry-core ]; - pythonImportsCheck = [ "pandas" ]; - checkInputs = [ mypy ]; - checkPhase = '' - mypy --config-file mypy.ini third_party/3/pandas tests/snippets - ''; + propagatedBuildInputs = [ + pandas + types-pytz + ]; + + checkInputs = [ + jinja2 + matplotlib + openpyxl + scipy + sqlalchemy + tabulate + pyarrow + tables + pyreadstat + pytestCheckHook + typing-extensions + xarray + ]; + + disabledTests = [ + # AttributeErrors, missing dependencies, error and warning checks + "test_data_error" + "test_specification_error" + "test_setting_with_copy_error" + "test_setting_with_copy_warning" + "test_numexpr_clobbering_error" + "test_undefined_variable_error" + "test_indexing_error" + "test_pyperclip_exception" + "test_css_warning" + "test_possible_data_loss_error" + "test_closed_file_error" + "test_incompatibility_warning" + "test_attribute_conflict_warning" + "test_database_error" + "test_possible_precision_loss" + "test_value_label_type_mismatch" + "test_invalid_column_name" + "test_categorical_conversion_warning" + "test_join" + "test_isetframe" + "test_reset_index_150_changes" + "test_compare_150_changes" + "test_quantile_150_changes" + "test_resample_150_changes" + "test_index_astype" + "test_orc" + "test_orc_path" + "test_orc_buffer" + "test_orc_columns" + "test_orc_bytes" + "test_clipboard" + "test_clipboard_iterator" + "test_arrow_dtype" + "test_aggregate_series_combinations" + "test_aggregate_frame_combinations" + "test_types_rank" + "test_reset_index" + "test_types_assert_series_equal" + "test_show_version" + "test_dummies" + "test_from_dummies_args" + "test_rolling_step_method" + ]; + + pythonImportsCheck = [ + "pandas" + ]; meta = with lib; { description = "Type annotations for Pandas"; homepage = "https://github.com/VirtusLab/pandas-stubs"; license = licenses.mit; - maintainers = [ maintainers.malo ]; + maintainers = with maintainers; [ malo ]; }; } From df475f8b7207c7cc612ea3a470be7436875c40d6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 7 Oct 2022 16:56:39 +0200 Subject: [PATCH 4/4] python310Packages.openai: 0.23.0 -> 0.23.1 --- .../python-modules/openai/default.nix | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/openai/default.nix b/pkgs/development/python-modules/openai/default.nix index 15d3b79e0bbc..b6c539150ccd 100644 --- a/pkgs/development/python-modules/openai/default.nix +++ b/pkgs/development/python-modules/openai/default.nix @@ -1,36 +1,35 @@ { lib , buildPythonPackage , fetchFromGitHub -, pythonOlder - -# Python dependencies +, matplotlib , numpy , openpyxl , pandas , pandas-stubs +, plotly +, pytest-mock +, pytestCheckHook +, pythonOlder , requests , scikit-learn , tenacity , tqdm +, typing-extensions , wandb - -# Check dependencies -, pytest-mock -, pytestCheckHook }: buildPythonPackage rec { pname = "openai"; - version = "0.23.0"; + version = "0.23.1"; + format = "setuptools"; disabled = pythonOlder "3.7.1"; - # Use GitHub source since PyPi source does not include tests src = fetchFromGitHub { owner = "openai"; repo = "openai-python"; rev = "v${version}"; - sha256 = "sha256-VH1XR2FocRX5AYpCruAKwQUXjXqvdJsVwKdtot5Bo+Y="; + hash = "sha256-4RdER6ecvHGXTLZ1GnBNI1hIETI8O/t+kuOXiQhMigs="; }; propagatedBuildInputs = [ @@ -39,18 +38,40 @@ buildPythonPackage rec { pandas pandas-stubs requests - scikit-learn - tenacity tqdm - wandb + typing-extensions + ]; + + passthru.optional-dependencies = { + wandb = [ + wandb + ]; + embeddings = [ + matplotlib + plotly + scikit-learn + tenacity + ]; + }; + + pythonImportsCheck = [ + "openai" + ]; + + checkInputs = [ + pytestCheckHook + pytest-mock + ]; + + pytestFlagsArray = [ + "openai/tests" ]; - pythonImportsCheck = [ "openai" ]; - checkInputs = [ pytestCheckHook pytest-mock ]; - pytestFlagsArray = [ "openai/tests" ]; OPENAI_API_KEY = "sk-foo"; + disabledTestPaths = [ - "openai/tests/test_endpoints.py" # requires a real API key + # Requires a real API key + "openai/tests/test_endpoints.py" "openai/tests/test_file_cli.py" ]; @@ -58,6 +79,6 @@ buildPythonPackage rec { description = "Python client library for the OpenAI API"; homepage = "https://github.com/openai/openai-python"; license = licenses.mit; - maintainers = [ maintainers.malo ]; + maintainers = with maintainers; [ malo ]; }; }