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

Address TODO in pyproject/tables #600

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Secrus
Copy link
Member

@Secrus Secrus commented Jun 3, 2023

There was a TODO comment left, this addresses it.

@Secrus Secrus requested a review from a team June 3, 2023 17:16
@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2023

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

)
self.requires = requires if requires is not None else ["setuptools", "wheel"]
self._dependencies: list[Dependency] | None = None
build_backend: str | None = field(default=None)
Copy link
Member

Choose a reason for hiding this comment

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

As it is now, I think it's a step backwards compared to the old implementation. build_backend should be of type str even if None can be passed to __init__. IMO, we should find a better solution with dataclasses or keep the old implementation and just remove the TODO.


def __post_init__(self) -> None:
self.build_backend = self.build_backend or "setuptools.build_meta:__legacy__"
self.requires = self.requires or ["setuptools", "wheel"]
Copy link
Member

Choose a reason for hiding this comment

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

According to the old implementation self.requires should only be set to this default if it's None (not if it's an empty list). However, I assume this distinction is not necessary because each build-backend requires at least itself so there is no case where an empty list makes sense.

By the way, we should probably require setuptools >= 40.8.0. I suppose in older versions there is no "setuptools.build_meta:__legacy__", cf build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants