open-reaction-database / ord-schema

Schema for the Open Reaction Database
https://open-reaction-database.org
Apache License 2.0
92 stars 26 forks source link

Remove psycopg2 as mandatory dependency because the library works without it and it throws errors if not installed #709

Closed ottokruse closed 3 months ago

ottokruse commented 5 months ago

Describe the bug Installing on Mac OS X and Linux fails due to use of pyscog2

To Reproduce If i do pip install ord-schema on Python 3.11.5 on Mac Ventura I get an error as in #654

So i have to do pip install ord-schema --no-deps and then install dependencies besides psycopg2 manually which annoys me.

After that the lib works fine for me and the things I do with it.

Even your example notebook https://github.com/open-reaction-database/ord-schema/blob/main/examples/applications/Perera_Science_Granda_Nature_Suzuki/Granda_Perera_ml_example.ipynb works fine without having pyscog2 installed.

Suggest to make it an optional dependency?

Expected behavior Should just be able to install

bdeadman commented 5 months ago

@ottokruse thanks for the feedback. I've encountered similar issues with psycopg2 interrupting the ord-schema install on Windows and Linux so I feel your pain. I will be review this bug with the wider ORD team and see what can be down to make the installation process easier for users.

skearnes commented 5 months ago

Options to consider: use psycopg2-binary, make an optional dep, upgrade to psycopg3?

skearnes commented 5 months ago

710 migrates to psycopg2-binary; I'm planning another PR where I rearrange the dependencies and move the ORM deps into extras_require.