Skip to content

Fix crash with -OO Python command line - #1388

Merged
mrocklin merged 36 commits into
dask:masterfrom
JGoutin:patch-1
Jul 26, 2016
Merged

mrocklin merged 36 commits into
dask:masterfrom
JGoutin:patch-1

Conversation

@JGoutin

@JGoutin JGoutin commented Jul 19, 2016

Copy link
Copy Markdown
Contributor
  • Fix crash with -OO Python command line (__doc__ is Noneis this case and not str)
  • Add a Travis job in this case for prevent future related error.

@mrocklin

Copy link
Copy Markdown
Member

Thank you for working on this by the way. I have almost no experience with running Python with the -OO flags

@JGoutin

JGoutin commented Jul 22, 2016

Copy link
Copy Markdown
Contributor Author

Happy to help!
The change with -OO is that __doc__ become None in place of str, so trying use it as a str will raise errors.

There is no more errors on daskwith -OO: the build still fail, but it is because -OO errors on bokeh and graphviz packages. So I set the Travis build as allowed failure.

@jcrist

jcrist commented Jul 22, 2016 •

Copy link
Copy Markdown
Member

Overall this looks fine to me. Two things:

  • Why do you run with -OO? I'm just curious what the benefit here is, I have no experience with this.
  • Perhaps instead of allowing failure, just skip the tests that fail (as is done with other dependencies). I'm concerned that we'll test it but never check it, as it always is expected to fail.

@JGoutin

JGoutin commented Jul 23, 2016 •

Copy link
Copy Markdown
Contributor Author

-OO is usefull only in some cases and have two main effects:

  • It reduce the file size, this help to save disk space when it is precious (ex embedded applications) and also make Python loading faster.
  • Removing docstring from some files can help to hide some confidential informations. (And help to justify the use of Python even in some companies where confidentiality is important).

In all cases, this is only for production applications, where nobody need to look at the code.

In my case, this mainly help me to have a decent loading time for my software at work (That call a lot of libraries well documented), and this also reassure some managers of my company to not have some information to easy to reach (Without this, they not allowed me to use Python).

I will look to skip failing -OO tests from other libraries.

@mrocklin

Copy link
Copy Markdown
Member

OK, cool. So it looks like you've managed to get everything passing. I'm glad to see this.

Like @jcrist I don't have much personal experience with -OO mode. However, I do appreciate that companies live in a reasonably constrained world and I'm very happy to see Dask be made more amenable to those constraints.

Nothing here seems like a problem to me. The only question I have is whether or not we want to have Travis test -OO mode on every build of every PR. We have only a certain amount of testing time with them and this is a non-trivial increase. These tests may be more appropriate as a daily cron job, which is newly available on travis.ci: https://docs.travis-ci.com/user/cron-jobs/

Thoughts?

@JGoutin

JGoutin commented Jul 23, 2016 •

Copy link
Copy Markdown
Contributor Author

The daily cron job is a good idea.

@JGoutin

JGoutin commented Jul 23, 2016

Copy link
Copy Markdown
Contributor Author

All external package related errors skipped.

@mrocklin

Copy link
Copy Markdown
Member

I've asked Travis-CI for Cron support

@JGoutin

JGoutin commented Jul 25, 2016

Copy link
Copy Markdown
Contributor Author

I removed the -OO job from .travis.yml, you can merge it.

The env for the Cron Job is:
PYTHON=3.5 NUMPY=1.11.0 PANDAS=0.18.1 COVERAGE='false' PYTHONOPTIMIZE=2 XTRATESTARGS=--ignore=dask/diagnostics

@mrocklin

Copy link
Copy Markdown
Member

So, cron jobs aren't as simple as previously thought.

I recommend that we add the -OO flag to a couple of the pre-existing builds, notably PY27 coverage="false" and PY34

@mrocklin

Copy link
Copy Markdown
Member

Ah ha, feedback from Travis-ci folks:

Just wanted to let you know of the environment variable that gets set automatically: $TRAVIS_EVENT_TYPE. This variable indicates how the build was triggered, and should be one of push, pull_request, api, cron.

You could perform

after_install:

  • "[[ $TRAVIS_EVENT_TYPE = cron ]] && LongRunningCommand"

@mrocklin

Copy link
Copy Markdown
Member

OK, merging for now. It would be nice to switch this out to a cron job some time, but I don't currently have the bandwidth to manage this and I'd like to get this in for the next release.

@mrocklin
mrocklin merged commit 320f5ab into dask:master Jul 26, 2016
@JGoutin
JGoutin deleted the patch-1 branch July 26, 2016 18:14
@sinhrks sinhrks added this to the 0.10.2 milestone Aug 22, 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

Successfully merging this pull request may close these issues.

4 participants