Skip to content

PyLint no-member errors #616

Open
Open
@rkr87

Description

@rkr87

I'm in the process of adding DI to one of my existing projects and everything is working well except I do seem to be getting a few PyLint errors, as below;

Application Class

class Application(containers.DeclarativeContainer):

    wrappers = providers.Container(
        Wrappers
    )

    services = providers.Container(
        Services,
        igdb_wrapper=wrappers.igdb_wrapper,
        steam_wrapper=wrappers.steam_wrapper
    )

    repos = providers.Container(
        Repositories,
        igdb_service=services.igdb_service,
        steam_service=services.steam_service,
        local_service=services.local_service
    )

PyLint Errors

distiller/di/application.py:18:21: E1101: Instance of 'Container' has no 'igdb_wrapper' member (no-member)
distiller/di/application.py:19:22: E1101: Instance of 'Container' has no 'steam_wrapper' member (no-member)
distiller/di/application.py:24:21: E1101: Instance of 'Container' has no 'igdb_service' member (no-member)
distiller/di/application.py:25:22: E1101: Instance of 'Container' has no 'steam_service' member (no-member)
distiller/di/application.py:27:22: E1101: Instance of 'Container' has no 'local_service' member (no-member)

Now, those members are defined in my containers, I was tempted to just add an ignore flag to the relevant lines but thought I'd post here first to see if this is something I've setup incorrectly.

Below is my Services and Wrappers containers.

Services

class Services(containers.DeclarativeContainer):

    igdb_wrapper = providers.Dependency(IGDBWrapper)
    steam_wrapper = providers.Dependency(SteamWrapper)

    igdb_service = providers.Singleton(IGDBService, igdb_wrapper)
    steam_service = providers.Singleton(SteamService, steam_wrapper)
    local_service = providers.Singleton(LocalService)

Wrappers

class Wrappers(containers.DeclarativeContainer):

    igdb_wrapper = providers.Singleton(IGDBWrapper)
    steam_wrapper = providers.Singleton(SteamWrapper)

Thanks for any support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions