Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH-FIX: change distutils to setuptools and add flexible cythonization #949

Merged
merged 121 commits into from
Jul 12, 2016
Merged
Changes from 1 commit
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
243c27e
ENH-FIX: change distutils to setuptools
sem-geologist Apr 9, 2016
d57a62e
add-fix: Extension bits
sem-geologist Apr 10, 2016
883097d
fix import syntax
sem-geologist Apr 10, 2016
8d64a71
fix...
sem-geologist Apr 10, 2016
6687513
fix: setuptools vs distutils
sem-geologist Apr 10, 2016
a83d692
Create test_cython_integration.pyx
sem-geologist Apr 10, 2016
ba3a222
add: initial cythonization code piece
sem-geologist Apr 10, 2016
ef8e478
enh: add working cythonization for install
sem-geologist Apr 11, 2016
1224d5c
fix: mising extensions global dict declaration
sem-geologist Apr 11, 2016
2ec5b8a
fix: add missing self to run()
sem-geologist Apr 11, 2016
340b769
fix: add finalize_options
sem-geologist Apr 11, 2016
1d3e026
mv-fix: cython building implementation
sem-geologist Apr 14, 2016
f1b4a56
add: cython dependency to travis and appveyor
sem-geologist Apr 14, 2016
621df25
add-mv: testing of cythonization
sem-geologist Apr 14, 2016
3528437
add: git post-checkout hook generator
sem-geologist Apr 14, 2016
6f35683
add: *.so to gitignore
sem-geologist Apr 15, 2016
b3a1f47
Update install.rst
sem-geologist Apr 15, 2016
259f72b
fix: git hook generator to remove old .c* and .so/.pyd
sem-geologist Apr 15, 2016
2d7f966
cleanup
sem-geologist Apr 15, 2016
d0834ce
Merge branch 'patch-2' of https://github.com/sem-geologist/hyperspy i…
sem-geologist Apr 15, 2016
34bfd3f
fix: apply suggested fixes to test_cython.py
sem-geologist Apr 15, 2016
751442e
fix-add: make post-checkout generator controlable
sem-geologist Apr 15, 2016
ad5c848
fix: add '\n before rm list
sem-geologist Apr 15, 2016
6b6fcc6
fix-add: .hook_ignore to .gitignore
sem-geologist Apr 15, 2016
058599b
fix: update test error messages
sem-geologist Apr 15, 2016
8ee89db
remove added documentation to different pull req..
sem-geologist Apr 15, 2016
2fb174a
fix-add: add include *.pyx to MANIFEST.in
sem-geologist Apr 15, 2016
400f93c
Merge branch 'patch-2' of https://github.com/sem-geologist/hyperspy i…
sem-geologist Apr 15, 2016
38c1bfb
fix-rm: remove_tree('build')
sem-geologist Apr 15, 2016
d0cea75
fix: changed the test_cythonization error msg
sem-geologist Apr 15, 2016
26be419
fix-add: generate cleanup list according to OS
sem-geologist Apr 15, 2016
ebd0cda
hmm: trial to enable bdist_wheel
sem-geologist Apr 16, 2016
cb575e6
fix-rev: revert back, and try other appveyor options
sem-geologist Apr 16, 2016
27a7de3
fix-test: fix and another try of bdist_wheel
sem-geologist Apr 16, 2016
f5adf40
test: travis osx trial#1
sem-geologist Apr 16, 2016
cb541b3
test: travis-osx trial#2
sem-geologist Apr 16, 2016
1cd8d4a
test: travis osx trial#3
sem-geologist Apr 16, 2016
b82b40a
test: travis osx trial #4
sem-geologist Apr 16, 2016
2290570
test: travis osx trial#5
sem-geologist Apr 16, 2016
0f5003b
test travis osx trial#6
sem-geologist Apr 16, 2016
db47790
test: travis osx ...
sem-geologist Apr 16, 2016
74a1b5c
fix: travis osx -- add to allow_failure
sem-geologist Apr 16, 2016
b76f582
fix: add back the fail_on_external...True
sem-geologist Apr 16, 2016
69097df
fix: osx, add missing fi in /travis.yml
sem-geologist Apr 16, 2016
8015021
fix: osx travis build_wheel to bdist_wheel
sem-geologist Apr 16, 2016
4d55caf
test: add --verbose to nosetest
sem-geologist Apr 16, 2016
e660e09
test: comment out TestLoadingOOReadOnly
sem-geologist Apr 16, 2016
da40b9d
fix: remove osx from allow_failures in .travis.yml
sem-geologist Apr 16, 2016
6c05441
test: uncomment part of test commented before
sem-geologist Apr 16, 2016
451ce9f
test: uncomenting more
sem-geologist Apr 16, 2016
a635b2a
fix: test changes to comply with osx
sem-geologist Apr 16, 2016
bf1f553
test osx, memory
sem-geologist Apr 17, 2016
5ce4107
test osx
sem-geologist Apr 17, 2016
05a22e9
test osx
sem-geologist Apr 17, 2016
80d1f19
test osx
sem-geologist Apr 17, 2016
8479e01
test osx
sem-geologist Apr 17, 2016
0fea97d
test osx
sem-geologist Apr 17, 2016
4b15bbf
cleanup
sem-geologist Apr 17, 2016
78811e7
remove --verbose from CI
sem-geologist Apr 17, 2016
ef8c3e7
fix: strict up path in setup.py
sem-geologist Apr 22, 2016
7093dae
blind mans blind try of release
sem-geologist Apr 22, 2016
3dc1442
update token
sem-geologist Apr 22, 2016
19d59ad
try: travis on release build sdist and bdist(osx)
sem-geologist Apr 22, 2016
627e792
travis fix?
sem-geologist Apr 22, 2016
0ce6ee5
test: travis fix?
sem-geologist Apr 22, 2016
65d908e
update travis.yml
sem-geologist Apr 22, 2016
218485c
fix travis.yml
sem-geologist Apr 22, 2016
cb8fc15
fix: travis releases test
sem-geologist Apr 23, 2016
dbfcb01
fix: travis
sem-geologist Apr 23, 2016
085625c
fix-add: to travis.yml deploy
sem-geologist Apr 23, 2016
2a24a7a
fix: ci release encrypted keys
sem-geologist Apr 23, 2016
1cca1bd
fix: comment out winpython
sem-geologist Apr 23, 2016
35b5df5
update: oauth key
sem-geologist Apr 23, 2016
5887321
try: dissable some parts of appveoyr
sem-geologist Apr 24, 2016
394f375
test: appveoyr release
sem-geologist Apr 24, 2016
9716844
try: adding branch and repo to appveoyr
sem-geologist Apr 24, 2016
4321198
rm: branch and repo from appvoyr yml
sem-geologist Apr 24, 2016
77f206f
rm: obsolete commented import
sem-geologist Apr 24, 2016
6618482
rm: describtion for release in
sem-geologist May 4, 2016
8a53140
fix-conflict with upstream
sem-geologist May 4, 2016
a971090
Merge pull request #6 from hyperspy/master
sem-geologist May 4, 2016
c711cef
change appveoyr.yml
sem-geologist May 5, 2016
f25a687
Merge branch 'patch-2' of https://github.com/sem-geologist/hyperspy i…
sem-geologist May 5, 2016
ec527d7
fix: uncomented comment
sem-geologist May 5, 2016
cb385ef
appveyor change
sem-geologist May 6, 2016
0eae46d
Merge remote-tracking branch 'upstream/master' into patch-2
sem-geologist Jun 22, 2016
34e9ba4
fix: travis on osx
sem-geologist Jun 23, 2016
46abb24
appveyor.yml cleanup
sem-geologist Jun 23, 2016
22b3147
rm: osx on depr. from travis matrix
sem-geologist Jun 23, 2016
22cb583
try: appvayor->force_update
sem-geologist Jun 29, 2016
830ff4c
temp disable winpython nsis in appveyor
sem-geologist Jun 29, 2016
8f8464d
rm: comma at setup.py->classifiers
sem-geologist Jun 29, 2016
3f4270d
uncomment appveyor winpython build
sem-geologist Jun 29, 2016
e9a66a4
try: add recythonize command before building
sem-geologist Jun 29, 2016
4c45c2e
bring back the comma, as removal
sem-geologist Jun 29, 2016
b6bee5b
fix: path issue in setup.py
sem-geologist Jul 6, 2016
70e9e2c
add visual studio :O
sem-geologist Jul 8, 2016
4ac6703
add: one liner to check winpython version
sem-geologist Jul 9, 2016
fe42722
fix oneliner
sem-geologist Jul 9, 2016
563a0be
add oneliner to anaconda python
sem-geologist Jul 9, 2016
028575a
try: removing pydistutils.cfg at winpython
sem-geologist Jul 9, 2016
2f58e24
fix: rem pydistutils
sem-geologist Jul 9, 2016
3c22b61
fix: leftovers of bad path
sem-geologist Jul 9, 2016
ff89fda
fix typo
sem-geologist Jul 9, 2016
04c903c
Update appveyor.yml
sem-geologist Jul 9, 2016
0f49385
try: fixing ps syntacs
sem-geologist Jul 9, 2016
4559fc1
fix: backslash to forwardslash arghhh...
sem-geologist Jul 9, 2016
ad8ee54
add minimal c c file
sem-geologist Jul 10, 2016
eff404c
add: compiler presence checker
sem-geologist Jul 10, 2016
87e652e
temp-test: comment out fixing compiler
sem-geologist Jul 10, 2016
26d6185
fix: typo
sem-geologist Jul 10, 2016
593eb24
fix: typo
sem-geologist Jul 10, 2016
0fb1219
fix: setup.py
sem-geologist Jul 10, 2016
f70026b
mv: test_compilers.c
sem-geologist Jul 10, 2016
d1c6f90
Merge pull request #8 from sem-geologist/release_test
sem-geologist Jul 10, 2016
1135d65
Rename hyperspy/tests/misc/test_compilers.c to hyperspy/misc/etc/test…
sem-geologist Jul 10, 2016
fa242a3
fix dummy c file path
sem-geologist Jul 10, 2016
cd6a213
Update MANIFEST.in
sem-geologist Jul 10, 2016
812473e
Merge pull request #10 from hyperspy/master
sem-geologist Jul 10, 2016
4f0e28f
fix: del to rem
sem-geologist Jul 11, 2016
232e795
add missing DistutilPlatformError catching
sem-geologist Jul 11, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

