{"action":"created","issue":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/949","repository_url":"https://api.github.com/repos/hyperspy/hyperspy","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/949/labels{/name}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/949/comments","events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/949/events","html_url":"https://github.com/hyperspy/hyperspy/pull/949","id":147148139,"number":949,"title":"ENH-FIX: change distutils to setuptools and add flexible cythonization","user":{"login":"sem-geologist","id":12324068,"avatar_url":"https://avatars.githubusercontent.com/u/12324068?v=3","gravatar_id":"","url":"https://api.github.com/users/sem-geologist","html_url":"https://github.com/sem-geologist","followers_url":"https://api.github.com/users/sem-geologist/followers","following_url":"https://api.github.com/users/sem-geologist/following{/other_user}","gists_url":"https://api.github.com/users/sem-geologist/gists{/gist_id}","starred_url":"https://api.github.com/users/sem-geologist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sem-geologist/subscriptions","organizations_url":"https://api.github.com/users/sem-geologist/orgs","repos_url":"https://api.github.com/users/sem-geologist/repos","events_url":"https://api.github.com/users/sem-geologist/events{/privacy}","received_events_url":"https://api.github.com/users/sem-geologist/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/1.0","name":"1.0","color":"fef2c0"},{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/New","name":"New","color":"f7c6c7"},{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/waiting%20for%20author","name":"waiting for author","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/8","html_url":"https://github.com/hyperspy/hyperspy/milestones/1.0.0","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/8/labels","id":856137,"number":8,"title":"1.0.0","description":"","creator":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":143,"state":"open","created_at":"2014-11-06T15:54:23Z","updated_at":"2016-07-11T11:23:54Z","due_on":"2016-07-07T23:00:00Z","closed_at":null},"comments":87,"created_at":"2016-04-09T17:56:09Z","updated_at":"2016-07-11T13:13:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/949","html_url":"https://github.com/hyperspy/hyperspy/pull/949","diff_url":"https://github.com/hyperspy/hyperspy/pull/949.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/949.patch"},"body":"this code fixes two things:\r\n1. changes distutils to setuptools\r\n2. adds the flexible cythonization.\r\n\r\nfirst is straight forward, but second have to be discussed.\r\nFirstly lets consider these points:\r\n* User can obtain hyperspy in few different ways: git, binary distribution, source distribution.\r\n* It is highly recommended by cython documentation to distribute C files generated from cython as this makes cython not required during installation and prevents undefined behavior resulting from different versions of cython.\r\n* cython generated C files are huge, complicated, contains lots of \"boiler plates\" is quite ugly and hardly readable. It is not strange that it is not very welcome in the git source tree.\r\n* At this moment there is one library pending (bcf io_plugin) which have some functions implemented in cython, but alternative python code is also present, so even in worst scenario lack of cython should not be an obstacle for installment.  \r\n\r\nConsidering above the setup should meet such criteria:\r\n* do not have hard dependency on cython\r\n* automatically check if *.pyx files have c files with same name, if not:\r\n    * try to import cythonize from Cython and use on the pyx files\r\n    * if there is no cython present on the system, user should be informed and present of alternatives, but the installation should be not terminated as without cython code hyperspy is still fully functional, just in some minute parts where cython code would be missing it will be a bit slow.\r\n* if there is cythonized c files present, do not cythonize the code, unless the new \"recythonize\" command is used: ```python setup.py recythonize```. ~~special user option are added to ```python setup.py install --force-cythonization``` (or to ```develop``` which will be used for testing env)~~\r\n* for development purpose if source contains '.git' - generate a post-checkout hook which removes only cythonized *'.c/.cpp'* and compiled *'.so' or '.pyd'* files. \r\n \r\n\r\n\r\nTODO:\r\n\r\n* [x] add trial to cythonize extensions if c/c++ files are missing\r\n* [x] add new command \"recythonize\" to be used with setup.py to recythonize all extensions \r\n* [x] update CI and anaconda configs\r\n* [x] add git hook to automaticaly recythonize and rebuild --inplace after git checkout\r\n* [x] add travis ci testing for osx\r\n* [x] add bdist_wheels deployment to release from travis ci (for osx) and sdist (for linux and other)\r\n* [x] test travis release works\r\n* [x] add bdist_wheels deployment to release from appveyor\r\n* [ ] test bdist_wheels deployment to release works from appveyor\r\n* [x] test `python setup.py install` works without compiler present (ubuntu live usb: passed; appveyor: pending)"},"comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments/231729956","html_url":"https://github.com/hyperspy/hyperspy/pull/949#issuecomment-231729956","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/949","id":231729956,"user":{"login":"sem-geologist","id":12324068,"avatar_url":"https://avatars.githubusercontent.com/u/12324068?v=3","gravatar_id":"","url":"https://api.github.com/users/sem-geologist","html_url":"https://github.com/sem-geologist","followers_url":"https://api.github.com/users/sem-geologist/followers","following_url":"https://api.github.com/users/sem-geologist/following{/other_user}","gists_url":"https://api.github.com/users/sem-geologist/gists{/gist_id}","starred_url":"https://api.github.com/users/sem-geologist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sem-geologist/subscriptions","organizations_url":"https://api.github.com/users/sem-geologist/orgs","repos_url":"https://api.github.com/users/sem-geologist/repos","events_url":"https://api.github.com/users/sem-geologist/events{/privacy}","received_events_url":"https://api.github.com/users/sem-geologist/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T13:13:02Z","updated_at":"2016-07-11T13:13:02Z","body":"@francisco-dlp , I just tested installation of master on fresh windows system (7) with freshly installed winpython. It fails to install because of traits needs to be compiled. So ubuntu for now is the only system where limited hyperspy version is actual (as there is python-traits binary package there available). Unfortunately installation of hyperspy as library on winpython requires compiler, and I just want to make 200% sure that winpython does not include any compiler! Also I think the points I stated yesterday is valid, and this can be merged."}}
{"actor":{"display_login":"sem-geologist"}}