philips-software / philips-software/SPDXMerge

Tools fails to run

Open
#143 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
10
Avg merge
2h 56m
Merged PRs (30d)
1

Description

I've installed the tool as per documented process: pip install -r requirements.txt
However at first use, the tool immediate fails:

python .\spdxmerge\SPDXMerge.py --docpath .\files --name Reporting --version 3.0.0.0 --author "Raymond Kloprogge" --email raymond.kloprogge@philips.com --mergetype 0  --docnamespace "https://philips.com" --filetype J
Traceback (most recent call last):
  File "C:\src\philips-software\SPDXMerge\spdxmerge\SPDXMerge.py", line 47, in <module>
    main()
    ~~~~^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\click\core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\click\core.py", line 1082, in main
    rv = self.invoke(ctx)
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\click\core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\click\core.py", line 788, in invoke
    return __callback(*args, **kwargs)
  File "C:\src\philips-software\SPDXMerge\spdxmerge\SPDXMerge.py", line 40, in main
    doc_list, root_doc = read_docs(docpath, rootdocpath)
                         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\philips-software\SPDXMerge\spdxmerge\utils.py", line 22, in read_docs
    doc = parse_anything.parse_file(dir + "/" + file)
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\parser\parse_anything.py", line 34, in parse_file
    return json_parser.parse_from_file(file_name, encoding)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\parser\json\json_parser.py", line 16, in parse_from_file
    return JsonLikeDictParser().parse(input_doc_as_dict)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\parser\jsonlikedict\json_like_dict_parser.py", line 84, in parse
    parsed_fields[argument_name] = parsing_method(field)
                                   ~~~~~~~~~~~~~~^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\parser\jsonlikedict\creation_info_parser.py", line 64, in parse_creation_info
    creation_info = construct_or_raise_parsing_error(
        CreationInfo,
    ...<12 lines>...
        ),
    )
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\parser\parsing_functions.py", line 13, in construct_or_raise_parsing_error
    constructed_object = object_to_construct(**args_for_construction)
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\spdx\model\document.py", line 53, in __init__
    check_types_and_set_values(self, locals())
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\common\typing\type_checks.py", line 26, in check_types_and_set_values
    setattr(instance_under_construction, key, value)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\310209604\AppData\Local\Programs\Python\Python313\Lib\site-packages\spdx_tools\common\typing\dataclass_with_properties.py", line 32, in set_field_with_error_conversion
    set_field(self, value)
    ~~~~~~~~~^^^^^^^^^^^^^
  File "<@beartype(spdx_tools.common.typing.dataclass_with_properties.make_setter.set_field) at 0x2b15ac085e0>", line 28, in set_field
beartype.roar.BeartypeCallHintParamViolation: Method spdx_tools.common.typing.dataclass_with_properties.make_setter.set_field() parameter value="None" violates type hint <class 'str'>, as <class "builtins.NoneType"> "None" not instance of str.

I'm using python 3.13.0
Installed packages:

Package                   Version
------------------------- -----------
altair                    5.5.0
astroid                   3.1.0
asttokens                 2.4.1
attrs                     25.2.0
beartype                  0.20.0
blinker                   1.9.0
boolean.py                4.0
cachetools                5.5.2
certifi                   2024.8.30
charset-normalizer        3.4.0
click                     8.1.8
colorama                  0.4.6
dill                      0.3.9
et_xmlfile                2.0.0
executing                 2.1.0
Flask                     3.1.0
gitdb                     4.0.12
GitPython                 3.1.44
icecream                  2.1.3
idna                      3.10
iniconfig                 2.0.0
isort                     5.13.2
itsdangerous              2.2.0
Jinja2                    3.1.6
jsonschema                4.23.0
jsonschema-specifications 2024.10.1
license-expression        30.4.1
lxml                      5.3.1
MarkupSafe                3.0.2
mccabe                    0.7.0
narwhals                  1.30.0
numpy                     2.2.3
openpyxl                  3.1.5
packaging                 24.2
pandas                    2.2.3
pillow                    11.1.0
pip                       25.1.1
platformdirs              4.3.6
pluggy                    1.5.0
ply                       3.11
protobuf                  5.29.3
pyarrow                   19.0.1
pydeck                    0.9.1
Pygments                  2.18.0
pylint                    3.1.0
pyparsing                 3.2.1
pytest                    8.1.1
python-dateutil           2.9.0.post0
python-docx               1.1.2
pytz                      2025.1
PyYAML                    6.0.2
rdflib                    7.1.3
referencing               0.36.2
requests                  2.32.3
rpds-py                   0.23.1
semantic-version          2.10.0
six                       1.16.0
smmap                     5.0.2
spdx-tools                0.8.3
streamlit                 1.43.2
tenacity                  9.0.0
toml                      0.10.2
tomlkit                   0.13.2
tornado                   6.4.2
typing_extensions         4.12.2
tzdata                    2025.1
uritools                  4.0.3
urllib3                   2.2.3
watchdog                  6.0.0
Werkzeug                  3.1.3
xmltodict                 0.14.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported command with Python 3.13, then start in spdxmerge/SPDXMerge.py and follow read_docs in spdxmerge/utils.py into the spdx_tools parser. Check the input file that triggers the None value and whether the installed dependency versions are involved. Done means the command completes successfully or reports a clear, actionable validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.