Skip to content
Merged
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: 3 additions & 0 deletions src/pyrefdev/indexer/crawl_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def crawl_docs(
package: str | None = None,
force: bool = False,
upgrade: bool = False,
only_unindexed: bool = False,
retry_failed_urls: bool = True,
retry_http_404: bool = False,
index: Index = Index(),
Expand All @@ -158,6 +159,8 @@ def crawl_docs(
if pkg.do_not_update:
console.print(f"Skipping {pkg.pypi}: {pkg.do_not_update_reason}")
packages = [pkg for pkg in packages if not pkg.do_not_update]
if only_unindexed:
packages = [pkg for pkg in packages if not pkg.indexed]
if not force and not upgrade and not retry_failed_urls:
packages = [
pkg
Expand Down
5 changes: 4 additions & 1 deletion src/pyrefdev/indexer/update_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ def update_docs(
package: str | None = None,
force: bool = False,
upgrade: bool = True,
only_unindexed: bool = False,
retry_http_404: bool = False,
index: Index = Index(),
seconds_to_sleep_between_requests: float = 5.0,
num_parallel_packages: int = multiprocessing.cpu_count(),
num_threads_per_package: int = multiprocessing.cpu_count(),
) -> None:
"""Crawl and parse docs."""
should_update_last_updated_package = package is None
should_update_last_updated_package = package is None and not only_unindexed
packages = get_packages(package)
for pkg in packages:
if pkg.do_not_update:
console.print(f"Skipping {pkg.pypi}: {pkg.do_not_update_reason}")
packages = [pkg for pkg in packages if not pkg.do_not_update]
if only_unindexed:
packages = [pkg for pkg in packages if not pkg.indexed]
if (last_updated_package_name := index.load_last_updated_package()) is not None:
package_names = [pkg.pypi for pkg in packages]
try:
Expand Down
Loading