Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Add package prefix to imports in generated code #313

Merged
merged 2 commits into from
Jul 14, 2021
Merged

Add package prefix to imports in generated code #313

merged 2 commits into from
Jul 14, 2021

Conversation

ethframe
Copy link
Contributor

Which problem is this PR solving?

Short description of the changes

  • thrift-gen-fix.awk appends package prefix to all references to *.ttypes when variable package_prefix is set.

Packages generated with thrift refers to each other as if they are top
level packages. This prevents imports from working when generated
packages are placed inside some other package. Currently jaeger_client
relies on hacking sys.path, but this doesn't work properly if the
library is packed inside an application built using PyInstaller.
Another way to get imports to work is to rewrite them after
generation. This can be done easily since the build process already
involves an awk script that performs a couple of replacements.

Signed-off-by: Andrey Nikitin <ethframe@gmail.com>
Signed-off-by: Andrey Nikitin <ethframe@gmail.com>
@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #313 (0ae7670) into master (e4c301f) will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #313      +/-   ##
==========================================
+ Coverage   95.33%   95.42%   +0.08%     
==========================================
  Files          23       25       +2     
  Lines        1931     1967      +36     
  Branches      272      272              
==========================================
+ Hits         1841     1877      +36     
  Misses         56       56              
  Partials       34       34              
Impacted Files Coverage Δ
crossdock/__init__.py 100.00% <0.00%> (ø)
jaeger_client/constants.py 100.00% <0.00%> (ø)

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 e4c301f...0ae7670. Read the comment docs.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@yurishkuro yurishkuro merged commit a30a03e into jaegertracing:master Jul 14, 2021
@ethframe ethframe deleted the fix-thrift-imports branch July 14, 2021 18:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jaeger does not work with pyinstaller
2 participants