-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Backport gh-4563 : generate dependency files #4576
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
Conversation
$ cythonize -M foo.pyx produces a file `foo.c.dep` with dependencies of foo.pyx, in addition to `foo.c`. Try to write relative paths as much as possible. Backport of cythongh-4563
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the tweaks w.r.t. master, which were needed for tests to pass locally.
paths = [] | ||
for fname in dependencies: | ||
if (fname.startswith(src_base_dir) or | ||
fname.startswith('.' + os.path.sep)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second clause is one change w.r.t. master
contents = [re.sub('[.]cython-[0-9]+', '', entry) for entry in contents] | ||
|
||
expected = ['cy_prefix/Includes/cpython/buffer.pxd', | ||
'cy_prefix/Includes/cpython/mem.pxd', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.29.x has two extra dependencies
|
||
contents = [os.path.relpath(entry, '.') | ||
if os.path.isabs(entry) else entry for entry in contents.split()] | ||
assert sorted(contents) == sorted(['test.c:', 'incl.pxi', 'test.pyx', '../test.pxd']), contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here the path to ../test.pxd
is relative
tests/build/depfile_numpy.srctree
Outdated
# filter out the version number from `np_prefix/__init__.cython-30.pxd`. | ||
contents = [re.sub('[.]cython-[0-9]+', '', entry) for entry in contents] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cython-30.pxd
was a Cython 3 invention. 0.29.x just ignores these files and finds the plain .pxd.
(I'm not sure if this is important here for the sake of the tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to remove it?
So far I exercised a TDD to the letter --- stopped the editor as soon as tests passed :-), to minimize the difference between patches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably? I don't think these files should appear in the 0.29.x list of dependencies, so filtering them out is hiding a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will do, after the CI gives the full list of things it does not like. One other question is the codestyle CI failure --- this does not seem related, is it known?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
cython-30.pxd
was a Cython 3 invention. 0.29.x just ignores these files and finds the plain .pxd.
In fact, that 0.29.x ignores it is the whole point that this file suffix exists at all. :)
Not sure about the CI timeouts. |
Tried restarting the CI, but no, several jobs time out after 40 mins, and I fail to see anything obvious in the CI logs. Are timeouts expected for the 0.29.x branch? |
It looks like it gets caught in some distutils/setuptools/mutliprocessing loop I think and doesn't even get past the "compile Cython" stage. This is the last run of the 0.29.x branch and it seems to have the same problem though, so I don't think it's related to this PR |
Thanks |
Backport of gh-4563 for 0.29.x