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

Make psycopg2 an optional dependency #1648

Merged
merged 5 commits into from
Oct 25, 2024
Merged

Conversation

Ariana-B
Copy link
Contributor

@Ariana-B Ariana-B commented Oct 25, 2024

Reason for this pull request

Make datacube more lightweight to install by only requiring psycopg2 when accessing a pg database.

Proposed changes

  • Move psycopg2 to [test] dependencies, and introduce new [postgres] option

  • Switch from using psycopg2 Range types to the sqlalchemy version

  • Closes #xxxx

  • Tests added / passed

  • Fully documented, including docs/about/whats_new.rst for all changes


📚 Documentation preview 📚: https://datacube-core--1648.org.readthedocs.build/en/1648/

Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message for no postgres driver should make it clear user can install psycopg2 OR psycopg2-binary.

Or the new psycopg package? I guess that probably works too?

datacube/drivers/postgis/_connections.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.22%. Comparing base (db4b339) to head (d9d760b).
Report is 1 commits behind head on develop-1.9.

Files with missing lines Patch % Lines
datacube/drivers/postgis/_connections.py 50.00% 2 Missing ⚠️
datacube/drivers/postgres/_connections.py 50.00% 2 Missing ⚠️
datacube/drivers/postgis/_fields.py 50.00% 1 Missing ⚠️
datacube/drivers/postgres/_fields.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           develop-1.9    #1648      +/-   ##
===============================================
- Coverage        85.24%   85.22%   -0.03%     
===============================================
  Files              144      144              
  Lines            15783    15787       +4     
===============================================
  Hits             13454    13454              
- Misses            2329     2333       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SpacemanPaul SpacemanPaul merged commit dda6836 into develop-1.9 Oct 25, 2024
30 checks passed
@SpacemanPaul SpacemanPaul deleted the optional_psycopg2 branch October 25, 2024 08:57
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.

2 participants