summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-04-19 22:40:50 +0100
committerMichael Williamson <mike@zwobble.org>2016-04-19 22:40:50 +0100
commit69e9cf714ff6710e6ad9a34f11f2a5f15f2de841 (patch)
treeb9f2c73c7c3ede12fd3c58208c03592396b396ef
parent03110307662f75daa97a871b7e128715543ba306 (diff)
Use entry_points instead of scripts in setup.py
This improves support for script installation on Windows.
-rw-r--r--NEWS5
-rw-r--r--mammoth/cli.py (renamed from scripts/mammoth)5
-rw-r--r--setup.py6
3 files changed, 12 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index e63eb86..1f9486a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+# 1.0.1
+
+* Improve script installation on Windows by using entry_points instead of
+ scripts in setup.py.
+
# 1.0.0
* Remove deprecated convert_underline argument.
diff --git a/scripts/mammoth b/mammoth/cli.py
index 1194540..8161a3f 100644
--- a/scripts/mammoth
+++ b/mammoth/cli.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
import argparse
import contextlib
import sys
@@ -7,7 +5,7 @@ import os
import shutil
import mammoth
-from mammoth import writers
+from . import writers
def main():
@@ -114,3 +112,4 @@ def _parse_args():
if __name__ == "__main__":
main()
+
diff --git a/setup.py b/setup.py
index 31d0c5f..cb969db 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,11 @@ setup(
author_email='mike@zwobble.org',
url='http://github.com/mwilliamson/python-mammoth',
packages=['mammoth', 'mammoth.docx', 'mammoth.html', 'mammoth.style_reader', 'mammoth.writers'],
- scripts=["scripts/mammoth"],
+ entry_points={
+ "console_scripts": [
+ "mammoth=mammoth.cli:main"
+ ]
+ },
keywords="docx word office clean html markdown md",
install_requires=_install_requires,
classifiers=[