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

Commit 05cf18c

Browse files
committed
Hierarchical namespace
1 parent d95c80d commit 05cf18c

File tree

17 files changed

+62
-181
lines changed

17 files changed

+62
-181
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ scripts/auth.yml
1212
*.bak
1313
*.db-shm
1414
*.db-wal
15-
ga4gh_client/_version.py
15+
_version.py
1616
tests/data/registry.db
1717

1818
# Below based off of https://gist.github.com/octocat/9257657

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ before_script:
2121
# run_tests.py runs everything under the script: tag so only put commands
2222
# under it that we want to run (and want to be able to run) as local tests
2323
script:
24-
- flake8 client_dev.py setup.py tests ga4gh_client scripts
24+
- flake8 client_dev.py setup.py tests ga4gh scripts
2525
- nosetests tests
26-
--with-coverage --cover-package ga4gh_client
26+
--with-coverage --cover-package ga4gh.client
2727
--cover-inclusive --cover-min-percentage=50
2828
--cover-branches --cover-erase
2929
- make clean -C docs

client_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Simple shim for running the client program during development.
33
"""
4-
import ga4gh_client.cli as cli
4+
import ga4gh.client.cli as cli
55

66
if __name__ == "__main__":
77
cli.client_main()

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Client API
2929

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

32-
.. autoclass:: ga4gh_client.client.HttpClient
32+
.. autoclass:: ga4gh.client.client.HttpClient
3333
:members: get_reference_set, get_reference,
3434
get_dataset, get_variant_set, get_variant,
3535
get_read_group_set, get_read_group,

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import os
2020
import sys
2121
sys.path.insert(0, os.path.abspath('..'))
22-
import ga4gh_client
22+
import ga4gh.client
2323

2424
# -- General configuration ------------------------------------------------
2525

ga4gh/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Client for servers implementing the GA4GH api
3+
"""
4+
from __future__ import division
5+
from __future__ import print_function
6+
from __future__ import unicode_literals
7+
8+
__import__('pkg_resources').declare_namespace(__name__)

