Skip to content

Commit

Permalink
Add warnings to changes that will be made in version 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpizetta committed Apr 20, 2018
1 parent ba7587a commit 5cf45ed
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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
```
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
38 changes: 36 additions & 2 deletions qdarkstyle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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 = ''

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand All @@ -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.")


Expand All @@ -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)


Expand All @@ -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

Expand Down

0 comments on commit 5cf45ed

Please sign in to comment.