Skip to content

Commit

Permalink
[python] fix 3.13 support for pylsp and dev tools (#369668)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcstephens authored Jan 2, 2025
2 parents 753f9a3 + e431f9a commit 042d318
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
8 changes: 4 additions & 4 deletions pkgs/development/python-modules/astroid/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@

buildPythonPackage rec {
pname = "astroid";
version = "3.3.5"; # Check whether the version is compatible with pylint
version = "3.3.8"; # Check whether the version is compatible with pylint
pyproject = true;

disabled = pythonOlder "3.8";

src = fetchFromGitHub {
owner = "PyCQA";
repo = "astroid";
rev = "refs/tags/v${version}";
hash = "sha256-IFcBb0BP0FRYCztV3FscBPTDeKrGbr23nxeibSuNRno=";
tag = "v${version}";
hash = "sha256-KKQuLomCHhVYMX1gE9WuqbXOfsf2izGlLE0Ml62gY3k=";
};

nativeBuildInputs = [ setuptools ];
Expand All @@ -38,7 +38,7 @@ buildPythonPackage rec {
};

meta = with lib; {
changelog = "https://github.com/PyCQA/astroid/blob/${src.rev}/ChangeLog";
changelog = "https://github.com/PyCQA/astroid/blob/v${version}/ChangeLog";
description = "Abstract syntax tree for Python with inference support";
homepage = "https://github.com/PyCQA/astroid";
license = licenses.lgpl21Plus;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/mypy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

buildPythonPackage rec {
pname = "mypy";
version = "1.13.0";
version = "1.14.1";
pyproject = true;

disabled = pythonOlder "3.8";
Expand All @@ -41,7 +41,7 @@ buildPythonPackage rec {
owner = "python";
repo = "mypy";
rev = "refs/tags/v${version}";
hash = "sha256-P2Ozmj7/7QBmjlveHLsNdYgUAerg0qOoa8pO0iQc5os=";
hash = "sha256-Ha7icLFc4BL7a3NECcwX4dtWmkXctANCqu/IbrEnmjw=";
};

passthru.updateScript = gitUpdater {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/pylint/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

buildPythonPackage rec {
pname = "pylint";
version = "3.3.1";
version = "3.3.3";
pyproject = true;

disabled = pythonOlder "3.8";

src = fetchFromGitHub {
owner = "pylint-dev";
repo = "pylint";
rev = "refs/tags/v${version}";
hash = "sha256-cnMYHHtIRxIySfZV0jTn+OFji+72cOReyNNDiJ9pbAg=";
tag = "v${version}";
hash = "sha256-ldeosRAjh60aB5db/ojtttvevhpKQa3wk7u8MpTq13Q=";
};

build-system = [ setuptools ];
Expand Down
12 changes: 9 additions & 3 deletions pkgs/development/python-modules/python-lsp-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,

# build-system
Expand Down Expand Up @@ -127,9 +128,14 @@ buildPythonPackage rec {
"test_jedi_completion_with_fuzzy_enabled"
];

preCheck = ''
export HOME=$(mktemp -d);
'';
preCheck =
''
export HOME=$(mktemp -d);
''
# https://github.com/python-lsp/python-lsp-server/issues/605
+ lib.optionalString (pythonAtLeast "3.13") ''
substituteInPlace test/conftest.py --replace-fail logging.DEBUG logging.INFO
'';

pythonImportsCheck = [
"pylsp"
Expand Down
20 changes: 14 additions & 6 deletions pkgs/development/python-modules/rope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
pytoolconfig,
pytest-timeout,
pytestCheckHook,
pythonAtLeast,
pythonOlder,
setuptools,
}:
Expand All @@ -19,7 +20,7 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "python-rope";
repo = "rope";
rev = "refs/tags/${version}";
tag = version;
hash = "sha256-g/fta5gW/xPs3VaVuLtikfLhqCKyy1AKRnOcOXjQ8bA=";
};

Expand All @@ -34,11 +35,18 @@ buildPythonPackage rec {
pytestCheckHook
];

disabledTests = [
"test_search_submodule"
"test_get_package_source_pytest"
"test_get_modname_folder"
];
disabledTests =
[
"test_search_submodule"
"test_get_package_source_pytest"
"test_get_modname_folder"
]
++ lib.optionals (pythonAtLeast "3.13") [
# https://github.com/python-rope/rope/issues/801
"test_skipping_directories_not_accessible_because_of_permission_error"
"test_hint_parametrized_iterable"
"test_hint_parametrized_iterator"
];

meta = with lib; {
description = "Python refactoring library";
Expand Down

0 comments on commit 042d318

Please sign in to comment.