Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

[feature request] easy import of DESCRIPTOR, Node #34

Closed

Description

@zurk

Since it is hard to get DESCRIPTOR and Node modules, can we add it to bblfsh directly?
I suggest adding to __main__.py something like this:

import importlib

DESCRIPTOR = importlib.import_module(
        "bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % bblfsh.sdkversion.VERSION).DESCRIPTOR
Node = importlib.import_module(
        "bblfsh.gopkg.in.bblfsh.sdk.%s.uast.generated_pb2" % bblfsh.sdkversion.VERSION).Node

Then everyone can just do from bblfsh import Node, DESCRIPTOR.

Can make a PR if you approve.

Activity

  1. zurk commented on Sep 21, 2017

    @zurk
    ContributorAuthor

    We have it as ast2vec part: https://github.com/src-d/ast2vec/blob/master/ast2vec/bblfsh_roles.py but I think it is more bblfsh related things.

  2. juanjux commented on Sep 21, 2017

    @juanjux
    Contributor

    Yes, that's ugly as Black Death, the init.py file should import all those.

  3. zurk commented on Sep 22, 2017

    @zurk
    ContributorAuthor

    @juanjux btw, can we just somehow avoid in in the directory path? It also solves this problem.

  4. self-assigned this
    on Sep 22, 2017
  5. juanjux commented on Sep 22, 2017

    @juanjux
    Contributor

    I tried several alternatives, using symlinks, renaming the in to in_ in the protofiles... this one is the one that causes less pain and should not matter much if we import everything from __init__.py.

  6. juanjux commented on Nov 13, 2017

    @juanjux
    Contributor

    Implemented in 2.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions