From 5cf45ed167c030d48ca568e92e534399ce89b641 Mon Sep 17 00:00:00 2001 From: Daniel Pizetta Date: Fri, 20 Apr 2018 16:36:51 -0300 Subject: [PATCH] Add warnings to changes that will be made in version 3.0 --- .github/ISSUE_TEMPLATE.md | 46 +++++++++++++++++++++++++++++++++++++++ CHANGES.md | 4 ++++ qdarkstyle/__init__.py | 38 ++++++++++++++++++++++++++++++-- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..822d37d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,46 @@ + + +### 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 +``` \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 3ea9f370..e8389419 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/qdarkstyle/__init__.py b/qdarkstyle/__init__.py index 16c72162..d0c95171 100644 --- a/qdarkstyle/__init__.py +++ b/qdarkstyle/__init__.py @@ -46,9 +46,9 @@ 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