Skip to content

Conversation

@erikjohnston
Copy link

Poetry calls git ls-files against the package directory to get the full list of files to exclude during build. This is very slow if you have e.g. hundreds of thousands of files that are ignored (don't ask why I have that).

Calling git ls-files --directory instead is a lot faster, as it doesn't return all files in directories that are ignored.

Doing that, however, requires refactoring find_excluded_files to not simply return the set of all files that are to be ignored. Instead, we return a container object that correctly handles ignored directories.

This does change the API of Builder.find_excluded_files to return a Container[str] rather than set[str], but I'm not sure if that is part of any public API.

  • Added tests for changed code.
  • Updated documentation for changed code.

erikjohnston and others added 3 commits October 11, 2022 10:50
Poetry checks a lot of files against the list of excluded files. If
there are many files ignored by git this can severly slow down builds.

Currently, if a directory is ignored by git then all files within that
directory get added to set of excluded files to check.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Benjamin-T
Copy link

What is the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0 PRs for core 2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants