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

Add expect exception back in #73

Closed
wants to merge 6 commits into from
Closed

Conversation

znicholls
Copy link
Collaborator

Pull request

Add expect exception back in because it can go in setup.py

Please confirm that this pull request has done the following:

  • Tests added (N/A)
  • Documentation added (where applicable) (N/A)
  • Example added (either to an existing notebook or as a new notebook, where applicable) (N/A)
  • Description in CHANGELOG.rst added (N/A)

Adding to CHANGELOG.rst

Please add a single line in the changelog notes similar to one of the following:

- (`#XX <http://link-to-pr.com>`_) Added feature which does something
- (`#XX <http://link-to-pr.com>`_) Fixed bug identified in (`#XX <http://link-to-issue.com>`_)

@znicholls znicholls requested a review from swillner January 15, 2019 23:30
@rgieseke
Copy link
Member

To clarify, the advantage of having expect exception that you see the full exception as it would happen if a user made the same "mistake" on their machine, right?

Seems useful. I still think we could just drop the folder from the project in the notebooks directory, along with their Readme and License file.

@rgieseke rgieseke mentioned this pull request Jan 16, 2019
@swillner
Copy link
Member

hmm, I am not very happy with either solution, especially as I do not see the actual benefit of it.
Actually, just printing the caught exception should be enough. And then it would not look like there is an error in the notebook...
In general, we should avoid pulling in dependencies unless really necessary, which is not the case here, I think.
Having said that, I am open to be overruled ;) If there is no way around this dependency, I would include the git path, but fix the commit so we won't run into surprises as with pint.

@znicholls
Copy link
Collaborator Author

To clarify, the advantage of having expect exception that you see the full exception as it would happen if a user made the same "mistake" on their machine, right?

That's exactly it. The guys who wrote it wrote it so that they could show students errors (which are important in learning) and have their notebooks pass CI. They didn't want to use try except blocks as their students didn't know what they were and it doesn't show you the error you'd get if you used it without a try except block.

I'm also not that fussed, I made this PR more as an illustration (to myself) of how to do this install from path in setup.py rather than requirements. Happy to tweak as @swillner suggested or close.

@swillner
Copy link
Member

Hmm. Then to keep the number of dependencies low, I strongly suggest we just do a try..except and only print the exception message (without backtrace). That way it also does not look like an error in the notebook at first glance...
fyi, I'll be on vacation the next two weeks

@swillner swillner requested review from rgieseke and removed request for swillner January 20, 2019 09:00
@znicholls
Copy link
Collaborator Author

Then to keep the number of dependencies low, I strongly suggest we just do a try..except and only print the exception message (without backtrace).

Perfect then I'll close this.

@znicholls znicholls closed this Jan 21, 2019
@znicholls
Copy link
Collaborator Author

Another reason to not have url links as dependencies, pypa/pip#4187 (tl;dr if you have url dependencies in setup.py, you can't upload your package to PyPI)

@swillner swillner deleted the add-expect-exception-back-in branch February 8, 2019 15:56
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.

3 participants