Skip to content

Conversation

jrwalk
Copy link
Contributor

@jrwalk jrwalk commented Jun 14, 2021

Change Summary

This PR adds support for configuring the pydantic-mypy plugin in pyproject.toml, as well as the previous mypy.ini config file, enabling full compatibility with mypy>0.900.

Configuration behavior should be consistent with prior behavior from mypy.ini, with enumerated slots populated from the pydantic-mypy configuration section, and with non-boolean options resulting in a ValueError.

Note that this increases the pinned mypy version in the testing suite to 0.901, and includes some formatting changes for compatibility to the test cases. However, the plugin behavior is the same in earlier versions of mypy.

Related issue number

Resolves #2895

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@jrwalk jrwalk changed the title Toml support Toml support for pydantic-mypy plugin config Jun 14, 2021
@jrwalk
Copy link
Contributor Author

jrwalk commented Jun 14, 2021

This should be ready, please review!

@SnoopJ
Copy link

SnoopJ commented Sep 2, 2021

@samuelcolvin @PrettyWood is anything other than resolving the implicit dependency needed to get this merged? I'd love to stop organizing project configuration around the plugin's idiosyncratic parsing, and the PR looks great otherwise.

Copy link
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks a lot 😊
Just need to rebase/merge and update the changelog to be more digest

@PrettyWood
Copy link
Collaborator

Please update.

@github-actions github-actions bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Sep 4, 2021
@github-actions github-actions bot assigned jrwalk and unassigned samuelcolvin and PrettyWood Sep 4, 2021
@jrwalk
Copy link
Contributor Author

jrwalk commented Sep 5, 2021

@PrettyWood should be good to go!

Copy link
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

Thank you so much 🙏

@PrettyWood PrettyWood added ready for review and removed awaiting author revision awaiting changes from the PR author labels Sep 5, 2021
@PrettyWood PrettyWood merged commit 0c2f69c into pydantic:master Sep 5, 2021
@jrwalk jrwalk deleted the toml-support branch September 5, 2021 18:34
@jrwalk
Copy link
Contributor Author

jrwalk commented Sep 5, 2021

Thanks for the review @PrettyWood, glad to help!

@kkirsche
Copy link

kkirsche commented Oct 5, 2021

Is there a plan for when this will be released? The last tagged release of pydantic appears to have been in May

jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Oct 7, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Dec 4, 2021
* add toml reader

* fix path

* skip configparser step

* fix quotes

* full pyproject.toml check

* add doc note

* cleaner formatting, raise ValueError for non-bool

* fix tests

* add bad config test case

* add changelog file.

* bump mypy to 0.902

* tweak change MD, fix formatting in requirements

* import check around toml

* switch to tomli for parsing to match mypy dependency

* import check around toml/tomli

* add note on tomli usage

* more succinct changelog entry

* fix quotes in changelog

* linting fixes, remove unnecessary stub install

* mypy checks on mypy plugin file

* wrongly placed pragma no cover

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pydantic-mypy plugin is incompatible with pyproject.toml config in mypy>0.900
5 participants