Skip to content

Major version increase? #204

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

Closed
staticdev opened this issue Aug 24, 2020 · 12 comments · Fixed by #205
Closed

Major version increase? #204

staticdev opened this issue Aug 24, 2020 · 12 comments · Fixed by #205

Comments

@staticdev
Copy link
Contributor

Hi,

I've seen 3.3.0 changed name from MockFixture to MockerFixture. It broke existing code like in:
https://github.com/staticdev/toml-validator/pull/157/checks?check_run_id=1020396590

I see at least two possible solutions here: increasing the major version to 4.0.0 to semantically say it broke original API or rename back (maybe even creating some alias to support both names).

@The-Compiler
Copy link
Member

Duplicate of #202 - keeping this open for now though.

@staticdev
Copy link
Contributor Author

I see... sorry for the duplicate. Anyhow, @nicoddemus my test code also uses the type MockFixture to annotate arguments of fixtures such as the example code linked.

@nicoddemus
Copy link
Member

Hi @staticdev,

I see... sorry for the duplicate.

No worries!

Anyhow, @nicoddemus my test code also uses the type MockFixture to annotate arguments of fixtures such as the example code linked.

You can't upgrade because you intend to support older pytest-mock versions for now?

I think the only thing we can do to mitigate this is to add an alias, as you suggest, however I would prefer to avoid that because it is another thing to eventually deprecate/remove in the future.

@staticdev
Copy link
Contributor Author

@nicoddemus I don't intend to support older pytest-mock. Personally, I would go for 4.0.0 and move on.

@nicoddemus
Copy link
Member

nicoddemus commented Aug 25, 2020

Problem with that is that I see two scenarios:

  1. People who pin to avoid major versions (for example pytest-mock<4): for those people making a new 4.0 release won't do any good, as they will still get 3.3 with MockerFixture.
  2. People who don't pin (the vast majority I believe): those will either pin to !=3.3 or just update their code. Again making a 4.0 release won't do much good as they will need to update their code or their pins.

So unless I'm missing something, releasing 4.0 will only bring more confusion than solving any real problem, I think.

@graingert
Copy link
Member

graingert commented Aug 25, 2020

Doesn't reveal_type(pytest_mock.plugin.MockFixture) just show Any?

(For the old <3.3.0)

@staticdev
Copy link
Contributor Author

I pin all my versions. To solve everything you can rename and patch 3.3.0 with 3.3.1 (go back to previous MockFixture.
And then create a 4.0.0 with MockerFixture (if you really want to rename it).

The idea of alias, as you said, comes with more code to maintain.

@nicoddemus
Copy link
Member

The idea of alias, as you said, comes with more code to maintain.

Indeed, but just a single line in this case.

@graingert @staticdev please see #205.

@staticdev
Copy link
Contributor Author

@nicoddemus very well.. that does the trick! So we can close this one.

@nicoddemus
Copy link
Member

Feel free to leave your approval there. 😉

@graingert
Copy link
Member

graingert commented Aug 25, 2020

The idea of alias, as you said, comes with more code to maintain.

Indeed, but just a single line in this case.

@graingert @staticdev please see #205.

No I mean in @staticdev 's codebase you're not using --disallow-any-unimported which should fail for this unexported symbol

@nicoddemus
Copy link
Member

@graingert want to take a look at #205 and see if I'm missing something?

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 a pull request may close this issue.

4 participants