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

Get version from version.py instead of version.txt #807

Merged
merged 3 commits into from
May 28, 2019

Conversation

lipis
Copy link
Contributor

@lipis lipis commented May 25, 2019

When deploying to App Engine using the zipped libraries, reading the txt file is not possible and I'm getting the following error:

cannot import name __version__ (/base/data/home/apps/e~dionysus-app/20190525t145530.418433277209349498/control/error.py:25)
Traceback (most recent call last):
  File "lib.zip/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "lib.zip/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/base/data/home/apps/e~dionysus-app/20190525t145530.418433277209349498/auth/auth.py", line 261, in decorated_function
    return f(*args, **kwargs)
  File "/base/data/home/apps/e~dionysus-app/20190525t145530.418433277209349498/control/places/supply.py", line 288, in place_supply_order_email
    response = task.place_supply_order(place_db, supply_db, vendor_db)
  File "/base/data/home/apps/e~dionysus-app/20190525t145530.418433277209349498/task.py", line 267, in place_supply_order
    return send_sendgrid_email(subject, body, to, place_db.name)
  File "/base/data/home/apps/e~dionysus-app/20190525t145530.418433277209349498/task.py", line 43, in send_sendgrid_email
    sendgrid_client = sendgrid.SendGridAPIClient(config.CONFIG_DB.sendgrid_api_key)
  File "lib.zip/sendgrid/sendgrid.py", line 58, in __init__
    from . import __version__
ImportError: cannot import name __version__

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them
  • I updated my branch with the master branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

I reverted the reading of the version how it was before the version 6, and it works as expected.

Check the PR without the whitespaces: https://github.com/sendgrid/sendgrid-python/pull/807/files?w=1

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label May 25, 2019
@lipis lipis changed the title Get version from version.py instead of TXT Get version from version.py instead of version.txt May 25, 2019
@codecov
Copy link

codecov bot commented May 25, 2019

Codecov Report

Merging #807 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #807      +/-   ##
==========================================
+ Coverage      80%   80.02%   +0.01%     
==========================================
  Files          69       70       +1     
  Lines        2016     2018       +2     
  Branches      338      339       +1     
==========================================
+ Hits         1613     1615       +2     
  Misses        204      204              
  Partials      199      199
Impacted Files Coverage Δ
sendgrid/version.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 472c845...9e9dc31. Read the comment docs.

@thinkingserious thinkingserious merged commit 3de8f01 into sendgrid:master May 28, 2019
@thinkingserious
Copy link
Contributor

Hello @lipis,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy type: community enhancement feature request not on Twilio's roadmap and removed status: code review request requesting a community code review or review from Twilio labels May 28, 2019
@lipis lipis deleted the version branch May 29, 2019 08:51
@lipis
Copy link
Contributor Author

lipis commented May 29, 2019

Thank you for accepting that! By any chance we can have a new release soon?

@thinkingserious
Copy link
Contributor

Hello @lipis,

I can't make any promises on a release date, but we are generally moving towards a more predictable cadence.

Thanks again for your support!

With Best Regards,

Elmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants