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

switched requirement for sqlalchemy-postgres-copy #681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jesteria
Copy link
Member

@jesteria jesteria commented May 2, 2019

… from psycopg2 to psycopg2-binary version.

sqlalchemy-postgres-copy currently requires psycopg2. However, triage
requires psycopg2-binary, (and pip doesn't know that these provide the
same package). As such, a build of triage attempts to install BOTH
psycopg2 AND psycopg2-binary. Assuming this builds, it doesn't
necessarily provide the wrong version: -binary might overshadow
non-binary. However, not all test environments have the necessary
libraries to build psycopg2 from source; (hence, the need for a binary
version).

This change resolves the issue by requiring an UNMERGED version of
sqlalchemy-postgres-copy which requires psycopg2-binary.


However, this isn't ideal. Alternatives for future work include:

  • replacing sqlalchemy-posgres-copy with our code -- (we scarcely get
    any use out of the library, so we could just bring in what little we need)

  • our own fork of sqlalchemy-postgres-copy

  • producing a shim distro (or github repo) which installs an empty/no-op
    psycopg2 -- to satisfy the requirement of sqlalchemy-postgres-copy (and
    any others) -- while the actual module (import) is nonetheless satisfied
    by our requirement of psycopg2-binary

  • simply requiring psycopg2 (non-binary) in triage by changing the
    requirement to: psycopg2==2.8.2. This is the recommended version, and
    which should no longer trigger warnings, as it will not allow installation
    of the binary version at all. However, it will thus require that all users
    of triage have postgresql libraries installed, or the build (and tox) will
    fail with an error, e.g.:

    You need to install postgresql-server-dev-X.Y for building a server-side
    extension or libpq-dev for building a client-side application


Other options (which I don't think are workable):

  • change the triage pip requirement to something like
    psycopg2==2.7.7 --only-binary psycopg2, (or --no-binary).
    HOWEVER, this syntax is only supported by pip, not by setup.py installs,
    (and thus it is not appropriate for triage).

…ycopg2-binary version

sqlalchemy-postgres-copy currently requires psycopg2. However, triage
requires psycopg2-binary, (and pip doesn't know that these provide the
same package). As such, a build of triage attempts to install BOTH
psycopg2 AND psycopg2-binary. Assuming this builds, it doesn't
necessarily provide the wrong version: -binary might overshadow
non-binary. However, not all test environments have the necessary
libraries to build psycopg2 from source; (hence, the need for a binary
version).

This change resolves the issue by requiring an UNMERGED version of
sqlalchemy-postgres-copy which requires psycopg2-binary.

---

However, this isn't ideal. Alternatives for future work include:

* replacing sqlalchemy-posgres-copy with our code -- (we scarcely get
any use out of the library, so we could just bring in what little we need)

* our own fork of sqlalchemy-postgres-copy

* producing a shim distro (or github repo) which installs an empty/no-op
psycopg2 -- to satisfy the requirement of sqlalchemy-postgres-copy (and
any others) -- while the actual module (import) is nonetheless satisfied
by our requirement of psycopg2-binary

* simply requiring psycopg2 (non-binary) in triage by changing the
requirement to: ``psycopg2==2.8.2``. This is the recommended version, and
which should no longer trigger warnings, as it will not allow installation
of the binary version at all. However, it will thus require that all users
of triage have postgresql libraries installed, or the build (and tox) will
fail with an error, e.g.:

    You need to install postgresql-server-dev-X.Y for building a server-side
    extension or libpq-dev for building a client-side application

---

Other options (which I don't think are workable):

* change the triage pip requirement to something like
``psycopg2==2.7.7 --only-binary psycopg2``, (or ``--no-binary``).
HOWEVER, this syntax is only supported by pip, not by setup.py installs,
(and thus it is not appropriate for triage).
@jesteria jesteria self-assigned this May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant