Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #22 from dcolligan/namespace
Browse files Browse the repository at this point in the history
Hierarchical namespace
  • Loading branch information
dcolligan authored Nov 2, 2016
2 parents d95c80d + 05cf18c commit 4bfc0dc
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ scripts/auth.yml
*.bak
*.db-shm
*.db-wal
ga4gh_client/_version.py
_version.py
tests/data/registry.db

# Below based off of https://gist.github.com/octocat/9257657
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ before_script:
# run_tests.py runs everything under the script: tag so only put commands
# under it that we want to run (and want to be able to run) as local tests
script:
- flake8 client_dev.py setup.py tests ga4gh_client scripts
- flake8 client_dev.py setup.py tests ga4gh scripts
- nosetests tests
--with-coverage --cover-package ga4gh_client
--with-coverage --cover-package ga4gh.client
--cover-inclusive --cover-min-percentage=50
--cover-branches --cover-erase
- make clean -C docs
Expand Down
2 changes: 1 addition & 1 deletion client_dev.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Simple shim for running the client program during development.
"""
import ga4gh_client.cli as cli
import ga4gh.client.cli as cli

if __name__ == "__main__":
cli.client_main()
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Client API

.. todo:: Add overview documentation for the client API.

.. autoclass:: ga4gh_client.client.HttpClient
.. autoclass:: ga4gh.client.client.HttpClient
:members: get_reference_set, get_reference,
get_dataset, get_variant_set, get_variant,
get_read_group_set, get_read_group,
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import ga4gh_client
import ga4gh.client

# -- General configuration ------------------------------------------------

Expand Down
8 changes: 8 additions & 0 deletions ga4gh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Client for servers implementing the GA4GH api
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

__import__('pkg_resources').declare_namespace(__name__)
3 changes: 3 additions & 0 deletions ga4gh_client/__init__.py → ga4gh/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""
Reference implementation of the GA4GH client
"""
# Don't include future imports here; we don't want to export them as
# part of the package

__version__ = "undefined"
try:
from . import _version
Expand Down
12 changes: 6 additions & 6 deletions ga4gh_client/cli.py → ga4gh/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import logging
import requests

import ga4gh_client
import ga4gh_client.client as client
import ga4gh_client.exceptions as exceptions
import ga4gh_client.protocol as protocol
import ga4gh.client
import ga4gh.client.client as client
import ga4gh.client.exceptions as exceptions
import ga4gh.client.protocol as protocol

import ga4gh_common.cli as cli
import ga4gh.common.cli as cli


###############
Expand All @@ -36,7 +36,7 @@ def addVersionArgument(parser):
versionString = (
"GA4GH Client Version {}\n"
"(Protocol Version {})".format(
ga4gh_client.__version__, protocol.version))
ga4gh.client.__version__, protocol.version))
parser.add_argument(
"--version", version=versionString, action="version")

Expand Down
6 changes: 3 additions & 3 deletions ga4gh_client/client.py → ga4gh/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import posixpath
import logging

import ga4gh_client.protocol as protocol
import ga4gh_client.exceptions as exceptions
import ga4gh.client.protocol as protocol
import ga4gh.client.exceptions as exceptions

import ga4gh_schemas.pb as pb
import ga4gh.schemas.pb as pb


class AbstractClient(object):
Expand Down
File renamed without changes.
46 changes: 23 additions & 23 deletions ga4gh_client/protocol.py → ga4gh/client/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@
import google.protobuf.message as message
import google.protobuf.struct_pb2 as struct_pb2

import ga4gh_schemas.pb as pb

