Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Add support for includes & service extends #37

Merged
merged 5 commits into from
Sep 10, 2014
Merged

Conversation

mikekap
Copy link
Contributor

@mikekap mikekap commented Sep 10, 2014

  • Add support for includes. load() now takes an optional include_dirs argument that specifies relative paths.
  • Add support for service "extends".

Mike Kaplinskiy added 3 commits September 9, 2014 20:04
 - Add support for includes. load() now takes an optional include_dirs argument that specifies relative paths.
 - Add support for service "extends".
@hit9
Copy link
Contributor

hit9 commented Sep 10, 2014

Really a nice pr @lxyu

Mike Kaplinskiy added 2 commits September 9, 2014 21:48
…ng from enums.

This makes it a lot easier to build reflection-like tools, e.g. converting JSON to Thrift that might use strings for enums.
lxyu added a commit that referenced this pull request Sep 10, 2014
Add support for includes & service extends
@lxyu lxyu merged commit fbec1ea into Thriftpy:develop Sep 10, 2014
@mikekap
Copy link
Contributor Author

mikekap commented Sep 11, 2014

For simple thrift files this isn't an issue. But if you're importing a thrift file from a directory that's not the "thrift root", you'll run into problems with includes, e.g. given

thrift/scribe/if/scribe.thrift (has include "fb303/if/fb303.thrift")
thrift/fb303/if/fb303.thrift
init.py

In this setup, you can't use thriftpy to import thrift/scribe/if/scribe.thrift without doing some chdir magic. In general, I think this mirrors the -I thrift compiler option, which is good for compatibility.

@lxyu
Copy link
Contributor

lxyu commented Sep 16, 2014

👍 @mikekap thanks for those awesome PRs, I have just released v0.1.11 with all these changes to pypi, you may use it from that now.

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.

3 participants