8000 Added header for driver version and other info by tjoubert · Pull Request #228 · arangodb/python-arango · GitHub
[go: up one dir, main page]

Skip to content

Added header for driver version and other info #228

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

Merged
merged 7 commits into from
Nov 29, 2022

Conversation

tjoubert
Copy link
Contributor

@joowani, please check the related issue for context information.
The aim here is to pass this header to every request. So, I've added it to normalize_headers() in request.py.

Please check request.py line 12. Is there a way to quickly retrieve the name and version of the current package in Python?
I am thinking of using the importlib-metadata package (https://pypi.org/project/importlib-metadata/). Do you think that this is a good approach or is there a better way?

@tjoubert tjoubert requested a review from joowani November 21, 2022 07:07
@tjoubert tjoubert self-assigned this Nov 21, 2022
@tjoubert tjoubert linked an issue Nov 21, 2022 that may be closed by this pull request
@codecov-commenter
Copy link
codecov-commenter commented Nov 21, 2022

Codecov Report

Merging #228 (c30a767) into main (745ad54) will decrease coverage by 0.07%.
The diff coverage is 81.81%.

❗ Current head c30a767 differs from pull request most recent head 008947e. Consider uploading reports for the commit 008947e to get more accurate results

@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
- Coverage   98.52%   98.45%   -0.08%     
==========================================
  Files          26       26              
  Lines        3801     3809       +8     
==========================================
+ Hits         3745     3750       +5     
- Misses         56       59       +3     
Impacted Files Coverage Δ
arango/request.py 94.44% <80.00%> (-5.56%) ⬇️
arango/typings.py 100.00% <100.00%> (ø)
arango/collection.py 96.47% <0.00%> (-0.12%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@joowani
Copy link
Contributor
joowani commented Nov 27, 2022

Please check request.py line 12. Is there a way to quickly retrieve the name and version of the current package in Python? I am thinking of using the importlib-metadata package (https://pypi.org/project/importlib-metadata/). Do you think that this is a good approach or is there a better way?

You can simply do:

from arango.version import __version__

I think it's safe to assume that when we are executing the python-arango code, the version file would've already been generated by pip install (pip install -e in dev).

@tjoubert
Copy link
Contributor Author

Please check request.py line 12. Is there a way to quickly retrieve the name and version of the current package in Python? I am thinking of using the importlib-metadata package (https://pypi.org/project/importlib-metadata/). Do you think that this is a good approach or is there a better way?

You can simply do:

from arango.version import __version__

I think it's safe to assume that when we are executing the python-arango code, the version file would've already been generated by pip install (pip install -e in dev).

@joowani , thanks for the tip. I tested it and it works!

@tjoubert tjoubert requested a review from joowani November 29, 2022 02:11
Copy link
Contributor
@joowani joowani left a comment

Choose a reason for hiding this comment

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

Looks like you missed a couple of spots but the rest looks good! Please feel free to merge after you address the nits. Thanks as always.

8000
@tjoubert tjoubert merged commit 131aa4e into main Nov 29, 2022
@tjoubert tjoubert deleted the DE-429-227-header-for-driver-version-and-other-info branch November 29, 2022 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Header for driver version and other info
3 participants
0