-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
pytest 7: path vs. fspath, pathlib vs. py.path #9283
Comments
Definitely confusing. The py.path situation was: nodes use |
Hmm what if we adopt a new name for |
I think I'd prefer that personally, just because the transient situation is already confusing enough as-is... Then again, maybe it's a bit late to introduce such a big change now. I haven't followed the original discussion, but if the reverse inconsistency was what was decided upon there, then I don't want to rehash this. |
I don't think so, those changes have not been released to the wild yet. @RonnyPfannschmidt @bluetech what do you think? |
The confusion occurs in 3 hooks:
|
So what should we do here for 7.0? If we go for the current inconsistency, that should at least be properly documented somewhere... Or perhaps, given that we already reverted the Of course the |
IMO, current state is a bit confusing, but other names won't be much better, so I'd just leave it. |
I agree its a bitter pill, but the other pills seem just as bitter |
Ok. I think we could do better in terms of documentation. Right now on |
Agreed, thanks @The-Compiler |
Was thinking about this a bit more, let me throw another idea into the mix to see what you folks think:
Recently we have opted for longer/more descriptive names in general, and using
They are longer, but easy to read, and also easier to explain when we have a legacy path ( |
Not entirely sure. This will delay things a bit further I assume, but it would be a cleaner way forward, and also fit in nicely with e.g. However, so far I'm still not convinced if we can come up with sensible new names really. Not sure about Maybe we can keep By all means, if the consensus is "let's stop bikeshedding this and go with #9341", that's fine by me too. Good naming is important, but we're in an unfortunate temporary situation with seemingly no good one answer... |
Yeah fine by me too. I worry because those naming decisions usually hang around for years, and plugin authors that need to support multiple pytest versions then have to deal with the differences too. Btw, I believe it is fine to release |
I'd be vary to release the rc before the change, if we decide to do it. Otherwise, plugins might start adjusting their code for the RC already (after all, we would like especially plugins or complex testsuites to test the RC!). If we then change things in an incompatible way just after the rc, I fear that will introduce more chaos. |
(whoops, misclicked, sorry for the noise!) |
Ahh you are absolutely right, I was thinking of an alpha/beta release, sorry! |
After thinking about this for some more, how do people feel about:
Agreed that - even if it delays things - we should aim to get this as right as we can in the situation. Like @nicoddemus said, it's going to stick around for a while and we won't be able to change it again for a while... |
👍 Good idea, just changing the hooks should be straightforward as those have not been published yet. If everybody agrees, I would be happy to open a PR. |
|
Great! Looks like we're coming to a conclusion then! 🎉 PR would sure be appreciated - I might get to it tomorrow, but if you have some time to work on this today, please go ahead! |
Wait, is it? Looking at the 6.2.x reference docs I don't see any Do you mean |
Sorry, meant |
Given that it's undocumented and not public API, we should be free to either change it; or keep it as-is for compatibility without any confusion. So I'd still propose |
This follows up asmeurer#42, we decided that using just `fspath` as the new parameter that users should use would be confusing because it is too close to `path` and also we have `fspath` already in some places of the pytest public API (see pytest-dev/pytest#9283). This PR updates the hook affected by this new change in pytest-dev/pytest#9363.
* Improve reference and path/fspath docs Closes #9283 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixups * Add explanation * Update wording after #9363 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I've just been looking through the changelog for pytest 7 and noticed something I'd like to discuss before the release:
In #8144, @bluetech added
pathlib
alternatives to various hooks, and called themfspath
, with the oldpy.path.local
alternatives keeping theirpath
name.However, in #8251, @RonnyPfannschmidt added a
pathlib
attribute toNode
, and called itpath
, with the oldpy.path
one being calledfspath
...We then reverted the
Node.fspath
deprecation in #8903 after some discussion in #8821, but kept the newpath
attribute...However, the naming inconsistency seems like something that could confuse people. What to do? Keep it as is, or revert the new attribute entirely until we figured out the rest of the deprecation? Make it private perhaps?
The text was updated successfully, but these errors were encountered: