Skip to content

Commit

Permalink
refactor(build_back_links.py): simplify icecream import and update sh…
Browse files Browse the repository at this point in the history
…ebang line
  • Loading branch information
idvorkin committed Jan 26, 2025
1 parent 8f8dad0 commit ea3338a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions build_back_links.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python3
#!uv run


# /// script
# requires-python = ">=3.8"
# dependencies = [
# "beautifulsoup4",
# "bs4",
# "typer",
# "icecream",
# "pudb",
Expand All @@ -12,6 +14,7 @@
# Remove line too long
# pep8: disable=E501

from icecream import ic
from bs4 import BeautifulSoup
from collections import defaultdict
from typing import NewType, List
Expand All @@ -20,10 +23,7 @@
from dataclasses import dataclass
import copy
import typer
from icecream import ic
from pathlib import Path
import pudb
from typing_extensions import Annotated


# Use type system (and mypy) to reduce error,
Expand Down Expand Up @@ -234,9 +234,7 @@ def sort_dict(d):

def __init__(self):
self.incoming_links = defaultdict(list) # forward -> back
self.redirects = (
{}
) # url->[back_links]; # I don't need to serialzie these, but helpful for debugging.
self.redirects = {} # url->[back_links]; # I don't need to serialzie these, but helpful for debugging.
self.pages = {} # canonical->md

def print_json(self):
Expand Down

0 comments on commit ea3338a

Please sign in to comment.