Skip to content

Switch to Black 2025 and isort 6 #2779

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 2 commits into from
Feb 11, 2025
Merged

Switch to Black 2025 and isort 6 #2779

merged 2 commits into from
Feb 11, 2025

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Feb 7, 2025

isort 6 now respects the trailing comma in imports.

Before:

echo 'from elasticsearch.helpers.vectorstore import (
    EmbeddingService,
    RetrievalStrategy,
)' | uvx --with 'isort<6' isort --profile black -
from elasticsearch.helpers.vectorstore import EmbeddingService, RetrievalStrategy

After:

echo 'from elasticsearch.helpers.vectorstore import (
    EmbeddingService,
    RetrievalStrategy,
)' | uvx --with 'isort' isort --profile black -
from elasticsearch.helpers.vectorstore import (
    EmbeddingService,
    RetrievalStrategy,
)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

github-actions bot commented Feb 7, 2025

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@pquentin pquentin changed the title Switch to Black 2025 code style Switch to Black 2025 and isort 6 Feb 11, 2025
@pquentin pquentin merged commit 68f8012 into elastic:main Feb 11, 2025
18 checks passed
Copy link

The backport to 8.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.x 8.x
# Navigate to the new working tree
cd .worktrees/backport-8.x
# Create a new branch
git switch --create backport-2779-to-8.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 68f80128b61a8162b58e3082e35564e7aa7b341a
# Push it to GitHub
git push --set-upstream origin backport-2779-to-8.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.x

Then, create a pull request where the base branch is 8.x and the compare/head branch is backport-2779-to-8.x.

Copy link

The backport to 8.17 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.17 8.17
# Navigate to the new working tree
cd .worktrees/backport-8.17
# Create a new branch
git switch --create backport-2779-to-8.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 68f80128b61a8162b58e3082e35564e7aa7b341a
# Push it to GitHub
git push --set-upstream origin backport-2779-to-8.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.17

Then, create a pull request where the base branch is 8.17 and the compare/head branch is backport-2779-to-8.17.

Copy link

The backport to 8.18 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.18 8.18
# Navigate to the new working tree
cd .worktrees/backport-8.18
# Create a new branch
git switch --create backport-2779-to-8.18
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 68f80128b61a8162b58e3082e35564e7aa7b341a
# Push it to GitHub
git push --set-upstream origin backport-2779-to-8.18
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.18

Then, create a pull request where the base branch is 8.18 and the compare/head branch is backport-2779-to-8.18.

github-actions bot pushed a commit that referenced this pull request Feb 12, 2025
* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)
github-actions bot pushed a commit that referenced this pull request Feb 12, 2025
* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)
pquentin added a commit to pquentin/elasticsearch-py that referenced this pull request Feb 12, 2025
* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)
@pquentin
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.17

Questions ?

Please refer to the Backport tool documentation

pquentin added a commit that referenced this pull request Feb 12, 2025
* Switch to Black 2025 and isort 6 (#2779)

* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)

* Run nox -rs format

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
pquentin added a commit that referenced this pull request Feb 12, 2025
* Switch to Black 2025 and isort 6 (#2779)

* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)

* Run nox -s format

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
pquentin added a commit that referenced this pull request Feb 12, 2025
* Switch to Black 2025 code style

* Run format with isort 6

(cherry picked from commit 68f8012)
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.

None yet

2 participants