Skip to content

Commit 99c04e9

Browse files
committed
BLD/BUG/DOC : made pytz a required dependency
closes matplotlib#3423
1 parent cd38445 commit 99c04e9

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

INSTALL

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ libpng 1.2 (or later)
201201
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
202202
zlib.
203203

204+
`pytz`
205+
Used to manipulate time-zone aware datetimes.
206+
207+
208+
204209
Optional GUI framework
205210
^^^^^^^^^^^^^^^^^^^^^^
206211

@@ -247,12 +252,6 @@ Optional dependencies
247252
freetype 2.3 available, please edit L945 of `setupext.py` to reduce
248253
`min_version` to 2.3.
249254

250-
`pytz`
251-
Required if you want to manipulate datetime objects which are time-zone
252-
aware. An exception will be raised if you try to make time-zone aware
253-
plots with out `pytz` installed. It will become a required dependency
254-
in 1.4.1.
255-
256255

257256
Required libraries that ship with matplotlib
258257
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
setupext.Numpy(),
6767
setupext.Six(),
6868
setupext.Dateutil(),
69+
setupext.Pytz(),
6970
setupext.Tornado(),
7071
setupext.Pyparsing(),
7172
setupext.CXX(),

setupext.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ def get_extension(self):
984984
self.add_flags(ext)
985985
return ext
986986

987+
987988
class FT2Font(SetupPackage):
988989
name = 'ft2font'
989990

@@ -1183,6 +1184,22 @@ def get_install_requires(self):
11831184
return ['six>={0}'.format(self.min_version)]
11841185

11851186

1187+
class Pytz(SetupPackage):
1188+
name = "pytz"
1189+
1190+
def check(self):
1191+
try:
1192+
import pytz
1193+
except ImportError:
1194+
return (
1195+
"pytz was not found.")
1196+
1197+
return "using pytz version %s" % pytz.__version__
1198+
1199+
def get_install_requires(self):
1200+
return ['pytz']
1201+
1202+
11861203
class Dateutil(SetupPackage):
11871204
name = "dateutil"
11881205

0 commit comments

Comments
 (0)