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

fix #2118 - rework Node._getcustomclass and Node compat properties #2120

Merged
merged 4 commits into from
Jan 20, 2017

Conversation

RonnyPfannschmidt
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 92.836% when pulling 9c285df on RonnyPfannschmidt:fix-2118 into 3a0a1d2 on pytest-dev:master.

@RonnyPfannschmidt RonnyPfannschmidt changed the title fix #2118 - rework Node._getcustomclass and Node compat properties [wip] fix #2118 - rework Node._getcustomclass and Node compat properties Dec 6, 2016
@RonnyPfannschmidt RonnyPfannschmidt changed the title [wip] fix #2118 - rework Node._getcustomclass and Node compat properties fix #2118 - rework Node._getcustomclass and Node compat properties Dec 6, 2016
else:
cls = getattr(self, name)

warnings.warn("use of node.%s is deprecated, "
Copy link
Member

Choose a reason for hiding this comment

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

Isn't node.Something the only usage which has been "pending-deprecated" by _CompatProperty? AFAICT this is the only user of the _CompatProperty class, so it seems this will generate two warnings (a PendingDeprecationWarning and a DeprecationWarning?

Copy link
Member Author

Choose a reason for hiding this comment

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

there is different use-cases there

one warns about using the attributes, the other warns about custom declarations while still supporting them

custom declarations will override the properties

the coode i posted ensures that

  • internal usage as planned does not warn
  • overriding the compatproperties will warn on internal usage
  • using the properties in external code will warn

Copy link
Member

Choose a reason for hiding this comment

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

What's a "custom declaration" in this context exactly? Subclassing Node and creating a property named Function (for example)?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct, py.test previously used classes and attributes in the 1.x series
basically this is code that should have created actual warnings in 2.x and be removed in 3.x

@@ -1,7 +1,9 @@
3.0.6.dev0
==========

*
* fix issue #2118 - protect against internal deprecationerrors by changing the code path of Node._getcustomclass.
Copy link
Member

@nicoddemus nicoddemus Dec 6, 2016

Choose a reason for hiding this comment

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

Could you please add a link to #2118?

Copy link
Member

Choose a reason for hiding this comment

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

@RonnyPfannschmidt besides adding the link, I think it needs rewording to make more sense to users (which don't know about pytest's internals). Suggestion:

- pytest no longer generates ``PendingDeprecationWarning`` from its own operations, which was introduced by mistake in version ``3.0.5`` (`#2118`_).
  Thanks to `@nicoddemus`_ for the report and `@RonnyPfannschmidt`_ for the PR.

else:
cls = getattr(self, name)

warnings.warn("use of node.%s is deprecated, "
Copy link
Member

Choose a reason for hiding this comment

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

What's a "custom declaration" in this context exactly? Subclassing Node and creating a property named Function (for example)?

@nicoddemus
Copy link
Member

After thinking about this a little more, I don't think we should be deprecating things in patch releases at all. Users expect only bug fixes and really minor improvements, and the fact that it is possible to use -Werror means that we might break test suites by inserting a deprecation as @The-Compiler demonstrated,

I propose we revert back the added deprecation and reapply it together with this PR to features instead, so the deprecation will effectively start in 3.1.0 and we might remove it in 4.0.

@RonnyPfannschmidt
Copy link
Member Author

we had a "deprecation" in there since years, it just never showed - personally i would rather add them in a showing manner and do a feature release right after merging rather than doing another point release

i'm really fed up with the dance of the branches

@nicoddemus
Copy link
Member

we had a "deprecation" in there since years, it just never showed

So for most (all) users the deprecation never happened... that's part of the problem.

i would rather add them in a showing manner and do a feature release right after merging rather than doing another point release

I disagree, I don't think we have enough features to release 3.1.0 yet. And there really is no rush to deprecate that usage, it is not like it hurting us or the users in any way, maintainability-wise.

i'm really fed up with the dance of the branches

IMHO it works really well. Do you disagree with using semantic versioning or the fact that we have two separate branches? Why do you have a problem with it? Do you have a different proposal?

@nicoddemus
Copy link
Member

@RonnyPfannschmidt any news on the points above? IMHO we should revert the added deprecation and put it back into the features branch along with your PR.

todo: reenable in the features branch
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0008%) to 92.833% when pulling 4082f40 on RonnyPfannschmidt:fix-2118 into 3a0a1d2 on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+4.0e-05%) to 92.832% when pulling 7b4afd8 on RonnyPfannschmidt:fix-2118 into 3a0a1d2 on pytest-dev:master.

@nicoddemus
Copy link
Member

Aside from the changelog minor update, LGTM, thanks! 👍

@nicoddemus
Copy link
Member

Cool, thanks!

@coveralls
Copy link

Coverage Status

Coverage increased (+4.0e-05%) to 92.832% when pulling 6a96b46 on RonnyPfannschmidt:fix-2118 into 3a0a1d2 on pytest-dev:master.

@nicoddemus nicoddemus merged commit 15a3b57 into pytest-dev:master Jan 20, 2017
@RonnyPfannschmidt RonnyPfannschmidt deleted the fix-2118 branch June 11, 2017 13:45
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.

3 participants