Skip to content

Commit

Permalink
Put long_description in setup.cfg.
Browse files Browse the repository at this point in the history
I hope this fixes a UnicodeDecodeError on Python 3.6 on some machines,
without needing special code in setup.py.
  • Loading branch information
mauritsvanrees committed Aug 24, 2020
1 parent a4413ae commit eda6670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[metadata]
long_description = file: README.rst, CHANGES.rst

[zest.releaser]
create-wheel = yes

Expand Down
25 changes: 2 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,12 @@
version = '2.0.3.dev0'


def read(filename):
with open(filename) as myfile:
try:
return myfile.read()
except UnicodeDecodeError:
# Happens on one Jenkins node on Python 3.6,
# so maybe it happens for users too.
pass
# Opening and reading as text failed, so retry opening as bytes.
with open(filename, "rb") as myfile:
contents = myfile.read()
return contents.decode("utf-8")


long_description = "\n".join(
[
read("README.rst"),
read("CHANGES.rst"),
]
)


setup(
name='Products.CMFPlacefulWorkflow',
version=version,
description="Workflow policies for Plone",
long_description=long_description,
# Note: long_description is in setup.cfg
# to avoid needing workarounds for UnicodeDecodeErrors.
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Plone",
Expand Down

0 comments on commit eda6670

Please sign in to comment.