Skip to content

Commit

Permalink
Normalize pypi package name (PEP 0503) (#181)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyeong Seok <[email protected]>
  • Loading branch information
dd-jy authored Dec 12, 2023
1 parent d3adf08 commit 7faab9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fosslight_dependency/package_manager/Npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def parse_transitive_relationship(self):
err_msg = ''

cmd = 'npm ls -a --omit=dev --json -s'
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, encoidng='utf-8')
rel_tree = result.stdout
if rel_tree is None:
logger.error(f"It returns the error: {cmd}")
Expand Down
2 changes: 2 additions & 0 deletions src/fosslight_dependency/package_manager/Pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json
import shutil
import copy
import re
import fosslight_util.constant as constant
import fosslight_dependency.constant as const
from fosslight_dependency._package_manager import PackageManager
Expand Down Expand Up @@ -267,6 +268,7 @@ def parse_oss_information(self, f_name):

for d in json_data:
oss_init_name = d['Name']
oss_init_name = re.sub(r"[-_.]+", "-", oss_init_name).lower()
oss_name = f"{self.package_manager_name}:{oss_init_name}"
license_name = check_UNKNOWN(d['License'])
homepage = check_UNKNOWN(d['URL'])
Expand Down

0 comments on commit 7faab9b

Please sign in to comment.