-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BLD More debug information when numpy cannot be imported
- Loading branch information
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2009-2020, Luis Pedro Coelho <[email protected]> | ||
# Copyright (C) 2009-2024, Luis Pedro Coelho <[email protected]> | ||
# vim: set ts=4 sts=4 sw=4 expandtab smartindent: | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -33,7 +33,12 @@ | |
import os | ||
try: | ||
import numpy | ||
except ImportError: | ||
except ImportError as e: | ||
print(''' | ||
Could not import numpy ({}). | ||
It is possible that building will fail. | ||
'''.format(e)) | ||
class FakeNumpy(object): | ||
def get_include(self): | ||
return [] | ||
|
@@ -45,10 +50,7 @@ def get_include(self): | |
exec(compile(open('mahotas/mahotas_version.py').read(), | ||
'mahotas/mahotas_version.py', 'exec')) | ||
|
||
try: | ||
long_description = open('README.md', encoding='utf-8').read() | ||
except: | ||
long_description = open('README.md').read() | ||
long_description = open('README.md', encoding='utf-8').read() | ||
|
||
undef_macros = [] | ||
define_macros = [] | ||
|
@@ -78,7 +80,9 @@ def get_include(self): | |
'mahotas.features._zernike': ['mahotas/features/_zernike.cpp'], | ||
} | ||
|
||
ext_modules = [setuptools.Extension(key, sources=sources, undef_macros=undef_macros, define_macros=define_macros, include_dirs=[numpy.get_include()]) for key,sources in extensions.items()] | ||
ext_modules = [ | ||
setuptools.Extension(key, sources=sources, undef_macros=undef_macros, define_macros=define_macros, include_dirs=[numpy.get_include()]) | ||
for key,sources in extensions.items()] | ||
|
||
packages = setuptools.find_packages() | ||
|
||
|
@@ -123,6 +127,10 @@ def build_extensions(self): | |
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: C++', | ||
'Operating System :: OS Independent', | ||
'License :: OSI Approved :: MIT License', | ||
|