Skip to content

Conversation

ev-br
Copy link
Contributor

@ev-br ev-br commented Jan 16, 2022

Backport of gh-4563 for 0.29.x

ev-br added 2 commits January 16, 2022 14:54
$ 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
Copy link
Contributor Author

@ev-br ev-br left a 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)):
Copy link
Contributor Author

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',
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@ev-br ev-br changed the title Backport depfile manual Backport gh-4563 : generate dependency files Jan 16, 2022
Comment on lines 32 to 33
# filter out the version number from `np_prefix/__init__.cython-30.pxd`.
contents = [re.sub('[.]cython-[0-9]+', '', entry) for entry in contents]
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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. :)

@ev-br ev-br closed this Jan 16, 2022
@ev-br ev-br reopened this Jan 16, 2022
@ev-br
Copy link
Contributor Author

ev-br commented Jan 17, 2022

Not sure about the CI timeouts.

@ev-br ev-br closed this Jan 24, 2022
@ev-br ev-br reopened this Jan 24, 2022
@ev-br
Copy link
Contributor Author

ev-br commented Jan 25, 2022

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?

@da-woods
Copy link
Contributor

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

@scoder scoder added this to the 0.29.27 milestone Jan 28, 2022
@scoder scoder merged commit cdad82d into cython:0.29.x Jan 28, 2022
@scoder
Copy link
Contributor

scoder commented Jan 28, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants