Skip to content
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

Replace compile-time validateFormatting parameter #38212

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

scbedd
Copy link
Member

@scbedd scbedd commented Oct 30, 2024

Resolves #35153

  1. Removes validateFormatting parameter
  2. black is opt-out by default, but individual packages can opt in with black = true in their pyproject.toml
  3. Update all ci.yml to remove validateFormatting and individually re-enabled black on those packages that were running it prior to this PR.

This change is necessary because of the fact that python - pullrequest doesn't have access to the parameter that you have set for your ci.yml. We need to emplace it some place else that's universal.

I'm taking a look now because @LibbaLawrence ran into exactly this issue with azure-eventhub running on python - pullrequest.

This PR moves these settings from the validateFormatting template parameter to a per-package pyproject.toml.
 
TODO:

  • Invert old validate_formatting.py into being called from tox instead of validate_formatting calling `tox.
  • update that tox black calling script with is_check_enabled.
  • Verify that it still invokes, and doesn't break any dev scenarios (confirm with @kdestin)

…validateFormatting enabled, and set that to false
@scbedd scbedd self-assigned this Oct 30, 2024
@github-actions github-actions bot added Azure.Core Evaluation Issues related to the client library for Azure AI Evaluation Tables labels Oct 30, 2024
Copy link
Member

@l0lawrence l0lawrence left a comment

Choose a reason for hiding this comment

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

Is this going to cause CI failures if an sdk currently has black=True but ValidateFormatting False?

@scbedd
Copy link
Member Author

scbedd commented Oct 30, 2024

Is this going to cause CI failures if an sdk currently has black=True but ValidateFormatting False?

Yep.

I'm finding the # of packages that fit in that gap (that aren't mgmt). We don't run black check against mgmt packages. If it's only a few, I'll set pyproject.toml black=False for those packages.

If not...we'll see 😆

@scbedd
Copy link
Member Author

scbedd commented Oct 31, 2024

We have one of two avenues:

  • We set black check to off by default.
    • I go in and adjust 5 services to update pyproject.toml updates with black=true in them.

OR

  • We set black to on by default
    • We omit mgmt packages from checks
    • We individually set black=false on anyone failing (or doesn't currently have validateFormatting: true on their ci.yml)

@l0lawrence
Copy link
Member

l0lawrence commented Oct 31, 2024

We have one of two avenues:

* We set `black` check to `off` by default.
  
  * I go in and adjust 5 services to update pyproject.toml updates with `black=true` in them.

OR

* We set `black` to `on` by default
  
  * We omit mgmt packages from checks
  * We individually set `black=false` on anyone failing (or doesn't currently have `validateFormatting: true` on their `ci.yml`)

I think right now black is an opt-in so I would vote for 1 to remain consistent

@scbedd
Copy link
Member Author

scbedd commented Nov 19, 2024

I think right now black is an opt-in so I would vote for 1 to remain consistent

Agreed, I'll make that change in this PR after making the other adjustments for opt in.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@scbedd
Copy link
Member Author

scbedd commented Nov 19, 2024

/check-enforcer override

Single failure to download an environment seed.

@scbedd scbedd merged commit 69f0c22 into Azure:main Nov 19, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Evaluation Issues related to the client library for Azure AI Evaluation Tables
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

refactor black check to be configured in pyproject.toml instead of ci.yml
6 participants