Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should dateutil module be a hard requirement? #29

Closed
nbareil opened this issue Dec 1, 2016 · 2 comments
Closed

should dateutil module be a hard requirement? #29

nbareil opened this issue Dec 1, 2016 · 2 comments

Comments

@nbareil
Copy link
Contributor

nbareil commented Dec 1, 2016

In pymisp/misp_event.py:

 11 try:
 12     from dateutil.parser import parse
 13 except ImportError:
 14     pass

But it is used like it must exists.

345     def set_date(self, date, ignore_invalid=False):
346         if isinstance(date, basestring) or isinstance(date, unicode):
347             self.date = parse(date).date()
348         elif isinstance(date, datetime.datetime):
349             self.date = date.date()
350         elif isinstance(date, datetime.date):
351             self.date = date

I can fix that, but what would you prefer?

  • Modify set_date() behavior with a has_dateutil
  • Make a successful import mandatory?
@Rafiot
Copy link
Member

Rafiot commented Dec 1, 2016

Hmmm yeah, that would make sense. I'm not sure why I did it that way at the time...

@Rafiot
Copy link
Member

Rafiot commented Dec 13, 2016

It is already mandatory: https://github.com/MISP/PyMISP/blob/master/setup.py#L30

The reason you have the try - except - pass is because import pymisp is in setup.py before you actually install the dependencies so pip install . will fail.

@Rafiot Rafiot closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants