Skip to content

Commit

Permalink
Enabled opening README.md with python2 in setup.py (#160)
Browse files Browse the repository at this point in the history
* Enabled opening README.md with python2 in setup.py

* remove comment

Co-authored-by: Sylvain Chevallier <sylvain.chevallier@uvsq.fr>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
  • Loading branch information
3 people committed Dec 21, 2022
1 parent 84c78c4 commit 42e5d7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setup.py
@@ -1,3 +1,4 @@
import sys
import os.path as op

from setuptools import setup, find_packages
Expand All @@ -13,7 +14,9 @@
if version is None:
raise RuntimeError("Could not determine version")

with open("README.md", "r", encoding="utf8") as fid:
is_python3 = sys.version_info.major >= 3
kwargs_open = {"encoding": "utf8"} if is_python3 else {}
with open('README.md', 'r', **kwargs_open) as fid:
long_description = fid.read()

setup(
Expand Down

0 comments on commit 42e5d7c

Please sign in to comment.