-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BLD: tslib dependencies not fully specified #18089
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
Comments
@jbrockmendel need to fix this before any other changes. |
Do you have an example for how this fails? My understanding is that cython checks the timestamps on other cython files for determining if dependencies have changed. |
try making a change on a .pxd (e.g moving something), them try to make, it will fail because it can't load the object. |
nothing to do with time stamps, rather the build process doesn't know about deps. that it is depending, IOW tslib depends on tslibs/converstion.pxd, but this is not indicated anywhere (to rebuild tslib). |
I noticed this yesterday when I tried to build |
OK I'll try to grok this. Cython clearly knows something about up-to-dateness:
|
@jbrockmendel : That's actually us 😄 . We compare timestamps on all files and dependencies to determine whether they need updating. |
OK, I just took an existing branch, went to conversion.pxd and made a whitespace edit, then ran setup.py build_ext:
So far so good. So I guess you're referring to something less benign than a whitespace change? If I comment out The cython folks are at least aware of this; lack of discussion suggests it isn't a high priority. There is a cython option that would allow us to do without pxd files entirely in some cases, but I'm a bit wary of it: cython/cython#1866 Pretty sure I've seen this on the cython mailing list, will try to track that down. |
Hah. Good to know. |
Yes, that's exactly what happened to me yesterday. I wouldn't worry too much about anything Cython-issue-related, as that's beyond our control from a |
OK, so IIUC you're making a change that doesn't actually break
That error is re-raised in
In this particular failure mode, this error message is pretty helpful. In fact, it is more helpful than the error message we would get if we added conversion.pxd to tslib's
So I can put together a PR that will exhaustively list in setup.py all of the pxdfiles relevant to every cython module. Then we can vigilantly keep that up to date. OR I can fix the error message in |
Incidentally, the str-replacement in the error message in
which I think is intended to be
|
Related: |
Given where things are right now, it should be our responsibility to keep track of dependencies. The latter can be used to provide a better error message. However, to close the issue, the former should be done. |
One last-ditch argument for the "fix the import error message" solution. Listing these all in setup.py is asking for trouble. There is plenty of evidence that the deps listed in the Quick: which entries get '_libs/src/foo' and which get 'pandas/_libs/src/foo'? Does the entry for My point being: the For modules in |
@jbrockmendel put it this way. if I have to make clean every once in a while, when I didn't have to before, no big deal. But this highlites a problem. I would like to fix this before doing anything else. I don't care about the error message, in fact that is a red herring. The build process is messed up. |
I can offer moral support, but it seems like I don't understand the problem. "When I change something that should cause the code to break, the code breaks" doesn't sound like a problem. If the problem is about the error being at import-time instead of compile-time, that I could understand. If the problem is about the error reported at import-time being unhelpful, that I could understand.
Per my previous comment, I more or less agree. I just don't see how throwing more stuff at the wall makes it better. So for the time being I'll stick to moral support. |
@jbrockmendel : The whole idea is that you need to add more dependencies to specific Cython files. You can figure out which ones are dependencies given that you know where the imports fail. |
Until something gets broken, imports don't fail. Are you suggesting a fuzzing operation to trace these out? I'm honestly not trying to be obstinate here, just feel like I'm missing some major part of the picture. |
No, no, don't do that 😄 You did a lot of refactoring of the Cython modules in previous PR's, right? So you're going to have to retrace your steps and see where imports are coming from with your new refactorings. There are a couple of ways to achieve this AFAICT:
|
Sounds like having a not-screwed-up exception at import would help with this.
OK, so a hypothetical contributor can go through all these files and find which modules import from which other modules... just like python does at import time. So what is this accomplishing? Supposing you convince/browbeat this contributor into doing this,
|
Does it matter that khash isn't listed in |
@jbrockmendel : I understand that this work is not necessarily appealing, but given that you were the one who initiated a lot of these refactorings, you would be most familiar with the new files that you created. AFAICT, the changes you need to make would be to add your newly created files as dependencies. Don't worry about other files for the moment, just figure out where your newly created files should be as dependencies for the time being. |
See recent PR that does this, ignores internal consistency, makes black boxes larger, as requested. Anticipating that part of your response, the PR ignores non-tslib(s). Good thing you didn’t address the other bullet points; wouldn’t want to accidentally give the impression getting this right matters. |
Oh, getting it completely right matters. We just don't need to rush it too quickly 😄 Don't worry about the black box for now. Dependencies are a bit clunky, but let's at least make sure that we can do builds without having do a clean one every time. |
I don't really know what should be listed; the point is the dependency tree is broken. listing lots of things is not the answer, but I suspect we do need to list .pxd files. |
For testing purposes I've implemented tslibs as effectively a standalone packages. The setup.py for this package is relatively simple, the relevant bits being
The reason I bring this up is because when I run setup.py build_ext --inplace I see a bunch of messages:
i.e. it looks very much like cython is doing some kind of caching and dependency recognition internally. |
I asked about this on the cython mailing list. Two key points from the answer:
https://groups.google.com/forum/#!topic/cython-users/YdGpGqi6Qw4 |
Indeed. The whole point of |
and we don’t actually use cythonize; this setup.py was built with early versions of cython would take a PR that uses cythonize to correctly infer our deps |
OK, we're very nearly ready to use cythonize. The remaining warnings/errors that I get when doing this locally are
|
Renaming |
I'll give it a shot over the weekend and see how it goes. There's a decent chance we might be able to get rid of all of my PRs in the next day or two. |
@jbrockmendel anything left to do for this issue? (didn't read the full thing :)) Is it a blocker for a 0.23 release? |
Nothing blocking here. It's basically on hold until the next bump in the cythonize version requirements (I forget the exact cutoff, just remember we're one below it) at which point some nice cleanup can be done. |
OK, removing the 0.23 milestone then |
is not complete, in fact this directly depends on
not really sure of the exact rule, but I think anything you cimport from a .pxd must be listed as a dep.
Now rebuilding from clean just works, but rebuilding from a change in one part of the structure will only sometimes work.
The text was updated successfully, but these errors were encountered: