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

Compatibility with PyPy #2

Merged
merged 2 commits into from
Jan 27, 2017
Merged

Compatibility with PyPy #2

merged 2 commits into from
Jan 27, 2017

Commits on Jan 25, 2017

  1. Compatibility with PyPy

    I notice that setup.py specifies both `RelStorage[postgresql]` and also `psycopg2`. The former will work correctly on PyPy, but the latter will not (you want `psycopg2cffi`).
    
    There doesn't seem to be any actual usage of psycopg2 in the code itself, only in a test case:
    ```
    newtdb$ ack psycopg2
    setup.py
    3:install_requires = ['setuptools', 'RelStorage[postgresql]', 'psycopg2', 'six']
    
    src/newt/db/_search.py
    6:import psycopg2
    
    src/newt/db/tests/base.py
    1:import psycopg2
    13:        self.base_conn = psycopg2.connect('')
    ```
    
    If you need to connect to a database in a test case, you could try this:
    ```
    import relstorage.adapters.postgresql.adapter as adapter
    self.base_conn = adapter.select_driver().connect('')
    ```
    
    Then in theory you should Just Work with any supported driver, assuming you stick to the DB-API. Or at least, psyc2pg2 and psycopg2cffi pretty much implement the same extensions.
    
    Adding `- pypy-5.4.1` to `.travis.yml` should run your tests on a new-ish pypy.
    jamadden committed Jan 25, 2017
    Configuration menu
    Copy the full SHA
    d7da788 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2017

  1. Configuration menu
    Copy the full SHA
    1aa69db View commit details
    Browse the repository at this point in the history