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

chore(deps): bump @babel/traverse and @trivago/prettier-plugin-sort-imports in /www #145

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions py_wtf/indexer/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def ensure(val: T | None) -> T:

class HasComment(Protocol):
@property
def comment(self) -> cst.Comment | None:
...
def comment(self) -> cst.Comment | None: ...


def extract_documentation(node: HasComment) -> Documentation | None:
Expand Down
8 changes: 5 additions & 3 deletions py_wtf/indexer/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ async def download(
os.unlink(archive_name)

return (
pick_project_dir(directory)
if artifact["packagetype"] == "sdist"
else directory,
(
pick_project_dir(directory)
if artifact["packagetype"] == "sdist"
else directory
),
proj_metadata,
doc,
)
6 changes: 2 additions & 4 deletions tests/indexer/test_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ def test_is_rst() -> None:
assert not is_rst("foo")
assert is_rst(".. foo:")
assert is_rst("like ``foo``.")
assert is_rst(
"""blahblah::
assert is_rst("""blahblah::

"""
)
""")
assert is_rst("hello\n.. foo:\nbar")


Expand Down
18 changes: 6 additions & 12 deletions tests/indexer/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def test_index_file_syntax_error(tmp_path: Path) -> None:
def module_file(request: pytest.FixtureRequest, tmp_path: Path) -> Path:
name = f"{request.param}.py"
some_file = tmp_path / name
code = dedent(
"""
code = dedent("""
# header
'''module docs'''
import sys
Expand Down Expand Up @@ -79,8 +78,7 @@ class Inner(Cls):
# this is a factory, not a fact
def fact() -> Cls:
return Cls()
"""
)
""")
some_file.write_text(code)
return some_file

Expand All @@ -89,15 +87,13 @@ def fact() -> Cls:
def package_file(tmp_path: Path) -> Path:
some_file = tmp_path / "mypackage" / "__init__.py"
some_file.parent.mkdir()
code = dedent(
"""
code = dedent("""
from dependencyproject import helper
def foo(): ...
bar = 2

__all__ = ["foo", "helper"]
"""
)
""")
some_file.write_text(code)
return some_file

Expand All @@ -106,14 +102,12 @@ def foo(): ...
def package_file_without_all(tmp_path: Path) -> Path:
some_file = tmp_path / "mypackage" / "__init__.py"
some_file.parent.mkdir()
code = dedent(
"""
code = dedent("""
from dependencyproject import helper
def foo(): ...
bar = 2

"""
)
""")
some_file.write_text(code)
return some_file

Expand Down
4 changes: 3 additions & 1 deletion tests/indexer/test_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def pypi_json(requirements: None | list[str]) -> bytes:
},
{
"packagetype": "sdist",
"url": "https://files.pythonhosted.org/packages/aaaaaaaa.tar.gz",
"url": (
"https://files.pythonhosted.org/packages/aaaaaaaa.tar.gz"
),
"md5_digest": "HAHA I'm an MD5 hash",
"yanked": True,
},
Expand Down
Loading
Loading