Skip to content

[maintenance] Drop the brain for nose, filter warning on tests for old style namespace packages #2765

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

Merged
merged 2 commits into from
Jun 27, 2025
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
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Release date: TBA

Closes #2608

* The brain for nose was dropped. nose has been deprecated for 10 years and the brain required some maintenance.

Refs #2765

What's New in astroid 3.3.11?
=============================
Release date: TBA
Expand Down
79 changes: 0 additions & 79 deletions astroid/brain/brain_nose.py

This file was deleted.

2 changes: 0 additions & 2 deletions astroid/brain/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def register_all_brains(manager: AstroidManager) -> None:
brain_mechanize,
brain_multiprocessing,
brain_namedtuple_enum,
brain_nose,
brain_numpy_core_einsumfunc,
brain_numpy_core_fromnumeric,
brain_numpy_core_function_base,
Expand Down Expand Up @@ -99,7 +98,6 @@ def register_all_brains(manager: AstroidManager) -> None:
brain_mechanize.register(manager)
brain_multiprocessing.register(manager)
brain_namedtuple_enum.register(manager)
brain_nose.register(manager)
brain_numpy_core_einsumfunc.register(manager)
brain_numpy_core_fromnumeric.register(manager)
brain_numpy_core_function_base.register(manager)
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ module = [
"_io.*",
"gi.*",
"importlib.*",
"nose.*",
"numpy.*",
"pytest",
"setuptools",
Expand Down
1 change: 0 additions & 1 deletion requirements_full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Packages used to run additional tests
attrs
nose
numpy>=1.17.0,<2; python_version<"3.12"
python-dateutil
PyQt6
Expand Down
45 changes: 0 additions & 45 deletions tests/brain/test_nose.py

This file was deleted.

11 changes: 9 additions & 2 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,15 @@ def test_ast_from_namespace_pkg_resources(self) -> None:
def test_identify_old_namespace_package_protocol(self) -> None:
# Like the above cases, this package follows the old namespace package protocol
# astroid currently assumes such packages are in sys.modules, so import it
# pylint: disable-next=import-outside-toplevel
import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=UserWarning,
message=".*pkg_resources is deprecated.*",
)

# pylint: disable-next=import-outside-toplevel
import tests.testdata.python3.data.path_pkg_resources_1.package.foo as _ # noqa

self.assertTrue(
util.is_namespace("tests.testdata.python3.data.path_pkg_resources_1")
Expand Down