Skip to content

portage.porttree: pass basic mypy checks#1437

Open
Tatsh wants to merge 14 commits intogentoo:masterfrom
Tatsh:typing-porttree
Open

portage.porttree: pass basic mypy checks#1437
Tatsh wants to merge 14 commits intogentoo:masterfrom
Tatsh:typing-porttree

Conversation

@Tatsh
Copy link
Copy Markdown
Contributor

@Tatsh Tatsh commented May 13, 2025

Checked with mypy lib/portage/dbapi/porttree.py | grep -F porttree.py:. Zero issues.

Also included are some other changes to match portage-stubs.

The rest of the changes are done by Black.

@Tatsh Tatsh force-pushed the typing-porttree branch 2 times, most recently from d36941a to 69241f7 Compare May 13, 2025 02:21
@Tatsh Tatsh force-pushed the typing-porttree branch from 69241f7 to b84232a Compare May 13, 2025 02:22
@Tatsh Tatsh changed the title portage.porttree: make it pass basic mypy checks portage.porttree: pass basic mypy checks May 13, 2025
Copy link
Copy Markdown
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

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

So overall this PR concerns me.

Comment thread lib/portage/__init__.py Outdated
Comment thread lib/portage/dbapi/porttree.py Outdated
Comment on lines +61 to +69
if TYPE_CHECKING:
from portage.dbapi import _AuxKeys
from portage.dep import _match_slot, Atom, match_from_list, use_reduce
from portage.package.ebuild.config import config as config_type
from portage.package.ebuild.fetch import _download_suffix
from portage.util import ensure_dirs, writemsg
from portage.util.listdir import listdir
from portage.versions import _pkg_str, catpkgsplit, catsplit, pkgsplit, ver_regexp
import portage.data
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, sorry, this is terrible for maintenance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Then I do not see a way we can have full typing within Portage at this time. We basically have to only do simple typing and get the benefits of that but nothing more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is precedence for it:

if TYPE_CHECKING:

if TYPE_CHECKING:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is now reduced to only names used in type-hinting and not to fill in missing globals that are lazy-loaded.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is precedence for it:

No need to cite cases where, unlike what I called out, it is solely annotations. It does not make your point.

Comment thread lib/portage/dbapi/__init__.py Outdated
Comment thread lib/portage/dbapi/porttree.py
Comment thread lib/portage/dbapi/porttree.py
Comment thread lib/portage/dbapi/vartree.py Outdated
Comment thread lib/portage/package/ebuild/config.py
Comment thread lib/portage/package/ebuild/config.py Outdated
@Tatsh Tatsh force-pushed the typing-porttree branch from 03bdef4 to 5f926c0 Compare May 13, 2025 05:50
Comment thread lib/portage/dbapi/porttree.py Outdated
@Tatsh Tatsh force-pushed the typing-porttree branch 2 times, most recently from f8f0727 to 0dbb950 Compare May 13, 2025 15:07
@Tatsh Tatsh force-pushed the typing-porttree branch from 0dbb950 to 27c01b0 Compare May 13, 2025 15:09
@Tatsh Tatsh force-pushed the typing-porttree branch from fc1d0bc to 2678843 Compare May 13, 2025 15:21
Copy link
Copy Markdown
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

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

I have already reviewed this PR. My previous review still stands. A number of my critiques from the previous review have not been answered except by @Tatsh responding "well, this PR is going to do it anyway" and marking the review comment as "status: Resolved", which makes me think it's not worth commenting any further.

If I review your PR and I raise concerns about the approach you've taken, and you disagree with my concerns, then let the record show that I believe this PR should not now or ever be merged in its current shape -- it is not "resolved", we are in dispute over the design points.

This is a GitHub misfeature, that people with a triage bit on a project can be overridden by the PR author.

A discussion should not be closed unless both parties to the discussion agree that it is closed, or someone clicking the merge button says that it is closed. Closing a discussion at "the wrong time" simply leads people to think that objections are settled when they haven't been, so, not everyone is on the same page as each other about whether the PR is agreeable, and people forget what's been said and is still outstanding.

The only way to do so within the current permission system provided by GitHub is for PR authors to only mark a discussion as closed when one of the following applies:

  • they believe they have implemented the review request in the desired manner, "status: applied"
  • the reviewer says something like "okay fair enough" or "good point" indicating "status: withdrawn"
  • the PR author is a project maintainer and is using personal authority to say "status: overruled"

The current state of affairs is that several discussions have been closed as "status: overruled" by the PR author, which, again, is confusing.

@eli-schwartz
Copy link
Copy Markdown
Member

wishes for gerrit

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