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

WIP: Add an auto-converter, converters and validators #701

Closed
wants to merge 1 commit into from

Conversation

sscherfke
Copy link
Contributor

Fixes: #649

Pull Request Check List

This is just a friendly reminder about the most common mistakes. Please make sure that you tick all boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing left to do. If your pull request is a documentation fix or a trivial typo, feel free to delete the whole thing.

  • Added tests for changed code.
  • New features have been added to our Hypothesis testing strategy.
  • Changes or additions to public APIs are reflected in our type stubs (files ending in .pyi).
    • ...and used in the stub test file tests/typing_example.py.
  • Updated documentation for changed code.
    • New functions/classes have to be added to docs/api.rst by hand.
    • Changes to the signature of @attr.s() have to be added by hand too.
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives. Find the appropriate next version in our __init__.py file.
  • Documentation in .rst files is written using semantic newlines.
  • Changes (and possible deprecations) have news fragments in changelog.d.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

@sscherfke sscherfke changed the title WIP Add an auto-converter, converters and validators WIP: Add an auto-converter, converters and validators Oct 15, 2020
@sscherfke
Copy link
Contributor Author

This is PR is based on #653 and adds actual converters and validators for attrs classes. These should be complete enough to cover most use cases for API clients and settings loaders.

The current state of the PR should be functionally complete, but some docs are still missing.

I will be available for help if bugs or issues should arrise with the code of this PR.

@sscherfke
Copy link
Contributor Author

@hynek What do you generally think about this PR? Shall I continue working on it?

@hynek
Copy link
Member

hynek commented Oct 17, 2020

Hmmm I think this would be better served as an external proof of concept before we bake it into attrs?

@sscherfke
Copy link
Contributor Author

I could put it into typed-settings for a while. From there I could also use it for some API clients.

Should this PR remain open?

@hynek
Copy link
Member

hynek commented Oct 18, 2020

We should have a place to regularly touch base but maybe your original ticket is better for that, since it has more history?

@sscherfke
Copy link
Contributor Author

Okay, let's do that. I’ll create a new PR once you think these changes are ready to be integrated into attrs.

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.

[RFC] Add optional automatic validation and conversion
2 participants