Skip to content

Commit 8fa0047

Browse files
author
Nalini Ganapati
committed
Refactor to make genomicsdb_query and genomicsdb_cache console scripts
1 parent 5b3351f commit 8fa0047

11 files changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/basic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ jobs:
9696
run: |
9797
PYTHONPATH=. pytest
9898
PYTHONPATH=. python test/test.py
99-
PYTHONPATH=. examples/test.sh
99+
PYTHONPATH=. test/scripts/test.sh
100100
101101
- name: Cloud Test - Azurite
102102
run: |
103103
source .github/scripts/setup_azurite.sh
104104
echo "Testing on Azurite..."
105105
echo "WORKSPACE=$WORKSPACE OLDSTYLE_DIR=$OLDSTYLE_DIR"
106-
PYTHONPATH=. ./examples/test.sh
106+
PYTHONPATH=. test/scripts/test.sh
107107
ls -l /tmp/tiledb_bookkeeping
108108
echo "Testing on Azurite DONE"
109109

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ clean-test: ## remove test and coverage artifacts
5555
rm -fr .pytest_cache
5656

5757
format: ## format files with black and isort
58-
black --line-length 120 setup.py src test examples/genomicsdb_*
59-
isort --profile black --line-length 120 setup.py src test examples/genomicsdb_*
58+
black --line-length 120 setup.py src test genomicsdb/scripts
59+
isort --profile black --line-length 120 setup.py src test genomicsdb/scripts
6060

6161
lint: ## check style with flake8 and vulnerabilities with bandit
6262
bandit -r setup.py src
63-
flake8 --extend-ignore='E203, N803, N806, E402' --max-line-length=120 setup.py src test examples/genomicsdb_*
64-
black --check --line-length 120 setup.py src test examples/genomicsdb_*
65-
isort --profile black --line-length 120 -c setup.py src test examples/genomicsdb_*
63+
flake8 --extend-ignore='E203, N803, N806, E402' --max-line-length=120 setup.py src test genomicsdb/scripts
64+
black --check --line-length 120 setup.py src test genomicsdb/scripts
65+
isort --profile black --line-length 120 -c setup.py src test genomicsdb/scripts
6666
cython-lint --max-line-length 120 src/*.pyx
6767

6868
test: FORCE ## run tests quickly with the default Python

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@ cd genomicsdb-<version>
1919
python setup.py install
2020
```
2121

22+
## GenomicsDB console scripts
23+
See [GenomicsDB query tool](https://github.com/GenomicsDB/GenomicsDB-Python/blob/master/genomicsdb/scripts/README.md) for the available console scripts. As of now the supported output options are as csv, json and parquet files.
24+
2225
## Development
2326
See [instructions](https://github.com/GenomicsDB/GenomicsDB-Python/blob/master/INSTALL.md) for local builds and running tests.
File renamed without changes.

genomicsdb/scripts/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# The MIT License
77
#
8-
# Copyright (c) 2024 dātma, inc™
8+
# Copyright (c) 2024-2025 dātma, inc™
99
#
1010
# Permission is hereby granted, free of charge, to any person obtaining a copy
1111
# of this software and associated documentation files (the "Software"), to deal
@@ -29,9 +29,8 @@
2929
import argparse
3030
import json
3131

32-
import genomicsdb_common
33-
3432
import genomicsdb
33+
from genomicsdb.scripts import genomicsdb_common
3534

3635

3736
def is_cloud_path(path):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# The MIT License
77
#
8-
# Copyright (c) 2024 dātma, inc™
8+
# Copyright (c) 2024-2025 dātma, inc™
99
#
1010
# Permission is hereby granted, free of charge, to any person obtaining a copy
1111
# of this software and associated documentation files (the "Software"), to deal
@@ -35,14 +35,14 @@
3535
import sys
3636
from typing import List, NamedTuple
3737

38-
import genomicsdb_common
3938
import pyarrow as pa
4039
import pyarrow.parquet as pq
4140

4241
import genomicsdb
4342
from genomicsdb import json_output_mode
4443
from genomicsdb.protobuf import genomicsdb_coordinates_pb2 as query_coords
4544
from genomicsdb.protobuf import genomicsdb_export_config_pb2 as query_pb
45+
from genomicsdb.scripts import genomicsdb_common
4646

4747
logging.basicConfig(
4848
format="%(asctime)s.%(msecs)03d %(levelname)-5s GenomicsDB Python - pid=%(process)d tid=%(thread)d %(message)s",

setup.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# The MIT License (MIT)
55
#
6-
# Copyright (c) 2023 dātma, inc™
6+
# Copyright (c) 2023-2025 dātma, inc™
77
#
88
# Permission is hereby granted, free of charge, to any person obtaining a copy of
99
# this software and associated documentation files (the "Software"), to deal in
@@ -146,7 +146,7 @@ def run_cythonize(src):
146146

147147
setup(
148148
name="genomicsdb",
149-
description="Experimental Python Bindings for querying GenomicsDB",
149+
description="Python Bindings for querying GenomicsDB",
150150
long_description=long_description,
151151
long_description_content_type="text/markdown",
152152
author="GenomicsDB.org",
@@ -159,12 +159,18 @@ def run_cythonize(src):
159159
setup_requires=["cython>=0.27"],
160160
install_requires=install_requirements,
161161
python_requires=">=3.9",
162-
packages=find_packages(exclude=["package", "test"]),
162+
packages=find_packages(include=["genomicsdb", "genomicsdb.*"], exclude=["package", "test"]),
163163
keywords=["genomics", "genomicsdb", "variant", "vcf", "variant calls"],
164164
include_package_data=True,
165165
version=with_version,
166+
entry_points={
167+
"console_scripts": [
168+
"genomicsdb_query=genomicsdb.scripts.genomicsdb_query:main",
169+
"genomicsdb_cache=genomicsdb.scripts.genomicsdb_cache:main",
170+
],
171+
},
166172
classifiers=[
167-
"Development Status :: 3 - Alpha",
173+
"Development Status :: 5 - Production/Stable",
168174
"Intended Audience :: Developers",
169175
"Intended Audience :: Information Technology",
170176
"Intended Audience :: Science/Research",

0 commit comments

Comments
 (0)