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

Drop the doctype check #10906

Merged
merged 4 commits into from
Feb 27, 2022
Merged

Drop the doctype check #10906

merged 4 commits into from
Feb 27, 2022

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Feb 13, 2022

Closes #10903

Copy link

@virtuald virtuald left a comment

Choose a reason for hiding this comment

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

It wasn't clear from @pradyunsg 's comment whether he meant get rid of the doctype validation for index pages (which, technically, are covered by a PEP) in addition to --find-links parsing. This does both, correct?

tests/unit/test_collector.py Show resolved Hide resolved
Copy link

@virtuald virtuald left a comment

Choose a reason for hiding this comment

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

LGTM, but, obviously I'm not a pip maintainer

Copy link
Member

@pfmoore pfmoore left a comment

Choose a reason for hiding this comment

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

We should probably also have an explicit test that --find-links pointing to a page without a doctype declaration works. Such a test would ensure that in future, even if we tighten up the validation for indexes, we don't accidentally require the same strictness for --find-links.

docs/html/conf.py Outdated Show resolved Hide resolved
docs/html/installation.md Outdated Show resolved Hide resolved
news/10903.removal.rst Outdated Show resolved Hide resolved
@@ -586,7 +586,7 @@ def test_parse_links_presents_warning_on_html4_doctype(
assert "pkg1-1.0" in parsed_links[0].url
assert "pkg1-2.0" in parsed_links[1].url

assert len(caplog.records) == 1
assert len(caplog.records) == 0
Copy link
Member

@pradyunsg pradyunsg Feb 25, 2022

Choose a reason for hiding this comment

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

I'd strongly prefer to drop these tests instead of promising that we won't warn on invalid/missing doctypes.

Copy link
Member

Choose a reason for hiding this comment

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

I'm happy to do that. But I'd still like to see a test that ensures that any validation we might put on indexes doesn't "leak" into how we handle --find-links (because --find-links is explicitly intended to support anything that dumps out an unstructured "bunch of links to files", such as a webserver auto-generated directory page). But I won't block somebody else merging this PR without that test, if people feel I'm being too pedantic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ill add a test for --find-links.

@q0w
Copy link
Contributor Author

q0w commented Feb 25, 2022

Tests are failed because of this: pypa/flit#498
and fixed in another pr(#10894): 9436321

@pradyunsg
Copy link
Member

pradyunsg commented Feb 25, 2022

@q0w Please don't include CI related changes with feature/bugfix PRs. I ended up filing a separate PR because I didn't know that you had already investigated and fixed this.

#10922

@pradyunsg
Copy link
Member

@q0w Do you know when you might be able to update this PR?

@q0w
Copy link
Contributor Author

q0w commented Feb 26, 2022

@pradyunsg today

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

I'll wait for @pfmoore to take a look, but LGTM!

@pradyunsg

This comment was marked as resolved.

@pradyunsg pradyunsg merged commit a4f7508 into pypa:main Feb 27, 2022
@pradyunsg
Copy link
Member

I can use the squash button! Thanks @q0w! ^.^

@q0w q0w deleted the doctype branch March 5, 2022 01:19
pradyunsg added a commit to pradyunsg/pip that referenced this pull request Mar 6, 2022
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--find-links should not warn about missing HTML5 doctype
6 participants