Skip to content

Commit

Permalink
Handle python with native c.
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Russell <[email protected]>
  • Loading branch information
cerrussell committed Nov 27, 2024
1 parent 820cc43 commit e81b550
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
35 changes: 24 additions & 11 deletions test/diff/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def exec_on_repo(args, repo):
for cmd in cmds:
new_cmd = list(cmd.split(" "))
commands.append(f"{list2cmdline(new_cmd)}")
if repo["language"] == "python":
if "python" in repo["language"]:
commands.append(create_python_venvs(repo, args.uv_location))
elif args.build and repo["build_cmd"]:
cmds = repo["build_cmd"].split(";")
Expand Down Expand Up @@ -411,19 +411,32 @@ def run_cdxgen(repo, output_dir):
Returns:
str: The repository data with cdxgen commands
"""
cdxgen_cmd = [
'cdxgen',
"--no-include-formulation",
'-t',
repo['language'],
'-o',
Path.joinpath(output_dir, f'{repo["project"]}-bom.json'),
repo['repo_dir']
]
if repo["language"] == "python-c":
cdxgen_cmd = [
"cdxgen",
"--no-include-formulation",
"-t",
"python",
"-t",
"c",
"-o",
Path.joinpath(output_dir, f"{repo['project']}-bom.json"),
repo["repo_dir"]
]
else:
cdxgen_cmd = [
"cdxgen",
"--no-include-formulation",
"-t",
repo['language'],
"-o",
Path.joinpath(output_dir, f"{repo['project']}-bom.json"),
repo["repo_dir"]
]
cmd = f"CDXGEN_DEBUG_MODE=debug {list2cmdline(cdxgen_cmd)}"
if repo["cdxgen_vars"]:
cmd = f"{repo['cdxgen_vars']} {cmd}"
if repo["language"] == "python":
if "python" in repo["language"]:
if repo["package_manager"] == "poetry":
cmd = f"VIRTUAL_ENV=$(poetry env list --full-path | grep -E -o '(/\S+)+/pypoetry/virtualenvs/\S+') {cmd}"
else:
Expand Down
2 changes: 1 addition & 1 deletion test/diff/repos.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ plantuml_17,https://github.com/plantuml/plantuml.git,java17,17,,gradle,,,gradle
jazzer,https://github.com/CodeIntelligenceTesting/jazzer.git,java8,8,,bazelisk,7.3.0,sdk use java 8.0.432-tem,bazelisk build //:jazzer_release,BAZEL_CMD='bazelisk' BAZEL_TARGET=//:jazzer_release,3947707d7db7e5cae0c8cfaeb10bdfeb06fc32bb
tinydb,https://github.com/msiemens/tinydb.git,python,"3.9.20,3.10.15,3.11.10,3.12.7","pyproject.toml,poetry.lock",poetry,,,poetry install,,10644a0e07ad180c5b756aba272ee6b0dbd12df8
funcy,https://github.com/Suor/funcy.git,python,"3.9.20,3.10.15",setup.py,pip,,rm test_requirements.txt,python setup.py install,,859056d039adea75c1c3550286437ce0b612fe92
numpy,https://github.com/numpy/numpy.git,"python,c","3.9.20,3.10.15,3.11.10,3.12.7","setup.py,pyproject.toml",pip,,git submodule update --init,pip install .,,93fdebfcb4bc4cd53c959ccd0117a612d5f13f1a
numpy,https://github.com/numpy/numpy.git,python-c,"3.9.20,3.10.15,3.11.10,3.12.7","setup.py,pyproject.toml",pip,,git submodule update --init,pip install .,,93fdebfcb4bc4cd53c959ccd0117a612d5f13f1a
requests,https://github.com/psf/requests.git,python,"3.9.20,3.10.15,3.11.10,3.12.7","setup.py",,,,pip install .,,23540c93cac97c763fe59e843a08fa2825aa80fd

0 comments on commit e81b550

Please sign in to comment.