ga4gh_client/__init__.py renamed to ga4gh/client/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""
22
Reference implementation of the GA4GH client
33
"""
4+
# Don't include future imports here; we don't want to export them as
5+
# part of the package
6+
47
__version__ = "undefined"
58
try:
69
from . import _version

ga4gh_client/cli.py renamed to ga4gh/client/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
import logging
1010
import requests
1111

12-
import ga4gh_client
13-
import ga4gh_client.client as client
14-
import ga4gh_client.exceptions as exceptions
15-
import ga4gh_client.protocol as protocol
12+
import ga4gh.client
13+
import ga4gh.client.client as client
14+
import ga4gh.client.exceptions as exceptions
15+
import ga4gh.client.protocol as protocol
1616

17-
import ga4gh_common.cli as cli
17+
import ga4gh.common.cli as cli
1818

1919

2020
###############
@@ -36,7 +36,7 @@ def addVersionArgument(parser):
3636
versionString = (
3737
"GA4GH Client Version {}\n"
3838
"(Protocol Version {})".format(
39-
ga4gh_client.__version__, protocol.version))
39+
ga4gh.client.__version__, protocol.version))
4040
parser.add_argument(
4141
"--version", version=versionString, action="version")
4242

ga4gh_client/client.py renamed to ga4gh/client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import posixpath
1010
import logging
1111

12-
import ga4gh_client.protocol as protocol
13-
import ga4gh_client.exceptions as exceptions
12+
import ga4gh.client.protocol as protocol
13+
import ga4gh.client.exceptions as exceptions
1414

15-
import ga4gh_schemas.pb as pb
15+
import ga4gh.schemas.pb as pb
1616

1717

1818
class AbstractClient(object):
File renamed without changes.

ga4gh_client/protocol.py renamed to ga4gh/client/protocol.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
import google.protobuf.message as message
1515
import google.protobuf.struct_pb2 as struct_pb2
1616

17-
import ga4gh_schemas.pb as pb
18-
19-
from ga4gh_schemas._protocol_version import version # noqa
20-
from ga4gh_schemas.ga4gh.common_pb2 import * # noqa
21-
from ga4gh_schemas.ga4gh.assay_metadata_pb2 import * # noqa
22-
from ga4gh_schemas.ga4gh.metadata_pb2 import * # noqa
23-
from ga4gh_schemas.ga4gh.metadata_service_pb2 import * # noqa
24-
from ga4gh_schemas.ga4gh.read_service_pb2 import * # noqa
25-
from ga4gh_schemas.ga4gh.reads_pb2 import * # noqa
26-
from ga4gh_schemas.ga4gh.reference_service_pb2 import * # noqa
27-
from ga4gh_schemas.ga4gh.references_pb2 import * # noqa
28-
from ga4gh_schemas.ga4gh.variant_service_pb2 import * # noqa
29-
from ga4gh_schemas.ga4gh.variants_pb2 import * # noqa
30-
from ga4gh_schemas.ga4gh.allele_annotations_pb2 import * # noqa
31-
from ga4gh_schemas.ga4gh.allele_annotation_service_pb2 import * # noqa
32-
from ga4gh_schemas.ga4gh.sequence_annotations_pb2 import * # noqa
33-
from ga4gh_schemas.ga4gh.sequence_annotation_service_pb2 import * # noqa
34-
from ga4gh_schemas.ga4gh.bio_metadata_pb2 import * # noqa
35-
from ga4gh_schemas.ga4gh.bio_metadata_service_pb2 import * # noqa
36-
from ga4gh_schemas.ga4gh.genotype_phenotype_pb2 import * # noqa
37-
from ga4gh_schemas.ga4gh.genotype_phenotype_service_pb2 import * # noqa
38-
from ga4gh_schemas.ga4gh.rna_quantification_pb2 import * # noqa
39-
from ga4gh_schemas.ga4gh.rna_quantification_service_pb2 import * # noqa
17+
import ga4gh.schemas.pb as pb
18+
19+
from ga4gh.schemas._protocol_version import version # noqa
20+
from ga4gh.schemas.ga4gh.common_pb2 import * # noqa
21+
from ga4gh.schemas.ga4gh.assay_metadata_pb2 import * # noqa
22+
from ga4gh.schemas.ga4gh.metadata_pb2 import * # noqa
23+
from ga4gh.schemas.ga4gh.metadata_service_pb2 import * # noqa
24+
from ga4gh.schemas.ga4gh.read_service_pb2 import * # noqa
25+
from ga4gh.schemas.ga4gh.reads_pb2 import * # noqa
26+
from ga4gh.schemas.ga4gh.reference_service_pb2 import * # noqa
27+
from ga4gh.schemas.ga4gh.references_pb2 import * # noqa
28+
from ga4gh.schemas.ga4gh.variant_service_pb2 import * # noqa
29+
from ga4gh.schemas.ga4gh.variants_pb2 import * # noqa
30+
from ga4gh.schemas.ga4gh.allele_annotations_pb2 import * # noqa
31+
from ga4gh.schemas.ga4gh.allele_annotation_service_pb2 import * # noqa
32+
from ga4gh.schemas.ga4gh.sequence_annotations_pb2 import * # noqa
33+
from ga4gh.schemas.ga4gh.sequence_annotation_service_pb2 import * # noqa
34+
from ga4gh.schemas.ga4gh.bio_metadata_pb2 import * # noqa
35+
from ga4gh.schemas.ga4gh.bio_metadata_service_pb2 import * # noqa
36+
from ga4gh.schemas.ga4gh.genotype_phenotype_pb2 import * # noqa
37+
from ga4gh.schemas.ga4gh.genotype_phenotype_service_pb2 import * # noqa
38+
from ga4gh.schemas.ga4gh.rna_quantification_pb2 import * # noqa
39+
from ga4gh.schemas.ga4gh.rna_quantification_service_pb2 import * # noqa
4040

4141

4242
# A map of response objects to the name of the attribute used to

ga4gh_client/_protocol_version.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# These requirements are read directly into setup.py, so specify them
55
# in the order that they should be in in setup.py
6-
ga4gh_common==0.0.4
7-
ga4gh_schemas==0.0.7
6+
ga4gh_common==0.0.5
7+
ga4gh_schemas==0.0.8
88
requests
99
protobuf==3.0.0b3

scripts/process_schemas.py

Lines changed: 0 additions & 130 deletions
This file was deleted.

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
# END BOILERPLATE
2828
name="ga4gh_client",
2929
description="A client for the GA4GH reference server",
30-
packages=["ga4gh_client"],
30+
packages=["ga4gh", "ga4gh.client"],
31+
namespace_packages=["ga4gh"],
3132
url="https://github.com/ga4gh/ga4gh-client",
32-
use_scm_version={"write_to": "ga4gh_client/_version.py"},
33+
use_scm_version={"write_to": "ga4gh/client/_version.py"},
3334
entry_points={
3435
'console_scripts': [
35-
'ga4gh_client=ga4gh_client.cli:client_main',
36+
'ga4gh_client=ga4gh.client.cli:client_main',
3637
]
3738
},
3839
# BEGIN BOILERPLATE

tests/unit/test_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import mock
1010
import unittest
1111

12-
import ga4gh_client.cli as cli_client
13-
import ga4gh_client.protocol as protocol
1412
import google.protobuf.descriptor as descriptor
1513
import google.protobuf.internal.python_message as python_message
16-
import ga4gh_common.utils as utils
14+
15+
import ga4gh.client.cli as cli_client
16+
import ga4gh.client.protocol as protocol
17+
import ga4gh.common.utils as utils
1718

1819

1920
class TestClientArguments(unittest.TestCase):

tests/unit/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import mock
1111

12-
import ga4gh_client.protocol as protocol
13-
import ga4gh_client.client as client
14-
import ga4gh_client.exceptions as exceptions
12+
import ga4gh.client.protocol as protocol
13+
import ga4gh.client.client as client
14+
import ga4gh.client.exceptions as exceptions
1515

1616

1717
class TestSearchMethodsCallRunRequest(unittest.TestCase):

0 commit comments

Comments
 (0)