Skip to content

Commit 93643af

Browse files
committed
Support CLI on Windows by refactoring scripts to console_scripts
1 parent d8e1a6e commit 93643af

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

File renamed without changes.
File renamed without changes.

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@
1010
from distutils.core import setup
1111
has_setuptools = False
1212

13-
src = io.open('jsonpatch.py', encoding='utf-8').read()
13+
src = io.open('jsonpatch/__init__.py', encoding='utf-8').read()
1414
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", src))
1515
docstrings = re.findall('"""([^"]*)"""', src, re.MULTILINE | re.DOTALL)
1616

1717
PACKAGE = 'jsonpatch'
1818

19-
MODULES = (
20-
'jsonpatch',
21-
)
19+
MODULES = [
20+
'jsonpatch',
21+
'jsonpatch._jsondiff_cli',
22+
'jsonpatch._jsonpatch_cli',
23+
]
2224

2325
REQUIREMENTS = list(open('requirements.txt'))
2426

@@ -79,7 +81,12 @@
7981
url=WEBSITE,
8082
py_modules=MODULES,
8183
package_data={'': ['requirements.txt']},
82-
scripts=['bin/jsondiff', 'bin/jsonpatch'],
84+
entry_points={
85+
'console_scripts': [
86+
'jsondiff = jsonpatch._jsondiff_cli:main',
87+
'jsonpatch = jsonpatch._jsonpatch_cli:main',
88+
]
89+
},
8390
classifiers=CLASSIFIERS,
8491
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*',
8592
project_urls={

0 commit comments

Comments
 (0)