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

fix: Dockerfileでgenerate_licenses.pyが動作しない問題を修正 #1543

Merged
Merged
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
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
Loading