Skip to content

FIX Fixes test for checking gitignore and Cython templates #20997

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

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

gaborkertesz
Copy link
Contributor

@gaborkertesz gaborkertesz commented Sep 9, 2021

Converting to string removed the windows compatible path.

Reference Issues/PRs

Fixes #20996 20996

What does this implement/fix? Explain your changes.

Removing string conversion and comparing objects by assert.

Any other comments?

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ogrisel
Copy link
Member

ogrisel commented Sep 9, 2021

It's weird that our CI did not fail though...

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @gaborkertesz !

This looks good. Small comment on implementation.

Comment on lines 13 to 16
ignored_files = open(gitignore_file, "r").readlines()
ignored_files = list(map(lambda line: line.strip("\n"), ignored_files))
ignored_files = list(
map(lambda line: pathlib.Path(line.strip("\n")), ignored_files)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are now comparing paths, may we include the following update to fully use the pathlib api?

    ignored_files = gitignore_file.read_text().split("\n")
    ignored_files = [pathlib.Path(line) for line in ignored_files]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great finding, thanks, applied!

@thomasjpfan thomasjpfan changed the title FIX TST Fix for #20996 FIX Fixes test for checking gitnore and Cython templates Sep 12, 2021
Converting to string removed the windows compatible path.
@gaborkertesz
Copy link
Contributor Author

In the title the "gitnore" is a typo of "gitignore" or it's an abbreviation @thomasjpfan?

@thomasjpfan thomasjpfan changed the title FIX Fixes test for checking gitnore and Cython templates FIX Fixes test for checking gitignore and Cython templates Sep 24, 2021
@thomasjpfan
Copy link
Member

In the title the "gitnore" is a typo of "gitignore" or it's an abbreviation

Good catch! (It was a typo)

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan thomasjpfan merged commit f33fb0a into scikit-learn:main Sep 24, 2021
@glemaitre glemaitre mentioned this pull request Oct 23, 2021
10 tasks
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Oct 23, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On Windows utils\tests\test_cython_templating.py unit-test is failing
3 participants