Re: Gremlin-Python package structure

2016-06-16 Thread Stephen Mallette
> Please make the changes as you see fit and provide a PR.

+1

On Thu, Jun 16, 2016 at 12:23 PM, Marko Rodriguez 
wrote:

> HI David,
>
> Please make the changes as you see fit and provide a PR. I read through
> your explanation and it “makes sense” with the limited knowledge I have.
> What I would really like to understand is this whole __init__.py business
> and how you structure and document/etc. everything.
>
> Thank you for thinking about this,
> Marko.
>
> http://markorodriguez.com
>
>
>
> > On Jun 16, 2016, at 10:09 AM, David Brown  wrote:
> >
> > Hello everyone,
> >
> > I was thinking about the current Gremlin-Python distribution package
> > structure and names. As is, a user will install with:
> >
> > pip install gremlinpython
> >
> > Then, imports in application code will be something like this:
> >
> > from gremlin_python import PythonGraphTraversalSource, GroovyTranslator
> > from gremlin_rest_driver import RESTRemoteConnection
> >
> > (assuming the REST driver is part of the package)
> >
> > Or, in the case of a driver developer using the provided base classes:
> >
> > from gremlin_driver import RemoteConnection, Traverser
> >
> > This works fine, but I think it would make more sense to consolidate
> > commonly used classes, modules, and packages under the gremlin_python
> > namespace. Then, installation and use would look something like:
> >
> > pip install gremlin_python
> >
> > from gremlin_python import RESTRemoteConnection, ...
> > from gremlin_python.gremlin_driver import RemoteConnection ...
> >
> > I think in general this is the expected pattern for a Python
> > developer. While style generally dictates that distribution package
> > names don't use underscores, as Leif pointed out, underscores are
> > syntactically fine and in this case they emulate the naming convention
> > (a dash) used with the other GLVs.
> >
> > Therefore, I would propose changing the distribution name to:
> > gremlin_python. Then, change the directory structure so the two other
> > packages (gremlin_driver, gremlin_rest_driver) are contained within
> > the directory gremlin_python and updating the imports in the __init__
> > files as necessary:
> >
> > jython/
> > ...
> > jython/gremlin_python/
> > jython/gremlin_python/gremlin_driver/  # or you could just remove the
> > jython/gremlin_python/gremlin_rest_driver/
> >
> > Alternatively, all three packages could be included in a new directory
> > called gremlin_python
> >
> > jython/
> > ...
> > jython/gremlin_python/gremlin_python/
> > jython/gremlin_python/gremlin_driver/  # or you could just remove the
> > jython/gremlin_python/gremlin_rest_driver/
> >
> >
> > Also, on another note, I think we should use absolute package imports
> > inside the gremlin_python package.
> >
> > Ideas? Again I am happy to make these changes in a PR, or a committer
> > can just go ahead and do it if everyone agrees.
> >
> > Best,
> > --
> > David M. Brown
> > R.A. CulturePlex Lab, Western University
>
>


Re: Gremlin-Python package structure

2016-06-16 Thread Marko Rodriguez
HI David,

Please make the changes as you see fit and provide a PR. I read through your 
explanation and it “makes sense” with the limited knowledge I have. What I 
would really like to understand is this whole __init__.py business and how you 
structure and document/etc. everything.

Thank you for thinking about this,
Marko.

http://markorodriguez.com



> On Jun 16, 2016, at 10:09 AM, David Brown  wrote:
> 
> Hello everyone,
> 
> I was thinking about the current Gremlin-Python distribution package
> structure and names. As is, a user will install with:
> 
> pip install gremlinpython
> 
> Then, imports in application code will be something like this:
> 
> from gremlin_python import PythonGraphTraversalSource, GroovyTranslator
> from gremlin_rest_driver import RESTRemoteConnection
> 
> (assuming the REST driver is part of the package)
> 
> Or, in the case of a driver developer using the provided base classes:
> 
> from gremlin_driver import RemoteConnection, Traverser
> 
> This works fine, but I think it would make more sense to consolidate
> commonly used classes, modules, and packages under the gremlin_python
> namespace. Then, installation and use would look something like:
> 
> pip install gremlin_python
> 
> from gremlin_python import RESTRemoteConnection, ...
> from gremlin_python.gremlin_driver import RemoteConnection ...
> 
> I think in general this is the expected pattern for a Python
> developer. While style generally dictates that distribution package
> names don't use underscores, as Leif pointed out, underscores are
> syntactically fine and in this case they emulate the naming convention
> (a dash) used with the other GLVs.
> 
> Therefore, I would propose changing the distribution name to:
> gremlin_python. Then, change the directory structure so the two other
> packages (gremlin_driver, gremlin_rest_driver) are contained within
> the directory gremlin_python and updating the imports in the __init__
> files as necessary:
> 
> jython/
> ...
> jython/gremlin_python/
> jython/gremlin_python/gremlin_driver/  # or you could just remove the
> jython/gremlin_python/gremlin_rest_driver/
> 
> Alternatively, all three packages could be included in a new directory
> called gremlin_python
> 
> jython/
> ...
> jython/gremlin_python/gremlin_python/
> jython/gremlin_python/gremlin_driver/  # or you could just remove the
> jython/gremlin_python/gremlin_rest_driver/
> 
> 
> Also, on another note, I think we should use absolute package imports
> inside the gremlin_python package.
> 
> Ideas? Again I am happy to make these changes in a PR, or a committer
> can just go ahead and do it if everyone agrees.
> 
> Best,
> -- 
> David M. Brown
> R.A. CulturePlex Lab, Western University