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

Add custom User Agent to every request, and expose the version in a readable way #104

Merged
merged 2 commits into from Dec 13, 2019

Conversation

eengoron
Copy link
Contributor

@eengoron eengoron commented Dec 13, 2019

Closes #80

This PR:

  • Changes the user agent sent on requests from python-requests/X to python closeio vY python-requests/X, where Y is the version of the closeio-api wrapper and X is the python-requests version
  • Adds a __version__ variable to __init__.py to keep track of the version.
  • Adds a helper to setup.py to read the __version__ variable from __init__.py to keep things consistent when installing the package.
  • Updates the version from 1.1 to 1.2

I used the same structure as the Cleancat repo to do this.

…version number from __init__.py, and update the version number to 1.2
@eengoron
Copy link
Contributor Author

Tagging @tsx for review as well because of his work on Cleancat and ReleaseRabbit

closeio_api/__init__.py Outdated Show resolved Hide resolved
@tsx tsx mentioned this pull request Dec 13, 2019
@jkemp101
Copy link
Member

jkemp101 commented Dec 13, 2019

I just did a little search about User Agent formats but we should confirm what format we want. Not sure if there is an RFC but I looked at this. That makes me think it should be something like this:
Close/1.2 python (python-requests/2.21.0)

Edit:
Or should it be Close/1.2 () python (python-requests/2.21.0)

@eengoron
Copy link
Contributor Author

After talking with @jkemp101 -- I settled on Close/X python (python-requests/Y)

@eengoron eengoron merged commit 139f1a7 into master Dec 13, 2019
@eengoron eengoron deleted the add_custom_user_agent branch December 13, 2019 22:42
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.

Set up a default User Agent
3 participants