Skip to content

Conversation

roypat
Copy link
Contributor

@roypat roypat commented Sep 16, 2024

When black is passed multiple directories, it will try to look for pyproject.toml in the common ancestor of those paths. In our cases, since we pass it tests, .buildkite and tools, that would be the repository root. However, our pyproject.toml sits in tests, and thus the exclude rule it defines is ignored (and it is this exclude rules that overwrites the default behavior of excluding directories called build).

Fix this by explicitly passing in a --config argument. Since isort does not support this argument, pass it in a quite ugly via by adding it to the pytest parameters.

Fixes: 4f55e49

Changes

...

Reason

...

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

When `black` is passed multiple directories, it will try to look for
`pyproject.toml` in the common ancestor of those paths. In our cases,
since we pass it `tests`, `.buildkite` and `tools`, that would be the
repository root. However, our pyproject.toml sits in `tests`, and thus
the `exclude` rule it defines is ignored (and it is this `exclude` rules
that overwrites the default behavior of excluding directories called
`build`).

Fix this by explicitly passing in a `--config` argument. Since `isort`
does not support this argument, pass it in a quite ugly via by adding it
to the pytest parameters.

Fixes: 4f55e49
Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat requested a review from pb8o September 16, 2024 16:12
@roypat roypat added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.35%. Comparing base (eb26211) to head (6ed6695).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4806   +/-   ##
=======================================
  Coverage   84.34%   84.35%           
=======================================
  Files         249      249           
  Lines       27504    27504           
=======================================
+ Hits        23199    23200    +1     
+ Misses       4305     4304    -1     
Flag Coverage Δ
5.10-c5n.metal 84.57% <ø> (-0.01%) ⬇️
5.10-m5n.metal 84.55% <ø> (ø)
5.10-m6a.metal 83.84% <ø> (ø)
5.10-m6g.metal 80.93% <ø> (ø)
5.10-m6i.metal 84.55% <ø> (ø)
5.10-m7g.metal 80.93% <ø> (ø)
6.1-c5n.metal 84.57% <ø> (?)
6.1-m5n.metal 84.55% <ø> (?)
6.1-m6a.metal 83.84% <ø> (?)
6.1-m6g.metal 80.93% <ø> (?)
6.1-m6i.metal 84.55% <ø> (?)
6.1-m7g.metal 80.93% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roypat roypat merged commit 15868c3 into firecracker-microvm:main Sep 17, 2024
7 of 8 checks passed
@roypat roypat deleted the fix-black-build-dir-again branch September 17, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants