-
Notifications
You must be signed in to change notification settings - Fork 52
Defining a user-agent in GET requests #86
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
Conversation
|
@elbeejay, something is wrong with my understanding. I swore that |
|
Updated the versioning references based on the documentation for |
thodson-usgs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revise __init__.py
thodson-usgs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks @elbeejay!
Aims to close #83 by adding a string to the header in our HTTP GET requests that identifies the python dataretrieval package and version making the request.
Checked functionality against what the R package does and this follows that convention. The "user-agent" information sent to the server is
python-dataretrieval/<version>which is consistent with the approach in R.Wrote some tests for this logic.
@thodson-usgs can you confirm that my syntax for getting the current version is correct? We don't currently have a
_version.pyfile so in the interest of having the code be more resilient there's currently try-except logic to substitute "version-unknown" when it is not available. But I am hoping that once we do the next release the codedataretrieval.__version__will successfully return the version information as a string. Used similar logic to automatically set the versions for the hosted documentation that gets built each time a commit is made.