Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
BLD/BUG/DOC : made pytz a required dependency
closes #3423
  • Loading branch information
tacaswell committed Sep 6, 2014
commit 99c04e9b46024b7c346e26ea3bd14879182f0c3f
11 changes: 5 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ libpng 1.2 (or later)
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
zlib.

`pytz`
Used to manipulate time-zone aware datetimes.



Optional GUI framework
^^^^^^^^^^^^^^^^^^^^^^

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

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


Required libraries that ship with matplotlib
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
setupext.Numpy(),
setupext.Six(),
setupext.Dateutil(),
setupext.Pytz(),
setupext.Tornado(),
setupext.Pyparsing(),
setupext.CXX(),
Expand Down
17 changes: 17 additions & 0 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ def get_extension(self):
self.add_flags(ext)
return ext


class FT2Font(SetupPackage):
name = 'ft2font'

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


class Pytz(SetupPackage):
name = "pytz"

def check(self):
try:
import pytz
except ImportError:
return (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be raise CheckFailed("...") otherwise you are going to get a positive (yes) return

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine because it will get added to the setup requirements list and pip-installed if it is not found.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. You may want to add pip may attempt to install it afterwards text in the return message like what is done in Dateutil

"pytz was not found.")

return "using pytz version %s" % pytz.__version__

def get_install_requires(self):
return ['pytz']


class Dateutil(SetupPackage):
name = "dateutil"

Expand Down