Skip to content

Source root not correctly used #10026

@Julfried

Description

@Julfried

Bug description

I have a package that sits in a child folder of the current working directory (./src). Now if I want to to run pyreverse for this module I add ./src as a source-root. However pyreverse does not find the module.

Here is an example:

ex/ └── src/ ├── __init__.py └── mymodule/ ├── __init__.py └── testmodule.py

Configuration

No response

Command used

pyreverse -o html --source-root ./src mymodule

Pylint output

raise ImportError(f"No module named {'.'.join(module_parts)}")
ImportError: No module named mymodule

Expected behavior

When specifiy source-roots, pyreverse should also search the modules in this path

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 15:47:54) [MSC v.1941 64 bit (AMD64)]

OS / Environment

win64

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs investigation 🔬A bug or crash where it's not immediately obvious what is happenningpyreverseRelated to pyreverse component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions