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

Use explicit config files for black and isort #1298

Conversation

danielmitterdorfer
Copy link
Member

@danielmitterdorfer danielmitterdorfer commented Jul 1, 2021

Using pyproject.toml for black and isort configuration has unwanted
side effects when Rally is installed in certain environments (and in
editable mode). While this should be addressed at a later point because
editable mode is about to removed anyway (see PEP-517 and PEP-518) we
will use explicitly specified config files for now.

Relates #1281
Relates pypa/pip#6433

Using `pyproject.toml` for black and isort configuration has unwanted
side effects when Rally is installed in certain environments (and in
editable mode). While this should be addressed at a later point because
editable mode is about to removed anyway (see PEP-517 and PEP-518) we
will use explicitly specified config files for now.

Relates elastic#1281
Relates pypa/pip#6433
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :misc Changes that don't affect users directly: linter fixes, test improvements, etc. labels Jul 1, 2021
@danielmitterdorfer danielmitterdorfer added this to the 2.3.0 milestone Jul 1, 2021
@danielmitterdorfer danielmitterdorfer self-assigned this Jul 1, 2021
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM thank you

@danielmitterdorfer danielmitterdorfer merged commit 9c4505f into elastic:master Jul 1, 2021
@danielmitterdorfer danielmitterdorfer deleted the explicit-black-isort-cfg branch July 1, 2021 08:11
@pquentin
Copy link
Member

pquentin commented Jul 1, 2021

Can you please clarify what the unwanted side effects are?

The problem with a black.toml file is that my editor won't see it, so I'd suggest renaming that file back to pyproject.toml (and still specifiy it explicitly if that helps).

@danielmitterdorfer
Copy link
Member Author

Can you please clarify what the unwanted side effects are?

We have some internal tooling, for example to run our nightly benchmarks, that builds on top of Rally. It installs Rally master in editable mode. Due to the presence of pyproject.toml, pip started to prefer that file to setup.py and caused build failures (example).

There is definitely room for improvement in how we setup Rally in these scenarios but the most pragmatic solution to unblock us for now was to explicitly configure black and isort via dedicated config files so the current mechanism still works.

@pquentin
Copy link
Member

pquentin commented Jul 2, 2021

Thanks. I believe those lines in pyproject.toml are enough to fix the issue:

[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"

But I can't reproduce so I'm not sure. Is there a simple way to see if that fixes the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :misc Changes that don't affect users directly: linter fixes, test improvements, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants