Skip to content

test_bump_spdx_document fails with python3.14 #866

@santiagorr

Description

@santiagorr

Hi there,

Trying to build tools-python on Debian with python3.14 ends up in error:

=================================== FAILURES ===================================
___________________________ test_bump_spdx_document ____________________________

    def test_bump_spdx_document():
        spdx2_document: Spdx2_Document = document_fixture()
        spdx2_document.creation_info.creators.append(actor_fixture(ActorType.TOOL, "tool_name", None))
        document_namespace = document_fixture().creation_info.document_namespace
    
        payload: Payload = bump_spdx_document(spdx2_document)
    
>       write_payload(payload, sys.stdout)

tests/spdx3/bump/test_spdx_document_bump.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
spdx_tools/spdx3/writer/console/payload_writer.py:64: in write_payload
    write_method(element, text_output)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

relationship = Relationship(spdx_id='https://some.namespace#SPDXRef-Relationship-0', creation_info=None, name=None, summary=None, des...#SPDXRef-File'], relationship_type=<RelationshipType.DESCRIBES: 15>, completeness=None, start_time=None, end_time=None)
text_output = <EncodedFile name="<_io.FileIO name=6 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>
heading = True

    def write_relationship(relationship: Relationship, text_output: TextIO, heading: bool = True):
        if heading:
            text_output.write("## Relationship\n")
        write_element_properties(relationship, text_output)
>       for property_name in relationship.__annotations__.keys():
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'Relationship' object has no attribute '__annotations__'. Did you mean: '__annotate_func__'?

spdx_tools/spdx3/writer/console/relationship_writer.py:15: AttributeError
...

This can be seen at https://salsa.debian.org/python-team/packages/python-spdx-tools/-/jobs/8720947#L2243.

This error doesn't happen building with python3.13 (only): https://salsa.debian.org/python-team/packages/python-spdx-tools/-/jobs/8607066.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions