Skip to content

Document licensing and copyright for reused code #202

@ilai-deutel

Description

@ilai-deutel

Hello,

I noticed that part of the code in this repo is copied from other projects, with comments for attribution, for instance:

# Note: initially copied from https://github.com/florimondmanca/httpx-sse/blob/master/src/httpx_sse/_decoders.py

# we define a separate type (copied from typeshed)

This makes it difficult to vendor this repo, as one has to track all sources and their licenses / copyright information to ensure compliance with their licenses.
Would you consider standardizing this in a machine-readable format? I recommend using REUSE Specification, which enforces the SPDX license open standard.

For instance, _compat.py could look like:

+ # SPDX-FileCopyrightText: 2026 RunwayML
+ #
+ # SPDX-License-Identifier: Apache-2.0

...

     # we define a separate type (copied from typeshed)
     # that represents that `cached_property` is `set`able
     # at runtime, which differs from `@property`.
     #
     # this is a separate type as editors likely special case
     # `@property` and we don't want to cause issues just to have
     # more helpful internal types.

+   # SPDX-SnippetBegin
+   # SPDX-SnippetCopyrightText: Contributors to typeshed <https://github.com/python/typeshed>
+   # SPDX-SnippetCopyrightText: 2015 Jukka Lehtosalo and contributors
+   # SPDX-License-Identifier: Apache-2.0 AND MIT
    class typed_cached_property(Generic[_T]):
      ...
+   # SPDX-SnippetEnd

If you are ok with that I could help with a PR (just based on the "copied from ..." comments).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions