Skip to content
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

Explicitly export values on factory namespace #1114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ChangeLog
3.3.4 (unreleased)
------------------

- Nothing changed yet.
- Values on the `factory` namespace are now explicitly exported.


3.3.3 (2025-02-03)
Expand Down
64 changes: 64 additions & 0 deletions factory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,86 @@
stub_batch,
)


__all__ = [
"BUILD_STRATEGY",
"BaseDictFactory",
"BaseListFactory",
"CREATE_STRATEGY",
"ContainerAttribute",
"Dict",
"DictFactory",
"Factory",
"FactoryError",
"Faker",
"Iterator",
"LazyAttribute",
"LazyAttributeSequence",
"LazyFunction",
"List",
"ListFactory",
"Maybe",
"PostGeneration",
"PostGenerationMethodCall",
"RelatedFactory",
"RelatedFactoryList",
"STUB_STRATEGY",
"SelfAttribute",
"Sequence",
"StubFactory",
"SubFactory",
"Trait",
"Transformer",
"build",
"build_batch",
"container_attribute",
"create",
"create_batch",
"debug",
"generate",
"generate_batch",
"iterator",
"lazy_attribute",
"lazy_attribute_sequence",
"make_factory",
"post_generation",
"sequence",
"simple_generate",
"simple_generate_batch",
"stub",
"stub_batch",
"use_strategy",
]


try:
from . import alchemy
except ImportError:
pass
else:
__all__.append("alchemy")

try:
from . import django
except ImportError:
pass
else:
__all__.append("django")

try:
from . import mogo
except ImportError:
pass
else:
__all__.append("mogo")

try:
from . import mongoengine
except ImportError:
pass
else:
__all__.append("mongoengine")


__author__ = 'Raphaël Barrois <[email protected]>'
__version__ = importlib.metadata.version("factory_boy")