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

Delegate interpreting the yaml away from collection #152

Closed

Conversation

delfick
Copy link
Contributor

@delfick delfick commented May 4, 2024

For #144 I think it'll be useful if the yaml definition can be given more control over how the test actually runs it.

To help with that this PR makes it so that the pytest entry point is less responsible for those decisions, and that there is more separation between the raw definition and the processed idea of what the test should do.

I've split this PR into many commits to make it easier to see the small changes that happen as I move code around (best seen with the github ignore whitespace option).

The notable changes include

  • File is now defined in pytest_mypy_plugins.definition, but I've kept a reference to it from pytest_mypy_plugins.collect
  • When creating the File objects, it dosn't default path to "main.py" because it's mandatory in the schema so it should always have a value anyways
  • I made the skip logic not call eval if skip is a boolean or the strings "True" or "False"
  • made test_input_schema.py use SafeLineLoader
  • Changed the return annotations on the plugin entry point to be less specific as only pytest itself use them and it only cares about the more generic type
  • I changed how parse_parametrized works, I don't have strong opinions if the previous implementation is preferred.

Couple of unused imports and legacy fspath

These were missed in that PR that removed support for pytest 6.x
@delfick delfick force-pushed the schema/split-from-execution branch from bb170be to 3a39532 Compare May 4, 2024 13:21
This will make it easier to make the yaml able to do determine different
things to be done when the test is run
It doesn't need to be accessed outside this module

Also make File match the json schema we have (content is optional and
defaults to empty, path is mandatory)
Also some changes to types and how parsing parametrized is implemented
We want to split up turning the raw item into a pytest.Item
This stayed as long as it did to make the git diff a bit more useful
@delfick delfick force-pushed the schema/split-from-execution branch from 3a39532 to 7c561d5 Compare May 4, 2024 13:27
delfick added a commit to delfick/extended-mypy-django-plugin that referenced this pull request Aug 29, 2024
In the beginning there was pytest-mypy-plugins as used by django-stubs
and I needed the ability to test how mypy incremental and fine-grained
caches interact with my mypy plugin.

I created this issue on pytest-mypy-plugins asking if it were possible
typeddjango/pytest-mypy-plugins#144

The answer was that this functionality wasn't in the plugin and PRs were
welcome

I made a few PRs including
typeddjango/pytest-mypy-plugins#152 which was
then the base for a couple more branches.

Ultimately it was a lot of change and getting that merged wasn't a
thing.

After many months I decided to take what I had done in those branches
and what I had here and create pytest-typing-runner as a more
sophisticated, tested, documented, typed version of what I had written
across those branches and this repo.

The project should be able to handle more than just mypy, but that has
yet to be done. Also I want to make it so that pytest-typing-runner can
be used in django-stubs, which involves a few more additional features.

The docs for the project are also in need of some more effort.

But the pytest-typing-runner plugin is now fully tested and I'm happy
with it's API, so I've released a version and made this project use it
delfick added a commit to delfick/extended-mypy-django-plugin that referenced this pull request Aug 29, 2024
In the beginning there was pytest-mypy-plugins as used by django-stubs
and I needed the ability to test how mypy incremental and fine-grained
caches interact with my mypy plugin.

I created this issue on pytest-mypy-plugins asking if it were possible
typeddjango/pytest-mypy-plugins#144

The answer was that this functionality wasn't in the plugin and PRs were
welcome

I made a few PRs including
typeddjango/pytest-mypy-plugins#152 which was
then the base for a couple more branches.

Ultimately it was a lot of change and getting that merged wasn't a
thing.

After many months I decided to take what I had done in those branches
and what I had here and create pytest-typing-runner as a more
sophisticated, tested, documented, typed version of what I had written
across those branches and this repo.

The project should be able to handle more than just mypy, but that has
yet to be done. Also I want to make it so that pytest-typing-runner can
be used in django-stubs, which involves a few more additional features.

The docs for the project are also in need of some more effort.

But the pytest-typing-runner plugin is now fully tested and I'm happy
with it's API, so I've released a version and made this project use it

Also it appears that I need more control over when pytest-typing-runner
loads vs my extension to it in this project and I've had to turn off
pytest autoload to make this work, I will look at this next
delfick added a commit to delfick/extended-mypy-django-plugin that referenced this pull request Aug 29, 2024
In the beginning there was pytest-mypy-plugins as used by django-stubs
and I needed the ability to test how mypy incremental and fine-grained
caches interact with my mypy plugin.

I created this issue on pytest-mypy-plugins asking if it were possible
typeddjango/pytest-mypy-plugins#144

The answer was that this functionality wasn't in the plugin and PRs were
welcome

I made a few PRs including
typeddjango/pytest-mypy-plugins#152 which was
then the base for a couple more branches.

Ultimately it was a lot of change and getting that merged wasn't a
thing.

After many months I decided to take what I had done in those branches
and what I had here and create pytest-typing-runner as a more
sophisticated, tested, documented, typed version of what I had written
across those branches and this repo.

The project should be able to handle more than just mypy, but that has
yet to be done. Also I want to make it so that pytest-typing-runner can
be used in django-stubs, which involves a few more additional features.

The docs for the project are also in need of some more effort.

But the pytest-typing-runner plugin is now fully tested and I'm happy
with it's API, so I've released a version and made this project use it

Also it appears that I need more control over when pytest-typing-runner
loads vs my extension to it in this project and I've had to turn off
pytest autoload to make this work, I will look at this next
delfick added a commit to delfick/extended-mypy-django-plugin that referenced this pull request Aug 29, 2024
In the beginning there was pytest-mypy-plugins as used by django-stubs
and I needed the ability to test how mypy incremental and fine-grained
caches interact with my mypy plugin.

I created this issue on pytest-mypy-plugins asking if it were possible
typeddjango/pytest-mypy-plugins#144

The answer was that this functionality wasn't in the plugin and PRs were
welcome

I made a few PRs including
typeddjango/pytest-mypy-plugins#152 which was
then the base for a couple more branches.

Ultimately it was a lot of change and getting that merged wasn't a
thing.

After many months I decided to take what I had done in those branches
and what I had here and create pytest-typing-runner as a more
sophisticated, tested, documented, typed version of what I had written
across those branches and this repo.

The project should be able to handle more than just mypy, but that has
yet to be done. Also I want to make it so that pytest-typing-runner can
be used in django-stubs, which involves a few more additional features.

The docs for the project are also in need of some more effort.

But the pytest-typing-runner plugin is now fully tested and I'm happy
with it's API, so I've released a version and made this project use it
delfick added a commit to delfick/extended-mypy-django-plugin that referenced this pull request Aug 29, 2024
In the beginning there was pytest-mypy-plugins as used by django-stubs
and I needed the ability to test how mypy incremental and fine-grained
caches interact with my mypy plugin.

I created this issue on pytest-mypy-plugins asking if it were possible
typeddjango/pytest-mypy-plugins#144

The answer was that this functionality wasn't in the plugin and PRs were
welcome

I made a few PRs including
typeddjango/pytest-mypy-plugins#152 which was
then the base for a couple more branches.

Ultimately it was a lot of change and getting that merged wasn't a
thing.

After many months I decided to take what I had done in those branches
and what I had here and create pytest-typing-runner as a more
sophisticated, tested, documented, typed version of what I had written
across those branches and this repo.

The project should be able to handle more than just mypy, but that has
yet to be done. Also I want to make it so that pytest-typing-runner can
be used in django-stubs, which involves a few more additional features.

The docs for the project are also in need of some more effort.

But the pytest-typing-runner plugin is now fully tested and I'm happy
with it's API, so I've released a version and made this project use it
@delfick
Copy link
Contributor Author

delfick commented Sep 9, 2024

Closing this as I've turned it and a bunch of other changes into it's own fork :) #144 (comment)

@delfick delfick closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant