Skip to content
Snippets Groups Projects
Commit 3d73b19c authored by Joseph Weston's avatar Joseph Weston
Browse files

update setup script and copied function in _common.py

parent cf351598
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,7 @@ def get_version_from_git():
return
if p.wait() != 0:
return
# TODO: use os.path.samefile once we depend on Python >= 3.3.
if os.path.normpath(p.communicate()[0].rstrip('\n')) != distr_root:
if not os.path.samefile(p.communicate()[0].decode().rstrip('\n'), distr_root):
# The top-level directory of the current Git repository is not the same
# as the root directory of the Kwant distribution: do not extract the
# version from Git.
......
......@@ -16,7 +16,7 @@ import os
import glob
import imp
import subprocess
import ConfigParser
import configparser
from setuptools import setup, find_packages, Extension, Command
from sysconfig import get_platform
from distutils.errors import DistutilsError, DistutilsModuleError, \
......@@ -263,7 +263,7 @@ def search_mumps():
except OSError:
pass
else:
p.communicate(input='int main() {}\n')
p.communicate(input=b'int main() {}\n')
if p.wait() == 0:
return {'libraries': libs}
return {}
......@@ -297,7 +297,7 @@ def extensions():
'kwant/graph/c_slicer/slicer.h']})]
#### Add components of Kwant with external compile-time dependencies.
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
try:
with open(CONFIG_FILE) as f:
config.readfp(f)
......@@ -334,7 +334,7 @@ def extensions():
if kwrds:
build_summary.append('Auto-configured MUMPS')
if kwrds:
for name, value in lapack.iteritems():
for name, value in lapack.items():
kwrds.setdefault(name, []).extend(value)
kwrds.setdefault('depends', []).extend(
[CONFIG_FILE, 'kwant/linalg/cmumps.pxd'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment