When setting up pagure using postgres along with pagure, I get getting warnings, even when pushing changes to a repository as shown,
Details,
Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 17.52 KiB | 0 bytes/s, done. Total 5 (delta 0), reused 0 (delta 0) remote: /opt/pag_01/pag_01-server/venv/lib/python3.5/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>. remote: """) remote: /opt/pag_01/pag_01-server/venv/lib/python3.5/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>. remote: """) remote: Sending to redis to log activity and send commit notification emails remote: * Publishing information for 1 commits
Which one Is recommended to use on pagure along with postgres? psycopg2 or psycopg2-binary ?
A workaround when using psycopg2 could be adding
import warnings warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2')
to the hookrunner. This cleans the output in case psycopg2 is the default.
This warning only applies when you're installing from PyPI. This is a non-issue for Pagure normally. We will maintain the requirement to be described as psycopg2, since that's the actual requirement.
psycopg2
If you install the distribution's psycopg2 module package and make you venv expose that, then the warning will go away.
Oh! I see that must be it. I'll confirm, right now.
Thanks.
Indeed using the distribution version can solve the issue. I see there are many options there,
virtualenv --system-site-packages
pip -I
ln -s ../system-site-package/psycopg2 venv/.../psycopg2
What would be the recommended approach?
Use --system-site-packages when creating the venv. pip will not install psycopg2 if it detects it already there from the distribution.
--system-site-packages
pip
Thanks!
Metadata Update from @ark74: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)