Skip to content

Commit bd72437

Browse files
authored
Merge pull request #64 from QuLogic/setup-tweaks
Setup tweaks
2 parents 69e8e64 + f452968 commit bd72437

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ def file_walk_relative(top, remove=''):
3333

3434

3535
def read(*parts):
36-
return open(os.path.join(rootpath, *parts), 'r').read()
36+
with open(os.path.join(rootpath, *parts), 'rb') as f:
37+
return f.read().decode('utf-8')
3738

3839

3940
long_description = '{}'.format(read('README.rst'))
4041

4142
cmdclass = {'test': PyTest}
4243
cmdclass.update(versioneer.get_cmdclass())
4344

44-
with open('requirements.txt') as f:
45-
require = f.readlines()
46-
install_requires = [r.strip() for r in require]
45+
require = read('requirements.txt')
46+
install_requires = [r.strip() for r in require.splitlines()]
4747

4848
setup(
4949
name='cf_units',
@@ -53,7 +53,8 @@ def read(*parts):
5353
packages=['cf_units', 'cf_units/tests'],
5454
package_data={'cf_units': list(file_walk_relative('cf_units/etc',
5555
remove='cf_units/'))},
56-
data_files=[('cf_units', ['COPYING', 'COPYING.LESSER'])],
56+
data_files=[('share/doc/cf_units',
57+
['COPYING', 'COPYING.LESSER', 'README.rst'])],
5758
install_requires=install_requires,
5859
tests_require=['pytest', 'pep8'],
5960
cmdclass=cmdclass

0 commit comments

Comments
 (0)