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

pip install from git url doesn't honour setup.cfg #1630

Closed
dvarrazzo opened this issue Mar 10, 2014 · 7 comments
Closed

pip install from git url doesn't honour setup.cfg #1630

dvarrazzo opened this issue Mar 10, 2014 · 7 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@dvarrazzo
Copy link

Trying to install psycopg from a git url fails in an apparently mysterious way:

$ pip install --verbose -e git+https://github.com/psycopg/psycopg2.git#egg=psycopg2
[...]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.dev0 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x090303 -DPG_VERSION_HEX=0x090303 -I/usr/include/python2.7/mx -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.3/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-2.7/psycopg/connection_type.o -Wdeclaration-after-statement -Wdeclaration-after-statement
psycopg/connection_type.c:1041:5: error: ‘psyco_conn_get_exception’ undeclared here (not in a function)
Complete output from command /home/piro/.virtualenvs/tmp/bin/python -c "import setuptools, tokenize; __file__='/home/piro/.virtualenvs/tmp/src/psycopg2/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps:

The reason of the failure is apparently that the gcc command line is missing a few declarations that are defined in the setup.cfg. Installing by any other mean (downloading or just with pip install psycopg2) also adds the following declarations to the command line:

-DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1

If you suggest an acceptable way to work around this problem fixing the setup.py we'd be happy to implement it in psycopg.

Tested pip version is 1.5.2

@Ivoz
Copy link
Contributor

Ivoz commented Mar 10, 2014

Could you say what version setuptools you are using? I believe this might be a bug where it is not reading your project's setup.cfg when doing an editable install.

Pip never does any of the actual installing, it tells setuptools to.

@dvarrazzo
Copy link
Author

Maybe 0.6.24? Not sure as:

In [1]: import setuptools

In [2]: setuptools
Out[2]: <module 'setuptools' from '/home/piro/.virtualenvs/tmp/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/__init__.pyc'>

In [3]: setuptools.__version__
Out[3]: '0.6'

@Ivoz
Copy link
Contributor

Ivoz commented Mar 10, 2014

Firstly, you may like to check whether a setup.cfg exists in your current directory, as it may override the project's setup.cfg.

This may be a legimate bug in distribute 0.6.24 (virtually unmaintained now), however you might like to try as a workaround upgrading to newer versions of the packaging tools. I'm on windows atm, so can't test compiling, but to upgrade them on your system would want to run

$ [sudo] pip install -U pip setuptools virtualenv

(outside a virtualenv), you could even just update your particular virtualenv's copies of pip & setuptools inside that environment, i.e

$ pip install -U pip setuptools

If this behaviour is still present using the newest tools then this might be considered a bug in setuptools.

@dvarrazzo
Copy link
Author

Tested with pip 1.5.4, setuptools 3.1, virtualenv 1.11.4: same problem.

This is enough to reproduce:

mkvirtualenv testpip
pip install -U pip setuptools virtualenv
pip install --verbose -e git+https://github.com/psycopg/psycopg2.git#egg=psycopg2

dvarrazzo added a commit to dvarrazzo/psycopg2 that referenced this issue Apr 4, 2014
@dvarrazzo
Copy link
Author

I've worked around this bug by passing manually the defines found in the setup.cfg to the Extension (reading the cfg files works ok in the setup.py: it's the Extension object that doesn't receive them).

If you want to test please use an older commit, for instance:

pip install -e git+https://github.com/psycopg/psycopg2.git@maint_2_4#egg=psycopg2

dvarrazzo added a commit to dvarrazzo/psycopg2 that referenced this issue Apr 4, 2014
dvarrazzo added a commit to dvarrazzo/psycopg2 that referenced this issue Apr 7, 2014
pypa/pip#1630

Fixes ticket #18 (opened in 2010!)

Conflicts:

	NEWS
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue May 20, 2014
What's new in psycopg 2.5.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Work around `pip issue #1630 <https://github.com/pypa/pip/issues/1630>`__
  making installation via ``pip -e git+url`` impossible (:ticket:`#18`).
- Copy operations correctly set the `cursor.rowcount` attribute
  (:ticket:`#180`).
- It is now possible to call `get_transaction_status()` on closed connections.
- Fixed unsafe access to object names causing assertion failures in
  Python 3 debug builds (:ticket:`#188`).
- Mark the connection closed if found broken on `poll()` (from 🎫`#192`
  discussion)
- Fixed handling of dsn and closed attributes in connection subclasses
  failing to connect (from 🎫`#192` discussion).
