Skip to content

Fix invocation of compile_licenses.py#3938

Open
llimeht wants to merge 1 commit intoSasView:mainfrom
llimeht:tmp/release-automation-check-licenses
Open

Fix invocation of compile_licenses.py#3938
llimeht wants to merge 1 commit intoSasView:mainfrom
llimeht:tmp/release-automation-check-licenses

Conversation

@llimeht
Copy link
Copy Markdown
Contributor

@llimeht llimeht commented May 4, 2026

Description

As noted in #3919, the invocation of compile_licenses.py was quite wrong. This corrects that invocation.

Fixes #3919

How Has This Been Tested?

With changes to release_automation.py, I figured out how to run it locally (and it ran just fine).

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@krzywon
Copy link
Copy Markdown
Contributor

krzywon commented May 4, 2026

A new error I found while testing. In my limited debugging of the issue, this seems to either be a pathing issue or a file permission issue. Not sure which.

Traceback (most recent call last):
File "sasview\build_tools\compile_licenses.py", line 135, in
sys.exit(not main(sys.argv[1:]))
~~~~^^^^^^^^^^^^^^
File "sasview\build_tools\compile_licenses.py", line 124, in main
modules = get_modules()
File "sasview\build_tools\compile_licenses.py", line 71, in get_modules
result = subprocess.run(
[
...<8 lines>...
check=True,
)
File "Python\pythoncore-3.14-64\Lib\subprocess.py", line 554, in run
with Popen(*popenargs, **kwargs) as process:
~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "Python\pythoncore-3.14-64\Lib\subprocess.py", line 1038, in init
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Python\pythoncore-3.14-64\Lib\subprocess.py", line 1552, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
# no special security
^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "sasview\build_tools\release_automation.py", line 398, in
main(args)
~~~~^^^^^^
File "sasview\build_tools\release_automation.py", line 384, in main
update_credits(SASVIEW_PATH / "src" / "sas" / "system" / "credits.html")
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sasview\build_tools\release_automation.py", line 318, in update_credits
subprocess.check_call(
~~~~~~~~~~~~~~~~~~~~~^
[
^
...<3 lines>...
credits_file,
^^^^^^^^^^^^^
])
^^
File "Python\pythoncore-3.14-64\Lib\subprocess.py", line 419, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sasview\venv\Scripts\python.exe', WindowsPath('sasview/build_tools/compile_licenses.py'), '--minimal', WindowsPath('sasview/src/sas/system/credits.html')]' returned non-zero exit status 1.

@llimeht
Copy link
Copy Markdown
Contributor Author

llimeht commented May 4, 2026

Is pip-licenses installed into that venv? (It's listed in requirements-dev.txt but might not be in an old venv)

compile_licenses.py could grow some exception handling around that subprocess.run call as a future improvement. Exception handling for subprocess.run always feels painful because there are so many possible failure modes. Capturing FileNotFoundError for this specific case might help (although capturing OSError to get a wider set of errors might be better, and then there is SubprocessError for another set of errors).

Copy link
Copy Markdown
Contributor

@krzywon krzywon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pip-licenses installed into that venv? (It's listed in requirements-dev.txt but might not be in an old venv)

That was the issue! Testing seems to be successful, with no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release_automation.py -> update_credits() function fails

2 participants