Skip to content

Add convenience method for accessing pystac_client#1365

Merged
jsignell merged 6 commits into
stac-utils:mainfrom
jsignell:pystac_client
Aug 6, 2024
Merged

Add convenience method for accessing pystac_client#1365
jsignell merged 6 commits into
stac-utils:mainfrom
jsignell:pystac_client

Conversation

@jsignell
Copy link
Copy Markdown
Member

@jsignell jsignell commented Jul 16, 2024

Related Issue(s):

Description:

from pystac.client import Client

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.19%. Comparing base (a88906b) to head (1ea5ae6).
Report is 41 commits behind head on main.

Files with missing lines Patch % Lines
pystac/client.py 38.46% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
- Coverage   91.28%   91.19%   -0.10%     
==========================================
  Files          51       52       +1     
  Lines        7221     7234      +13     
  Branches     1018     1019       +1     
==========================================
+ Hits         6592     6597       +5     
- Misses        450      457       +7     
- Partials      179      180       +1     

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

@jsignell
Copy link
Copy Markdown
Member Author

I can either ignore this file in coverage or I can try to figure out a test for the the case where pystac_client is not importable.

Copy link
Copy Markdown
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

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

I'm not to stressed about coverage, but I do think some sort of CI check to make sure we work with and without pystac-client installed would be good ... this would be an easy thing to break inadvertently. Also, can you add a quick docs section describing how to use the import? 🙇🏼

@jsignell
Copy link
Copy Markdown
Member Author

jsignell commented Aug 6, 2024

All right! I ended up ignoring mypy. Mypy passes if pystac_client is installed, but it didn't seem worth it to try to mock out a stub or something. Another option I suppose would be to add pystac_client as a test requirement, but that might not be desirable.

@jsignell jsignell requested a review from gadomski August 6, 2024 16:05
@jsignell
Copy link
Copy Markdown
Member Author

jsignell commented Aug 6, 2024

I just added a smidge of docs:

Screenshot from 2024-08-06 11-26-12

@jsignell jsignell added this pull request to the merge queue Aug 6, 2024
Merged via the queue into stac-utils:main with commit 1a0c89c Aug 6, 2024
@jsignell jsignell deleted the pystac_client branch August 6, 2024 16:43
@alexgleith
Copy link
Copy Markdown

Love it! Thank you 🙏

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.

Namespace the client so we do from pystac.client import Client

3 participants