from ga4gh_schemas._protocol_version import version # noqa
from ga4gh_schemas.ga4gh.common_pb2 import * # noqa
from ga4gh_schemas.ga4gh.assay_metadata_pb2 import * # noqa
from ga4gh_schemas.ga4gh.metadata_pb2 import * # noqa
from ga4gh_schemas.ga4gh.metadata_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.read_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.reads_pb2 import * # noqa
from ga4gh_schemas.ga4gh.reference_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.references_pb2 import * # noqa
from ga4gh_schemas.ga4gh.variant_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.variants_pb2 import * # noqa
from ga4gh_schemas.ga4gh.allele_annotations_pb2 import * # noqa
from ga4gh_schemas.ga4gh.allele_annotation_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.sequence_annotations_pb2 import * # noqa
from ga4gh_schemas.ga4gh.sequence_annotation_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.bio_metadata_pb2 import * # noqa
from ga4gh_schemas.ga4gh.bio_metadata_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.genotype_phenotype_pb2 import * # noqa
from ga4gh_schemas.ga4gh.genotype_phenotype_service_pb2 import * # noqa
from ga4gh_schemas.ga4gh.rna_quantification_pb2 import * # noqa
from ga4gh_schemas.ga4gh.rna_quantification_service_pb2 import * # noqa
import ga4gh.schemas.pb as pb

from ga4gh.schemas._protocol_version import version # noqa
from ga4gh.schemas.ga4gh.common_pb2 import * # noqa
from ga4gh.schemas.ga4gh.assay_metadata_pb2 import * # noqa
from ga4gh.schemas.ga4gh.metadata_pb2 import * # noqa
from ga4gh.schemas.ga4gh.metadata_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.read_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.reads_pb2 import * # noqa
from ga4gh.schemas.ga4gh.reference_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.references_pb2 import * # noqa
from ga4gh.schemas.ga4gh.variant_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.variants_pb2 import * # noqa
from ga4gh.schemas.ga4gh.allele_annotations_pb2 import * # noqa
from ga4gh.schemas.ga4gh.allele_annotation_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.sequence_annotations_pb2 import * # noqa
from ga4gh.schemas.ga4gh.sequence_annotation_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.bio_metadata_pb2 import * # noqa
from ga4gh.schemas.ga4gh.bio_metadata_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.genotype_phenotype_pb2 import * # noqa
from ga4gh.schemas.ga4gh.genotype_phenotype_service_pb2 import * # noqa
from ga4gh.schemas.ga4gh.rna_quantification_pb2 import * # noqa
from ga4gh.schemas.ga4gh.rna_quantification_service_pb2 import * # noqa


# A map of response objects to the name of the attribute used to
Expand Down
2 changes: 0 additions & 2 deletions ga4gh_client/_protocol_version.py

This file was deleted.

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# These requirements are read directly into setup.py, so specify them
# in the order that they should be in in setup.py
ga4gh_common==0.0.4
ga4gh_schemas==0.0.7
ga4gh_common==0.0.5
ga4gh_schemas==0.0.8
requests
protobuf==3.0.0b3
130 changes: 0 additions & 130 deletions scripts/process_schemas.py

This file was deleted.

7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
# END BOILERPLATE
name="ga4gh_client",
description="A client for the GA4GH reference server",
packages=["ga4gh_client"],
packages=["ga4gh", "ga4gh.client"],
namespace_packages=["ga4gh"],
url="https://github.com/ga4gh/ga4gh-client",
use_scm_version={"write_to": "ga4gh_client/_version.py"},
use_scm_version={"write_to": "ga4gh/client/_version.py"},
entry_points={
'console_scripts': [
'ga4gh_client=ga4gh_client.cli:client_main',
'ga4gh_client=ga4gh.client.cli:client_main',
]
},
# BEGIN BOILERPLATE
Expand Down
7 changes: 4 additions & 3 deletions tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
import mock
import unittest

import ga4gh_client.cli as cli_client
import ga4gh_client.protocol as protocol
import google.protobuf.descriptor as descriptor
import google.protobuf.internal.python_message as python_message
import ga4gh_common.utils as utils

import ga4gh.client.cli as cli_client
import ga4gh.client.protocol as protocol
import ga4gh.common.utils as utils


class TestClientArguments(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

import mock

import ga4gh_client.protocol as protocol
import ga4gh_client.client as client
import ga4gh_client.exceptions as exceptions
import ga4gh.client.protocol as protocol
import ga4gh.client.client as client
import ga4gh.client.exceptions as exceptions


class TestSearchMethodsCallRunRequest(unittest.TestCase):
Expand Down

0 comments on commit 4bfc0dc

Please sign in to comment.