#12989 closed enhancement (fixed)
Make psycopg2-binary satisfy installation requirements
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.3 |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | postgres |
Cc: | Branch: | ||
Release Notes: |
The |
||
API Changes: | |||
Internal Changes: |
Description
I've been getting this warning:
/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
On installing psycopg2-binary
, the module postgres_backend
module is skipped because the installation requirement isn't satisfied.
I think we went down a similar path when supporting the MySQL library dependencies and couldn't find a way to write the equivalent of psycopg2 or psycopg-binary
as the installation requirement.
$pip list --format=columns | grep psycopg2 psycopg2 2.7.4 psycopg2-binary 2.7.4
I haven't researched potential solutions yet.
Attachments (0)
Change History (11)
comment:1 by , 7 years ago
Milestone: | 1.0.17 → 1.0.18 |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Milestone: | 1.0.18 → 1.2.3 |
---|
I'm reviewing your patch and see now that the issue only affects 1.2-stable (#12096).
Looks like setuptools issue 434 is relevant.
comment:4 by , 7 years ago
Changes look good to me. I added a little cleanup on this branch: log:rjollos.git:t12989_psycopg2_binary.
I've never considered specifying extras while installing Trac. That's a good feature.
comment:5 by , 7 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:6 by , 7 years ago
Release Notes: | modified (diff) |
---|
Committed to 1.2-stable in r16572, but reverted in [16573:16574]. Sorry, I was careless with the commits.
comment:7 by , 7 years ago
[5826f28ee/rjollos.git] would import the necessary backend, depending on the dburi. Needs to be exercised a bit more for different test execution scenarios. On trunk we can use importlib rather than __import__
.
comment:8 by , 7 years ago
When psycopg2
or psycopg2-binary
is not installed, running the tests results in:
$ make db=postgres test Python: /Users/rjollos/.pyenv/shims/python ... File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/db/postgres_backend.py", line 41, in <module> raise DistributionNotFound('psycopg2>=2.0 or psycopg2-binary', ['Trac']) pkg_resources.DistributionNotFound: The 'psycopg2>=2.0 or psycopg2-binary' distribution was not found and is required by Trac
Previously the tests would just continue running with lots of failures.
$ make db=postgres test Python: /Users/rjollos/.pyenv/shims/python ... writing manifest file 'Trac.egg-info/SOURCES.txt' python ./trac/test.py --skip-functional-tests EEEEEEEEEEEEEEEEEEEE.........................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.........................^Z [4]+ Stopped make db=postgres test
I think the new behavior is better.
comment:9 by , 7 years ago
Proposed changes in [9310a0e83/rjollos.git].
The self.error
messages were removed because I don't see a way the statements will ever be reached following the changes in #12096.
comment:10 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
After the patch (PoC):
DistributionNotFound
is raised if psycopg2 module is not available.pip install Trac[psycopg2]
leads installing Trac and psycopg2.pip install Trac[psycopg2-binary]
leads installing Trac and psycopg2-binary.setup.py
[postgresql]trac/db/postgres_backend.py