Skip to content

Improve type hints for Package.name etc.#442

Merged
radoering merged 1 commit into
python-poetry:mainfrom
radoering:type-hints-normalized-name
Aug 14, 2022
Merged

Improve type hints for Package.name etc.#442
radoering merged 1 commit into
python-poetry:mainfrom
radoering:type-hints-normalized-name

Conversation

@radoering
Copy link
Copy Markdown
Member

When comparing names it's important to know if a name of a package/dependency is normalized or not. So let's tighten up type hints.

@dimbleby
Copy link
Copy Markdown
Contributor

Also here

name: str | None = None
?

Also I think this MR show that the calls to canonicalize_name here are redundant

if path.is_file():
dependency = FileDependency(
name=canonicalize_name(path.name), path=path
)
elif path.is_dir():
dependency = DirectoryDependency(
name=canonicalize_name(path.name), path=path
)

@radoering radoering force-pushed the type-hints-normalized-name branch from 28b9c54 to 2cbf234 Compare August 14, 2022 10:55
@sonarqubecloud
Copy link
Copy Markdown

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

@radoering radoering merged commit a5d8cad into python-poetry:main Aug 14, 2022
bostonrwalker pushed a commit to bostonrwalker/poetry-core that referenced this pull request Aug 29, 2022
@radoering radoering deleted the type-hints-normalized-name branch November 24, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants