PiRSquared17 / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

ibm-db should document runtime dependency on sqlalchemy #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm packaging ibm-db for RHEL 6 and updated the source to version 2.0.3 but it 
fails at runtime with this:

>>> import ibm_db_sa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/ibm_db_sa/__init__.py", line 22, in <module>
    from . import ibm_db, pyodbc, base   # zxjdbc
  File "/usr/lib/python2.6/site-packages/ibm_db_sa/ibm_db.py", line 21, in <module>
    from sqlalchemy.engine import result as _result
ImportError: cannot import name result

That's because I'm running with SQLAlchemy 0.7.0 but the 
sqlalchemy.engine.result package is not available until sqlalchemy version 
0.8.0.

The ibm-db setup.py should list an install requirement on sqlalchemy >= 0.8.0 
so packagers know the dependencies before runtime (at a minimum the readme 
should have sqlalchemy listed with the minimum version dependency.

Original issue reported on code.google.com by mattrie...@gmail.com on 25 Jun 2013 at 8:46

GoogleCodeExporter commented 9 years ago
setup.py already have listed the install requirement>=0.7.3, but when you 
system already have one version of SQLAlchemy then setup.py is not able to 
replace that with required one.

Original comment by rahul.pr...@in.ibm.com on 26 Jun 2013 at 12:11

GoogleCodeExporter commented 9 years ago
Then it should at least be documented in the README or somewhere that you can 
easily view it when looking for install requirements.  The code obviously 
requires 0.8.0 so the >= 0.7.3 is broken.  I think it's fine if it fails to 
install b/c you don't have the required sqlalchemy version installed, at least 
that's easier to figure out and resolve from a packaging/deployment perspective 
than debugging a runtime error.

Original comment by mattrie...@gmail.com on 29 Jun 2013 at 12:21

GoogleCodeExporter commented 9 years ago
This package requires SQLAlchemy-0.7.3 and above and It's already documented in 
the README files http://code.google.com/p/ibm-db/wiki/README and 
http://code.google.com/p/ibm-db/source/browse/ibm_db_sa/README.rst?repo=ibm-db-s
a. Install require is the feature of setuptools which silently leaves the 
version check if that package already in installed packages.

Original comment by rahul.pr...@in.ibm.com on 30 Jun 2013 at 4:56

GoogleCodeExporter commented 9 years ago
"Install require is the feature of setuptools which silently leaves the version 
check if that package already in installed packages."

Right, but if this is a brand new installation, isn't it better to have it 
install sqlalchemy 0.8?  I'm not as concerned up the update support but more 
base installation.

Original comment by mattrie...@gmail.com on 1 Jul 2013 at 9:00

GoogleCodeExporter commented 9 years ago
In general for brand new installation it will install latest released version 
of SQLAlchemy as of follows.
>>>>
$easy_install ibm_db_sa
Searching for ibm-db-sa
Reading http://pypi.python.org/simple/ibm_db_sa/
Reading http://code.google.com/p/ibm-db/downloads/list
Best match: ibm-db-sa 0.3.0
Downloading http://ibm-db.googlecode.com/files/ibm_db_sa-0.3.0-py2.6.egg
Processing ibm_db_sa-0.3.0-py2.6.egg
creating /path/to/python/site-packages/ibm_db_sa-0.3.0-py2.6.egg
Extracting ibm_db_sa-0.3.0-py2.6.egg to /Path/to/python/site-packages
Adding ibm-db-sa 0.3.0 to easy-install.pth file

Installed /path/to/python/site-packages/ibm_db_sa-0.3.0-py2.6.egg
Processing dependencies for ibm-db-sa
Searching for sqlalchemy>=0.7.3
Reading http://pypi.python.org/simple/sqlalchemy/
Best match: SQLAlchemy 0.8.1
Downloading 
http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.8.1.tar.gz#md5=
65d1f3a9f25f3cd558b6001b11392ce1
<<<<

Original comment by rahul.pr...@in.ibm.com on 2 Jul 2013 at 6:47

GoogleCodeExporter commented 9 years ago
OK, but this still goes against the fact that the setup.py is wrong, the 
install requires >= 0.8.0, otherwise the code won't run. So having >= 0.7.3 in 
the setup.py goes against what is actually required in the code.

Original comment by mattrie...@gmail.com on 2 Jul 2013 at 5:04

GoogleCodeExporter commented 9 years ago
The ibm_db_sa works fine with SQLAlchemy v0.7.3 and above.

Original comment by rahul.pr...@in.ibm.com on 2 Jul 2013 at 5:15

GoogleCodeExporter commented 9 years ago
But ibm_db doesn't, refer back to the failing import which originally caused 
this issue:

from sqlalchemy.engine import result as _result

That result package is only in sqlalchemy 0.8 and newer.

Original comment by mattrie...@gmail.com on 3 Jul 2013 at 8:34

GoogleCodeExporter commented 9 years ago
The supported version of SQLAlchemy is 0.7.3 and above, you are using 
SQLAlchemy-0.7.0 that's why you are facing this issue. 

Please try with SQLAlchemy-0.7.3 and let us know if you face the issue.

Original comment by rahul.pr...@in.ibm.com on 8 Jul 2013 at 8:25

GoogleCodeExporter commented 9 years ago
Sorry, that was a typo in my original post for the issue, I'm running with 
sqlalchemy version 0.7.9, not 0.7.0.

Original comment by mattrie...@gmail.com on 8 Jul 2013 at 2:20

GoogleCodeExporter commented 9 years ago
I have tested it with SQLAlchemy-0.7.9 and it's working fine. 

Please check your active SQLAlchemy version and try again.

If you still getting the same error then reinstall the sqlalchemy and ibm_db_sa 
adaptor and try.

Original comment by rahul.pr...@in.ibm.com on 8 Jul 2013 at 6:06

GoogleCodeExporter commented 9 years ago
You might be using development version of ibm_db_sa, which is available at 
google code GIT repository (https://code.google.com/p/ibm-db.ibm-db-sa).

In development version we have added the Stored Procedure INOUT/OUT parameter 
support, Since this is development version we didn't yet check the backward 
compatibility.

Please use released version of ibm_db_sa, unless you required specific changes 
which has been done after the release.

Thanks,
Rahul

Original comment by rahul.pr...@in.ibm.com on 29 Jul 2013 at 6:54

GoogleCodeExporter commented 9 years ago
Ah, yup, the problem is I'm at a commit level of ibm_db_sa newer than the 0.3.0 
release, I was at this commit:

https://code.google.com/p/ibm-db/source/detail?r=7491ae710a6acf75c75dd9f1f8f35ba
9822c057c&repo=ibm-db-sa

We can close this issue, sorry for the confusion!

Original comment by mattrie...@gmail.com on 1 Aug 2013 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 2 Aug 2013 at 10:45