Skip to content
Snippets Groups Projects
Commit 0832d7d1 authored by Steve Canny's avatar Steve Canny
Browse files

hotfix: setup error on Windows

* remove non-ascii characters from LICENSE
* refactor file reading in setup.py
parent a6228070
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,23 @@
Release History
---------------
0.3.0a3 (2014-01-06)
++++++++++++++++++++++
- Fix setup.py error on some Windows installs
0.3.0a1 (2014-01-05)
++++++++++++++++++++++
- Full object-oriented rewrite
- Feature-parity with prior version
- text: add paragraph, run, text, bold, italic
- table: add table, add row, add column
- styles: specify style for paragraph, table
- picture: add inline picture, auto-scaling
- breaks: add page break
- tests: full pytest and behave-based 2-layer test suite
0.3.0dev1 (2013-12-14)
++++++++++++++++++++++
......@@ -10,4 +27,3 @@ Release History
- Load default "template" .docx on open with no filename
- Open from stream and save to stream (file-like object)
- Add paragraph at and of document
The MIT License (MIT)
Copyright © 2013 Steve Canny, https://github.com/scanny
Copyright (c) 2013 Steve Canny, https://github.com/scanny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
......@@ -11,7 +11,7 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
......
......@@ -2,7 +2,7 @@
from docx.api import Document # noqa
__version__ = '0.3.0a1'
__version__ = '0.3.0a3'
# register custom Part classes with opc package reader
......
......@@ -5,13 +5,25 @@ import re
from setuptools import find_packages, setup
def text_of(relpath):
"""
Return string containing the contents of the file at *relpath* relative to
this file.
"""
thisdir = os.path.dirname(__file__)
file_path = os.path.join(thisdir, os.path.normpath(relpath))
with open(file_path) as f:
text = f.read()
text.decode('ascii') # result discarded, just make sure no non-ascii chars
return text
# Read the version from docx.__version__ without importing the package
# (and thus attempting to import packages it depends on that may not be
# installed yet)
thisdir = os.path.dirname(__file__)
init_py = os.path.join(thisdir, 'docx', '__init__.py')
version = re.search("__version__ = '([^']+)'", open(init_py).read()).group(1)
license = os.path.join(thisdir, 'LICENSE')
version = re.search(
"__version__ = '([^']+)'", text_of('docx/__init__.py')
).group(1)
NAME = 'python-docx'
......@@ -21,7 +33,7 @@ KEYWORDS = 'docx office openxml word'
AUTHOR = 'Steve Canny'
AUTHOR_EMAIL = 'python-docx@googlegroups.com'
URL = 'https://github.com/python-openxml/python-docx'
LICENSE = open(license).read()
LICENSE = text_of('LICENSE')
PACKAGES = find_packages(exclude=['tests', 'tests.*'])
PACKAGE_DATA = {'docx': ['templates/*']}
......@@ -46,9 +58,7 @@ CLASSIFIERS = [
'Topic :: Software Development :: Libraries'
]
readme = os.path.join(thisdir, 'README.rst')
history = os.path.join(thisdir, 'HISTORY.rst')
LONG_DESCRIPTION = open(readme).read() + '\n\n' + open(history).read()
LONG_DESCRIPTION = text_of('README.rst') + '\n\n' + text_of('HISTORY.rst')
params = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment