Skip to content

Commit c761bae

Browse files
committed
fix entry_points in setup
1 parent 5d44649 commit c761bae

File tree

5 files changed

+41
-13
lines changed

5 files changed

+41
-13
lines changed

h5json/h5tojson/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
##############################################################################
2+
# Copyright by The HDF Group. #
3+
# All rights reserved. #
4+
# #
5+
# This file is part of H5Serv (HDF5 REST Server) Service, Libraries and #
6+
# Utilities. The full HDF5 REST Server copyright notice, including #
7+
# terms governing use, modification, and redistribution, is contained in #
8+
# the file COPYING, which can be found at the root of the source code #
9+
# distribution tree. If you do not have access to this file, you may #
10+
# request a copy from [email protected]. #
11+
##############################################################################
12+
13+
from __future__ import absolute_import

h5tojson/h5tojson.py renamed to h5json/h5tojson/h5tojson.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,5 @@ def main():
244244
dumper.dumpFile()
245245

246246

247-
main()
247+
if __name__ == "__main__":
248+
main()

h5json/jsontoh5/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
##############################################################################
2+
# Copyright by The HDF Group. #
3+
# All rights reserved. #
4+
# #
5+
# This file is part of H5Serv (HDF5 REST Server) Service, Libraries and #
6+
# Utilities. The full HDF5 REST Server copyright notice, including #
7+
# terms governing use, modification, and redistribution, is contained in #
8+
# the file COPYING, which can be found at the root of the source code #
9+
# distribution tree. If you do not have access to this file, you may #
10+
# request a copy from [email protected]. #
11+
##############################################################################
12+
13+
from __future__ import absolute_import

jsontoh5/jsontoh5.py renamed to h5json/jsontoh5/jsontoh5.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ def writeFile(self):
233233
self.createLinks() # link it all together
234234

235235
def main():
236-
237236
parser = argparse.ArgumentParser(usage='%(prog)s [-h] <json_file> <h5_file>')
238237
parser.add_argument('in_filename', nargs='+', help='JSon file to be converted to h5')
239238
parser.add_argument('out_filename', nargs='+', help='name of HDF5 output file')
@@ -276,5 +275,5 @@ def main():
276275

277276
print("done!")
278277

279-
280-
main()
278+
if __name__ == "__main__":
279+
main()

setup.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
# Always prefer setuptools over distutils
9-
from setuptools import setup, find_packages
9+
from setuptools import setup
1010
# To use a consistent encoding
1111
from codecs import open
1212
from os import path
@@ -23,7 +23,7 @@
2323
# Versions should comply with PEP440. For a discussion on single-sourcing
2424
# the version across setup.py and the project code, see
2525
# https://packaging.python.org/en/latest/single_source_version.html
26-
version='1.1.1',
26+
version='1.1.2',
2727

2828
description='HDF5/JSON Tools',
2929
long_description=long_description,
@@ -62,14 +62,16 @@
6262
'Programming Language :: Python :: 3.3',
6363
'Programming Language :: Python :: 3.4',
6464
'Programming Language :: Python :: 3.5',
65+
'Programming Language :: Python :: 3.6'
6566
],
6667

6768
# What does your project relate to?
6869
keywords='json hdf5 numpy array data',
6970

7071
# You can just specify the packages manually here if your project is
7172
# simple. Or you can use find_packages().
72-
packages=find_packages(exclude=['docs', 'test*']),
73+
#packages=find_packages(exclude=['docs', 'test*']),
74+
packages=['h5json','h5json.h5tojson','h5json.jsontoh5'],
7375

7476
# Alternatively, if you want to distribute just a my_module.py, uncomment
7577
# this:
@@ -80,6 +82,8 @@
8082
# requirements files see:
8183
# https://packaging.python.org/en/latest/requirements.html
8284
install_requires=['numpy>=1.10.4', 'h5py>=2.5'],
85+
setup_requires=['pkgconfig', 'six'],
86+
zip_safe=False,
8387

8488
# List additional groups of dependencies here (e.g. development
8589
# dependencies). You can install these using the following syntax,
@@ -106,10 +110,8 @@
106110
# To provide executable scripts, use entry points in preference to the
107111
# "scripts" keyword. Entry points provide cross-platform support and allow
108112
# pip to create the appropriate form of executable for the target platform.
109-
#entry_points={
110-
# 'console_scripts': [
111-
# 'h5tojson=h5tojson:h5tojson', 'jsontoh5=jsontoh5:jsontoh5',
112-
# ],
113-
#},
114-
scripts=['h5tojson/h5tojson.py', 'jsontoh5/jsontoh5.py'],
113+
entry_points={'console_scripts':
114+
['h5tojson = h5json.h5tojson.h5tojson:main',
115+
'jsontoh5 = h5json.jsontoh5.jsontoh5:main'
116+
]},
115117
)

0 commit comments

Comments
 (0)