Closed arve0 closed 9 years ago
I understand the problem, but I don't like the solution since it is not pythonic.
I will think about it though. It seems to me that the best thing would be to defer import of numpy
etc. until it is clear that they are needed. Maybe I wll break the API and cancel the import *
stuff...
Anyway, there is a try - except
block against ImportError
around the statement and it seems not to be in effect. Also, I thought that pip
is supposed to pick up requirements from the requirements.txt
, which it obviously also doesn't do. Any idea about what's going on?
Its a common misunderstanding that requirements.txt are read upon install. Its not. I would say that the whole Python packaging is broken (ref conda and wheel declarative approach). For a longer answer, see this blog post from pip developer Donald Stufft: https://caremad.io/2013/07/setup-vs-requirement/
Another approach would be to include a separate version file (like this), but that also got that certain non-pythonic feeling.
I agree with your statement that the packaging is broken, however I don't agree with some of the conclusion presented the article.
Anyway, I have noticed that the current src/imreg_dft/__init__.py
should not suffer from the problem - the try
block has been introduced AFTER 1.0.4 (at least it looks so). So I probably should make a new release soon to remedy this.
:+1:
I agree with your statement that the packaging is broken, however I don't agree with some of the conclusion presented the article. Anyway, I have noticed that the current src/imreg_dft/init.py should not suffer from the problem - the try block has been introduced AFTER 1.0.4 (at least it looks so). So I probably should make a new release soon to remedy this.
— Reply to this email directly or view it on GitHub https://github.com/matejak/imreg_dft/pull/16#issuecomment-98256503.
Traceback:
This PR reads
__init__.py
instead of importing imreg and causing the error.