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

User config for generators #35

Merged
merged 7 commits into from
Feb 9, 2023
Merged

User config for generators #35

merged 7 commits into from
Feb 9, 2023

Conversation

mhauru
Copy link
Collaborator

@mhauru mhauru commented Jan 24, 2023

Implements a method for providing custom generators and user configurations for which generators to use for which tables.

@mhauru mhauru marked this pull request as ready for review February 3, 2023 17:38
@mhauru mhauru requested a review from Iain-S February 3, 2023 17:38
@mhauru
Copy link
Collaborator Author

mhauru commented Feb 3, 2023

@Iain-S do you know the best way to deal with mypy complaining about missing type stubs for dependencies? The pre-commit fails because of missing type information for pyyaml.

@Iain-S
Copy link
Collaborator

Iain-S commented Feb 6, 2023

@mhauru I think we could add types-PyYAML as a dev dependency with poetry add --group dev.



class TimespanProvider(BaseProvider):
"""A Mimesis provider for timespans, consisting of start datetime, end datetime, and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you shorten the opening line of the docstring to <= 80 chars and move the rest to the body? Perhaps:

Suggested change
"""A Mimesis provider for timespans, consisting of start datetime, end datetime, and
"""A Mimesis provider for timespans.
A triple of start datetime, end datetime, and the timedelta in between.
"""

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. We generally stick to 88 chars, right? A special rule for first lines of docstrings to follow the PEP8 max of 79?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It looks like the recommended line length for docstrings and comments is actually 72 chars, regardless of whether you increase the max allowed code line length. Though they don't really give a justification for that.

@mhauru mhauru requested a review from Iain-S February 9, 2023 14:58
@mhauru mhauru merged commit 1f7070b into main Feb 9, 2023
@Iain-S Iain-S deleted the custom-providers branch February 14, 2023 18:09
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.

2 participants