Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 9eff02a

Browse files
committed
Add console scripts support.
Change-Id: I18cd092b75f42c1c4cf8e1c79a8b7ecf17051380
1 parent cbba97c commit 9eff02a

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

setup.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@
1919

2020

2121
REQUIRED_PACKAGES = [
22+
"absl-py < 0.9, >= 0.7",
2223
"apache-beam[gcp] >= 2.22.0",
23-
"pandas >= 1.0.4",
24-
"tensorflow_transform >= 0.22",
25-
"Pillow >= 7.1.2",
24+
"avro >= 1.10.0",
2625
"coverage >= 5.1",
2726
"ipython >= 7.15.0",
27+
"fire >= 0.3.1",
2828
"nose >= 1.3.7",
29+
"pandas >= 1.0.4",
30+
"Pillow >= 7.1.2",
31+
"pyarrow < 0.17, >= 0.16.0",
2932
"pylint >= 2.5.3",
30-
"fire >= 0.3.1",
31-
"tensorflow >= 2.2.0",
32-
"pyarrow < 0.17",
33+
"pytz >= 2020.1",
34+
"python-dateutil",
35+
"tensorflow == 2.2.0",
36+
"tensorflow_transform >= 0.22",
3337
]
3438

3539

@@ -39,5 +43,8 @@
3943
install_requires=REQUIRED_PACKAGES,
4044
packages=find_packages(),
4145
include_package_data=True,
42-
description='TFRUtil creates TensorFlow Records easily.'
46+
description='TFRUtil creates TensorFlow Records easily.',
47+
entry_points = {
48+
'console_scripts': ['tfrutil=tfrutil.cli:main'],
49+
},
4350
)

tfrutil/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
from tfrutil import check
2323

2424

25-
if __name__ == '__main__':
25+
def main():
26+
"""Entry point for command-line interface."""
27+
2628
fire.Fire({
2729
'create-tfrecords': client.create_tfrecords,
2830
'check-tfrecords': check.check_tfrecords,
2931
})
32+
33+
34+
if __name__ == '__main__':
35+
main()

0 commit comments

Comments
 (0)