Skip to content

Add methods, classes to __all__ to indicate availability for public use. - #1157

Open
powlo wants to merge 1 commit into
FactoryBoy:masterfrom
powlo:fixup-factory-all
Open

powlo wants to merge 1 commit into
FactoryBoy:masterfrom
powlo:fixup-factory-all

Conversation

@powlo

@powlo powlo commented Aug 19, 2026

Copy link
Copy Markdown

pyright/pylance don't recognise the declarations in factory/__init__.py as legitimate, which seems to be in-line with typing documentation. Example:

# example.py
import factory

class User:
    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname


class UserFactory(factory.Factory):
    class Meta:
        model = User

    firstname = "John"
    lastname = "Doe"
% pyright example.py 
...
...example.py:10:27 - error: "Factory" is not exported from module "factory" (reportPrivateImportUsage)
...

This PR fixes the issue by adding __all__ to __init__.py.

@powlo powlo changed the title Add methods, classes to __init__ to indicate availability for public use. Add methods, classes to __all__ to indicate availability for public use. Aug 19, 2026
@powlo
powlo force-pushed the fixup-factory-all branch from 4b9f5e6 to d5843f3 Compare August 19, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant