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

Fix basic pyright issues #1

Closed
wants to merge 26 commits into from

Conversation

Avasam
Copy link
Owner

@Avasam Avasam commented Jan 24, 2024

Summary of changes

Step 2 of pypa#2345 (comment)

Pull Request Checklist

@Avasam Avasam force-pushed the fix-basic-pyright-issues branch from 201e8f3 to faaa82b Compare January 25, 2024 00:32
@Avasam Avasam changed the title Initial config Initial pyright config Jan 25, 2024
@Avasam Avasam changed the title Initial pyright config Fix basic pyright issues Jan 25, 2024
@Avasam Avasam force-pushed the fix-basic-pyright-issues branch from 3a2d56a to 54e6096 Compare January 25, 2024 02:31
Comment on lines +79 to +80
if self.target_dir is None:
raise ValueError("self.target_dir cannot be None")
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
if self.target_dir is None:
raise ValueError("self.target_dir cannot be None")

@@ -297,10 +297,13 @@ def _obtain(self, dist: "Distribution", field: str, package_dir: Mapping[str, st
def _obtain_version(self, dist: "Distribution", package_dir: Mapping[str, str]):
# Since plugins can set version, let's silently skip if it cannot be obtained
if "version" in self.dynamic and "version" in self.dynamic_cfg:
return _expand.version(self._obtain(dist, "version", package_dir))
return _expand.version(
# We already an early dynamic check for the presense of "version"
Copy link
Owner Author

@Avasam Avasam Jan 25, 2024

Choose a reason for hiding this comment

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

Suggested change
# We already an early dynamic check for the presense of "version"
# We already do an early check for the presence of "version"

return None

def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, str]]:
def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, Optional[str]]]:
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, Optional[str]]]:
def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, str]]:

@Avasam Avasam changed the base branch from fix-all-mypy-issues to pyright-initial-config January 25, 2024 03:42
@Avasam Avasam force-pushed the pyright-initial-config branch from bbb379f to d9f74a7 Compare February 27, 2024 17:41
@Avasam Avasam force-pushed the pyright-initial-config branch 2 times, most recently from 872fc45 to 257efa3 Compare March 6, 2024 21:07
@Avasam Avasam closed this Mar 6, 2024
@Avasam Avasam deleted the fix-basic-pyright-issues branch March 6, 2024 21:26
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.

1 participant