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

Deprecate SingletonHasTraits & related classes #887

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

midhun-pm
Copy link
Contributor

Fix #881
PR updates creates a Deprecated Classes section in the has_traits docs.

Deprecated Classes
------------------

The following :class:`~.HasTraits` classes and instances are deprecated,
Copy link
Member

Choose a reason for hiding this comment

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

I think we could replace "classes and instances" with just "subclasses" here.

@mdickinson
Copy link
Member

This LGTM as far as it goes. Do you think we can find a way for these classes to issue a DeprecationWarning at instantiation time? If there are users of these classes out there, it's unlikely that they'll notice the doc change - a warning would be more useful, if we can find a way to do it.

Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

Can we look into ways to have these issue a DeprecationWarning on use?

@midhun-pm midhun-pm force-pushed the deprecate/singleton_has_traits branch from dc5d07f to b0c1b98 Compare February 18, 2020 20:22
@midhun-pm
Copy link
Contributor Author

Made the doc changes.
Also issuing a DeprecationWarning on instantiation.
Added tests for deprecation.

Had to force push after messing up the history.

@codecov-io
Copy link

Codecov Report

Merging #887 into master will increase coverage by 0.3%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #887     +/-   ##
=========================================
+ Coverage   72.58%   72.89%   +0.3%     
=========================================
  Files          51       51             
  Lines        6471     6474      +3     
  Branches     1302     1302             
=========================================
+ Hits         4697     4719     +22     
+ Misses       1378     1355     -23     
- Partials      396      400      +4
Impacted Files Coverage Δ
traits/trait_types.py 71.07% <100%> (-0.09%) ⬇️
traits/has_traits.py 70.72% <100%> (+0.33%) ⬆️
traits/editor_factories.py 81.25% <0%> (-3.13%) ⬇️
traits/traits.py 76.92% <0%> (+4.04%) ⬆️
traits/etsconfig/etsconfig.py 63.8% <0%> (+6.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2815c85...b0c1b98. Read the comment docs.

@mdickinson mdickinson changed the title Update docs to deprecate SingletonHasTraits & related classes Deprecate SingletonHasTraits & related classes Feb 27, 2020
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM. The deprecation warning gets issued at instantiation time rather than subclassing time, which is fine. (We probably could find a way to issue it at subclassing time, but then we'd get DeprecationWarnings being issued in imports, which is always awkward to deal with.)

@mdickinson mdickinson merged commit 043a441 into master Feb 27, 2020
@mdickinson mdickinson deleted the deprecate/singleton_has_traits branch February 27, 2020 17:26
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.

Deprecate and eventually remove SingletonHasTraits and related classes
3 participants