Skip to content

Commit

Permalink
fix: Dockerfileでgenerate_licenses.pyが動作しない問題を修正 (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune authored Mar 2, 2025
1 parent b103a29 commit 0419522
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/generate_licenses.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import json
import subprocess
import sys
import urllib.request
from pathlib import Path
from shutil import which
from sysconfig import get_path
from typing import Literal, assert_never


Expand Down Expand Up @@ -47,13 +46,12 @@ def generate_licenses() -> list[License]:
licenses: list[License] = []

# pip
pip_licenses_path = which("pip-licenses", path=get_path("scripts"))
if pip_licenses_path is None:
raise Exception("pip-licensesが見つかりません")
try:
pip_licenses_output = subprocess.run(
[
pip_licenses_path,
sys.executable,
"-m",
"piplicenses",
"--from=mixed",
"--format=json",
"--with-urls",
Expand Down Expand Up @@ -294,7 +292,6 @@ def generate_licenses() -> list[License]:

if __name__ == "__main__":
import argparse
import sys

parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output_path", type=str)
Expand Down

0 comments on commit 0419522

Please sign in to comment.