Skip to content

Commit

Permalink
setup.py: Remove Python 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Oct 20, 2023
1 parent fafed02 commit 6a42ae7
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@
import platform
from os.path import join, abspath, dirname
import numpy
import unicodedata
from subprocess import check_output

#A unicode function that is compatible with Python 2 and 3
u = lambda s: s if sys.version_info[0] > 2 else unicode(s, 'utf-8')
myopen = lambda s: open(s) if sys.version_info[0] == 2 else open(s, encoding="utf-8")

from setuptools import setup
from setuptools import Extension
from setuptools.command.install import install

def getBdistFriendlyString(s):
'''
Solve the issue with restructuredText README
"ordinal not in range error" when using bdist_mpkg or bdist_wininst
'''
return unicodedata.normalize('NFKD', u(s))

VERSION = open(join('cylp', 'VERSION')).read().strip()

Expand Down Expand Up @@ -404,8 +391,8 @@ def getBdistFriendlyString(s):
extra_link_args=extra_link_args), ]


s_README = getBdistFriendlyString(myopen('README.rst').read())
s_AUTHORS = u(open('AUTHORS').read())
s_README = open('README.rst').read()
s_AUTHORS = open('AUTHORS').read()

extra_files = ['cpp/*.hpp', 'cpp/*.h', 'cy/*.pxd', 'VERSION']

Expand Down

0 comments on commit 6a42ae7

Please sign in to comment.