Skip to content

Commit 28697ec

Browse files
authored
Merge pull request #79 from scrapinghub/deprecation
Add deprecation warnings
2 parents 7a16319 + 669ae9d commit 28697ec

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
=================================
2-
HubStorage service client library
3-
=================================
1+
==============================================
2+
[DEPRECATED] HubStorage service client library
3+
==============================================
4+
5+
[WARNING] This package is deprecated, please use `python-scrapinghub`_ (>=1.9.0) instead.
46

57
.. image:: https://badge.fury.io/py/hubstorage.png
68
:target: http://badge.fury.io/py/hubstorage
@@ -256,4 +258,4 @@ To retrieve fingerprints for a given slot:
256258
.. _Scrapinghub API: http://doc.scrapinghub.com/api.html
257259
.. _Collections: http://doc.scrapinghub.com/api/collections.html
258260
.. _Frontier: http://doc.scrapinghub.com/api/frontier.html
259-
261+
.. _python-scrapinghub: https://github.com/scrapinghub/python-scrapinghub

hubstorage/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,19 @@
55

66
from .client import HubstorageClient, __version__
77
from .batchuploader import ValueTooLarge
8+
import warnings
9+
10+
11+
class HubstorageDeprecationWarning(Warning):
12+
"""Warning subclass for the library, since the default
13+
DeprecationWarning is silenced on Python 2.7+
14+
"""
15+
pass
16+
17+
18+
DEPRECATION_MSG = (
19+
"python-hubstorage is deprecated, please use python-scrapinghub >= 1.9.0" +
20+
" instead (https://pypi.python.org/pypi/scrapinghub)."
21+
)
22+
23+
warnings.warn(DEPRECATION_MSG, HubstorageDeprecationWarning, stacklevel=2)

0 commit comments

Comments
 (0)