import re

#stuff to check presence of compiler:
import distutils.sysconfig
import distutils.ccompiler
from distutils.errors import CompileError

setup_path = os.path.dirname(__file__)

import hyperspy.Release as Release
Expand Down Expand Up @@ -132,6 +137,26 @@ def no_cythonize(extensions):
extensions = cythonize_extensions(raw_extensions)
else:
extensions = no_cythonize(raw_extensions)


# to compile or not to compile... depends if compiler is present:
compiler = distutils.ccompiler.new_compiler()
assert isinstance(compiler, distutils.ccompiler.CCompiler)
distutils.sysconfig.customize_compiler(compiler)
try:
compiler.compile([os.path.join(setup_path, 'test_compiler.c')])
os.remove([os.path.join(setup_path, 'test_compiler.o'))
except CompileError:
warnings.warn("""WARNING: C compiler can't be found.
Only slow pure python alternative functions will be available.
To use fast implementation of some functions writen in cython/c either:
a) check that you have compiler (EXACTLY SAME as your python
distribution was compiled with) installed,
b) use binary distribution of hyperspy (i.e. wheels, egg, (only osx and win)).
Installation will continue in 10 sec...""")
extensions = []
from time import sleep
sleep(10) #wait 10 secs for user to notice the message
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why waiting 10 s? As the user has to take no action I would simply print the warning and continue...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if terminal used have some limit (often 1000 lines, by default) it "flies" away. this will wait for 10 sec only if compiler is missing. if it is here, no waiting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I have results from winpython... it is bad, no matter to what extensions are set (empty list or None) if keyword ext_modules is provided to setup() then winpython anyway tries to fire up compiler :/. So I don't know what to do now as it is "impossible" to trick winpython from touching compiler.



# HOOKS ######
Expand Down