Browse Source

Squash remaining pyright warnings

tags/v0.4.1
Ben Kurtovic 5 months ago
parent
commit
f529ba8254
4 changed files with 41 additions and 5 deletions
  1. +2
    -2
      .pre-commit-config.yaml
  2. +2
    -1
      pyproject.toml
  3. +2
    -2
      src/earwigbot/wiki/copyvios/parsers.py
  4. +35
    -0
      uv.lock

+ 2
- 2
.pre-commit-config.yaml View File

@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
rev: v0.15.12
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.383
rev: v1.1.409
hooks:
- id: pyright

+ 2
- 1
pyproject.toml View File

@@ -42,7 +42,8 @@ copyvios = [
"tldextract >= 3.1.0", # Getting domains for the multithreaded workers
]
dev = [
"pytest >= 8.3.1"
"gitpython>=3.1.49",
"pytest >= 8.3.1",
]

[project.urls]


+ 2
- 2
src/earwigbot/wiki/copyvios/parsers.py View File

@@ -301,10 +301,10 @@ class HTMLParser(SourceParser):
"""Clean a BeautifulSoup tree of invisible tags."""
import bs4

def is_comment(text: bs4.element.Tag) -> bool:
def is_comment(text: str | None) -> bool:
return isinstance(text, bs4.element.Comment)

for comment in soup.find_all(text=is_comment):
for comment in soup.find_all(string=is_comment):
comment.extract()
for tag in self.hidden_tags:
for element in soup.find_all(tag):


+ 35
- 0
uv.lock View File

@@ -287,6 +287,7 @@ crypto = [
{ name = "cryptography" },
]
dev = [
{ name = "gitpython" },
{ name = "pytest" },
]
sql = [
@@ -298,6 +299,7 @@ requires-dist = [
{ name = "beautifulsoup4", marker = "extra == 'copyvios'", specifier = ">=4.9.3" },
{ name = "charset-normalizer", marker = "extra == 'copyvios'", specifier = ">=3.3.2" },
{ name = "cryptography", marker = "extra == 'crypto'", specifier = ">=3.4.7" },
{ name = "gitpython", marker = "extra == 'dev'", specifier = ">=3.1.49" },
{ name = "lxml", marker = "extra == 'copyvios'", specifier = ">=4.6.3" },
{ name = "mwparserfromhell", specifier = ">=0.6" },
{ name = "nltk", marker = "extra == 'copyvios'", specifier = ">=3.9.1" },
@@ -321,6 +323,30 @@ wheels = [
]

[[package]]
name = "gitdb"
version = "4.0.12"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "smmap" },
]
sdist = { url = "https://files.pythonhosted.org/packages/72/94/63b0fc47eb32792c7ba1fe1b694daec9a63620db1e313033d18140c2320a/gitdb-4.0.12.tar.gz", hash = "sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571", size = 394684, upload-time = "2025-01-02T07:20:46.413Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", hash = "sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf", size = 62794, upload-time = "2025-01-02T07:20:43.624Z" },
]

[[package]]
name = "gitpython"
version = "3.1.49"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "gitdb" },
]
sdist = { url = "https://files.pythonhosted.org/packages/e1/63/210aaa302d6a0a78daa67c5c15bbac2cad361722841278b0209b6da20855/gitpython-3.1.49.tar.gz", hash = "sha256:42f9399c9eb33fc581014bedd76049dfbaf6375aa2a5754575966387280315e1", size = 219367, upload-time = "2026-04-29T00:31:20.478Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/fd/6f/b842bfa6f21d6f87c57f9abf7194225e55279d96d869775e19e9f7236fc5/gitpython-3.1.49-py3-none-any.whl", hash = "sha256:024b0422d7f84d15cd794844e029ffebd4c5d42a7eb9b936b458697ef550a02c", size = 212190, upload-time = "2026-04-29T00:31:18.412Z" },
]

[[package]]
name = "idna"
version = "3.13"
source = { registry = "https://pypi.org/simple" }
@@ -805,6 +831,15 @@ wheels = [
]

[[package]]
name = "smmap"
version = "5.0.3"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/1f/ea/49c993d6dfdd7338c9b1000a0f36817ed7ec84577ae2e52f890d1a4ff909/smmap-5.0.3.tar.gz", hash = "sha256:4d9debb8b99007ae47165abc08670bd74cb74b5227dda7f643eccc4e9eb5642c", size = 22506, upload-time = "2026-03-09T03:43:26.1Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c1/d4/59e74daffcb57a07668852eeeb6035af9f32cbfd7a1d2511f17d2fe6a738/smmap-5.0.3-py3-none-any.whl", hash = "sha256:c106e05d5a61449cf6ba9a1e650227ecfb141590d2a98412103ff35d89fc7b2f", size = 24390, upload-time = "2026-03-09T03:43:24.361Z" },
]

[[package]]
name = "soupsieve"
version = "2.8.3"
source = { registry = "https://pypi.org/simple" }


Loading…
Cancel
Save