- Added arbitrary but stable order to `Range` objects, thanks to
  Chris Withers (:ticket:`#193`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
  Adam Petrovich for the bug report and diagnosis.
- Don't segfault using poorly defined cursor subclasses which forgot to call
  the superclass init (:ticket:`#195`).
- Mark the connection closed when a Socket connection is broken, as it
  happens for TCP connections instead (:ticket:`#196`).
- Fixed overflow opening a lobject with an oid not fitting in a signed int
  (:ticket:`#203`).
- Fixed handling of explicit default ``cursor_factory=None`` in
  `connection.cursor()` (:ticket:`#210`).
- Fixed possible segfault in named cursors creation.
- Fixed debug build on Windows, thanks to James Emerton.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jun 2, 2014
What's new in psycopg 2.5.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Work around `pip issue #1630 <https://github.com/pypa/pip/issues/1630>`__
  making installation via ``pip -e git+url`` impossible (:ticket:`#18`).
- Copy operations correctly set the `cursor.rowcount` attribute
  (:ticket:`#180`).
- It is now possible to call `get_transaction_status()` on closed connections.
- Fixed unsafe access to object names causing assertion failures in
  Python 3 debug builds (:ticket:`#188`).
- Mark the connection closed if found broken on `poll()` (from 🎫`#192`
  discussion)
- Fixed handling of dsn and closed attributes in connection subclasses
  failing to connect (from 🎫`#192` discussion).
- Added arbitrary but stable order to `Range` objects, thanks to
  Chris Withers (:ticket:`#193`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
  Adam Petrovich for the bug report and diagnosis.
- Don't segfault using poorly defined cursor subclasses which forgot to call
  the superclass init (:ticket:`#195`).
- Mark the connection closed when a Socket connection is broken, as it
  happens for TCP connections instead (:ticket:`#196`).
- Fixed overflow opening a lobject with an oid not fitting in a signed int
  (:ticket:`#203`).
- Fixed handling of explicit default ``cursor_factory=None`` in
  `connection.cursor()` (:ticket:`#210`).
- Fixed possible segfault in named cursors creation.
- Fixed debug build on Windows, thanks to James Emerton.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jun 11, 2014
What's new in psycopg 2.5.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Work around `pip issue #1630 <https://github.com/pypa/pip/issues/1630>`__
  making installation via ``pip -e git+url`` impossible (:ticket:`#18`).
- Copy operations correctly set the `cursor.rowcount` attribute
  (:ticket:`#180`).
- It is now possible to call `get_transaction_status()` on closed connections.
- Fixed unsafe access to object names causing assertion failures in
  Python 3 debug builds (:ticket:`#188`).
- Mark the connection closed if found broken on `poll()` (from 🎫`#192`
  discussion)
- Fixed handling of dsn and closed attributes in connection subclasses
  failing to connect (from 🎫`#192` discussion).
- Added arbitrary but stable order to `Range` objects, thanks to
  Chris Withers (:ticket:`#193`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
  Adam Petrovich for the bug report and diagnosis.
- Don't segfault using poorly defined cursor subclasses which forgot to call
  the superclass init (:ticket:`#195`).
- Mark the connection closed when a Socket connection is broken, as it
  happens for TCP connections instead (:ticket:`#196`).
- Fixed overflow opening a lobject with an oid not fitting in a signed int
  (:ticket:`#203`).
- Fixed handling of explicit default ``cursor_factory=None`` in
  `connection.cursor()` (:ticket:`#210`).
- Fixed possible segfault in named cursors creation.
- Fixed debug build on Windows, thanks to James Emerton.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Oct 11, 2014
What's new in psycopg 2.5.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Work around `pip issue #1630 <https://github.com/pypa/pip/issues/1630>`__
  making installation via ``pip -e git+url`` impossible (:ticket:`#18`).
- Copy operations correctly set the `cursor.rowcount` attribute
  (:ticket:`#180`).
- It is now possible to call `get_transaction_status()` on closed connections.
- Fixed unsafe access to object names causing assertion failures in
  Python 3 debug builds (:ticket:`#188`).
- Mark the connection closed if found broken on `poll()` (from 🎫`#192`
  discussion)
- Fixed handling of dsn and closed attributes in connection subclasses
  failing to connect (from 🎫`#192` discussion).
- Added arbitrary but stable order to `Range` objects, thanks to
  Chris Withers (:ticket:`#193`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
  Adam Petrovich for the bug report and diagnosis.
- Don't segfault using poorly defined cursor subclasses which forgot to call
  the superclass init (:ticket:`#195`).
- Mark the connection closed when a Socket connection is broken, as it
  happens for TCP connections instead (:ticket:`#196`).
- Fixed overflow opening a lobject with an oid not fitting in a signed int
  (:ticket:`#203`).
- Fixed handling of explicit default ``cursor_factory=None`` in
  `connection.cursor()` (:ticket:`#210`).
- Fixed possible segfault in named cursors creation.
- Fixed debug build on Windows, thanks to James Emerton.
maciej-pawlisz pushed a commit to Team-Titanis/pysqlite that referenced this issue Dec 16, 2015
@dstufft
Copy link
Member

dstufft commented Mar 22, 2017

Closing this, if it continues to happen please reopen this issue or open a new one with reproduction steps, however at this time I cannot reproduce this even with older commit.

@dstufft dstufft closed this as completed Mar 22, 2017
@dvarrazzo
Copy link
Author

It seems working fine as of pip 9.0.1, setuptools 34.3.2, virtualenv 15.1.0, thank you.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants