-
Notifications
You must be signed in to change notification settings - Fork 668
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
Do we need to track cython .c files? #667
Comments
Given that it is super easy to install cython, I dont think cythonized files are needed. (And given that mdanalysis requires other packages too) |
For the record, the issue was discussed in issue #66 and cython files got included to remove the dependency to cython. In my opinion, you should now what you are doing if you install MDAnalysis from the develop branch. I would remove the C files from the develop branch but keep them in the pip package, and perhaps in the master branch. |
I knew I should have dug deeper in the old issues... Anyway, my question then is, if they're distributed so that cython isn't needed what triggers their regeneration by cython? Shouldn't setup.py just rely on them being there? Or is it then a facultative dependency thing, where if we have cython we can use it to get some improvement otherwise we fallback to the distributed .c files? (I saw that some of the changes to the .c files seem to be architecture-dependent optimizations.) |
You can definitely force the rebuilding just by |
Yup, I agree on the dependency part, but wouldn't it be better then to leave them untracked, and then rebuild them for each release? (Like the docs regeneration?) |
I agree with @hainm ; these days Cython isn't a scary dependency, and since most users are likely installing with Anaconda anyway, they already have it. I say we cut the amount of generated stuff we're committing to the repo's main branches and leave out the cython-generated code. |
I'm not sure @orbeckst will agree... I still vote for not tracking but rebuilding and releasing, like the docs. |
@mnmelo I like that solution. I think rebuilding is something the package maintainer / release manager has to do anyway. |
@richardjgowers, would you be ok with adding the cython rebuild to the release workflow? |
On 28 Jan, 2016, at 11:26, David Dotson wrote:
I also find the small changes in the cythonized files annoying. In principle, anyone using develop can be expected to install cython; as @hainm points out, it's not a big deal anymore. I would be ok with building the cython files as part of release. They should also end up on master, don't you think? It will change our "minimal builds" in that they are not THAT minimal anymore. Oliver |
@orbeckst, yup: master and releases makes sense. This will also make cythonized files more consistent. I just opened a PR (#678) where I change code in one of the |
yes having them in the release tarball is very useful. I wouldn't want to give that up. It makes sure that we have some control over the cython generated files |
@orbeckst if mdanalysis can be released from conda build, you don't even care about cython. 👍 |
@hainm Not everybody uses Anaconda, and we should be careful not making it more required than needed. I am very happy with pip and virtualenv. |
Hi, I dont say users need to install anaconda. Just an option. If you are using pip, you don't need to bundle cythonized files too. :d Hai
|
If we use pip we have to bundle them. Otherwise the pip install will fail. It shouldn't if we provide wheels but I don't know if we have them yet. |
So how will this work logistically? We add And then will there be a list of |
I was looking through it, and apparently that's the most obvious way to go. |
The git ignore thing could work, also we can add a file even if it match On 29-01-16 14:11, mnmelo wrote:
|
If you do a merge develop into master yes. Then that would be it. A rebase workflow would be hard and involve force pushing.
I don't think it works when we keep the files in VC though. They are tracked in another branch but I'm not sure. Someone would need to test that. |
From some googling, maintaining this sort of .gitignore is error-prone and, frankly, inelegant. Also, from Cython's docs:
So I guess we should really ship with Cython disabled, to prevent hard-to-find bugs on the user side. |
Hmm ok. Would it be possible to put some magic in setup.py along the lines of: if version.endswith('-dev0'):
use_cython = True
else:
use_cython = False To simplify everything for the poor suffering release manager |
I was looking into how to make all this 'just work' for both devs and release manager. I wouldn't want to have to change anything on the installing user's side (like having to pass flags to I think @richardjgowers idea is good, if we stick to the nomenclature. I'll give it a try. (BTW, is that always going to be a |
may be is_release = True
if is_release:
# use *.c files
else:
# use *pyx files |
Yup, something along those lines. The thing is that |
yeah |
I don't think this has actually answered the original issue which was the .c files were annoying. I'm not sure why these get regenerated sometimes (when they've not been touched). But if we're distributing them with the release (as per cython docs above) it sounds like they need to be in version control. |
I disagree. They're compiled stuff, just like the |
Default behavior now depends on release or dev status. When in dev mode default is to use Cython and delete cythonized files. When in release mode default is to skip Cython but keep existing cythonized files. setup.py now reads the version string directly from version.py. Environment variable handling in setup.py enhanced to recognize strings with boolean meaning.
I just opened a PR (#692) with my solution and the ideas of @richardjgowers and @hainm. Do give opinions. Developers don't need to do anything special. Since now the dev branch has no cythonized .c files you'll get an error (about a missing .c source file) if you a) don't have Cython; b) have Cython version < 0.16; c) specifically disable Cython usage through On dev builds cythonized files are automatically removed after setup.py finishes building. Again, use On release builds the defaults are reversed. Cython won't be used. If it's use is forced, cythonized files won't be deleted (a user can force the use of their own Cython, even when installing via |
Default behavior now depends on release or dev status. When in dev mode default is to use Cython and delete cythonized files. When in release mode default is to skip Cython but keep existing cythonized files. setup.py now reads the version string directly from version.py. Environment variable handling in setup.py enhanced to recognize strings with boolean meaning.
Default behavior now depends on release or dev status. When in dev mode default is to use Cython and delete cythonized files. When in release mode default is to skip Cython but keep existing cythonized files. setup.py now reads the version string directly from version.py. Environment variable handling in setup.py enhanced to recognize strings with boolean meaning.
Default behavior now depends on release or dev status. When in dev mode default is to use Cython and delete cythonized files. When in release mode default is to skip Cython but keep existing cythonized files. setup.py now reads the version string directly from version.py. Environment variable handling in setup.py enhanced to recognize strings with boolean meaning (fixes #629). Travis' minimal build now also rebuilds cythonized files.
Ok. This is merged. Thanks @richardjgowers. Please keep giving feedback on the release process, in case we should tweak or entirely revert this change. Don't forget you'll have to run I'm schematizing below what I imagine would be a good way to keep release-specific stuff separated from the develop branch, in case we ever worry about devs branching off that one commit with non-dev version string. The downside of this approach is that the merging of develop into master won't be fast-forwardable because the version string changes will conflict (which is, of course, small, but I don't know how much extra release burden this would be).
|
As posted by @kain88-de in the dev mailing list, the fact that we remove cython files after each build makes rebuilding annoying, because everything is recompiled even if no relevant code has changed. Looking back on the ideas in this thread, an alternative possibility would be to untrack cython-generated Perhaps we could have some rules about cythonized file naming that would make a regex easier to apply in Suggestions? |
@mnmelo can't we just add an option like |
That already exists, as part of what was implemented from this very issue, doesn't it? |
Yup, just tested it:
But then you'll bump into the problem of having to untrack the |
One thing I just noticed is that all our real (not cythonized) Would a |
@mnmelo I'm cool with keeping the track of the 6 c files myself. magit has a wonderful interface for that. I don't think it's worth spending to much time one this. Just having one option to avoid removing the files is enough. |
Ok, reclosing as it seems to be ok as it is. |
Whenever I build MDAnalysis cython regenerates some *.c files in
/lib/
and/lib/formats/
. This messes up my commits as a number of files I didn't specifically change appear as modified.The question is: do we even need these files around? Can we just leave them out (and untracked) and let cython recreate them every time a build is issued?
The text was updated successfully, but these errors were encountered: