Add warnings to changes that will be made in version 3.0

This commit is contained in:
Daniel Pizetta 2018-04-20 16:36:51 -03:00
parent ba7587aaa9
commit 5cf45ed167
3 changed files with 86 additions and 2 deletions

46
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,46 @@
<!-- You can erase any parts of this template not applicable/known to your Issue. -->
### Describe Your Environment
[Versions from your environment]
- QDarkStyle:
- OS:
- Python:
[If used, please inform their versions]
- PySide:
- PyQt:
- PyQtGraph:
- QtPy:
- QT_API:
- PYQTGRAPH_QT_LIB:
### Language
[Python] or [C++]
### Description / Steps to Reproduce [if necessary]
[Description of the issue]
1. [First Step]
2. [Second Step]
3. [and so on...]
### Actual Result
[A description, output ou image of the actual result]
### Expected Results / Proposed Result
[A description, output ou image of the expected/proposed result]
### Relevant Code [if necessary]
[A piece of code to reproduce and/or fix this issue]
```
# code here to reproduce the problem
```

View File

@ -1,11 +1,15 @@
# Changelog
- 2.5.3
- Add future warning and pending deprecation for 3.0 version preparation #89
- Add ISSUE_TEMPLATE to ask for default information on issue tracker
- 2.5.2:
- Modularize files from example/ui to simplify edition (developers)
- Add scripts to process files and run example more easiy (developers)
- Better documentation (developers)
- Add CONTRIBUTE, CODE_OF_CONDUCT, and PRODUCTION files
- Lint markdown to standardize files
- Fix and add mor information in C++ example
- 2.5.1:
- Fix travis files, needs more improvement #74
- Improve modules description

View File

@ -46,9 +46,9 @@ Enjoy!
import logging
import platform
import os
import warnings
__version__ = "2.5.2"
__version__ = "2.5.3"
PYQTGRAPH_QT_LIB_VALUES = ['PyQt', 'PyQt5', 'PySide', 'PySide2']
QT_API_VALUES = ['pyqt', 'pyqt5', 'pyside', 'pyside2']
@ -105,6 +105,11 @@ def load_stylesheet_from_environment(is_pyqtgraph=False):
:return the stylesheet string
"""
warnings.warn(
"load_stylesheet_from_environment() will be deprecated in version 3,"
"use load_stylesheet()",
PendingDeprecationWarning
)
qt_api = ''
pyqtgraph_qt_lib = ''
@ -170,6 +175,11 @@ def load_stylesheet(pyside=True):
:return the stylesheet string
"""
warnings.warn(
"load_stylesheet() will not receive pyside parameter in version 3. "
"Set QtPy environment variable to specify the Qt binding insteady.",
FutureWarning
)
# Smart import of the rc file
if pyside:
import qdarkstyle.pyside_style_rc
@ -210,6 +220,12 @@ def load_stylesheet_pyside():
:return the stylesheet string
"""
warnings.warn(
"load_stylesheet_pyside() will be deprecated in version 3,"
"set QtPy environment variable to specify the Qt binding and "
"use load_stylesheet()",
PendingDeprecationWarning
)
return load_stylesheet(pyside=True)
@ -219,6 +235,12 @@ def load_stylesheet_pyside2():
:raise NotImplementedError: Because it is not supported yet
"""
warnings.warn(
"load_stylesheet_pyside2() will be deprecated in version 3,"
"set QtPy environment variable to specify the Qt binding and "
"use load_stylesheet()",
PendingDeprecationWarning
)
raise NotImplementedError("PySide 2 is not supported yet.")
@ -228,6 +250,12 @@ def load_stylesheet_pyqt():
:return the stylesheet string
"""
warnings.warn(
"load_stylesheet_pyqt() will be deprecated in version 3,"
"set QtPy environment variable to specify the Qt binding and "
"use load_stylesheet()",
PendingDeprecationWarning
)
return load_stylesheet(pyside=False)
@ -239,6 +267,12 @@ def load_stylesheet_pyqt5():
:return the stylesheet string
"""
warnings.warn(
"load_stylesheet_pyqt5() will be deprecated in version 3,"
"set QtPy environment variable to specify the Qt binding and "
"use load_stylesheet()",
PendingDeprecationWarning
)
# Smart import of the rc file
import qdarkstyle.pyqt5_style_rc