Skip to content

gh-95649: Document that asyncio contains uvloop code#107536

Merged
AA-Turner merged 1 commit into
python:mainfrom
aloisklink:add-uvloop-license-info-to-asyncio
Jan 12, 2024
Merged

gh-95649: Document that asyncio contains uvloop code#107536
AA-Turner merged 1 commit into
python:mainfrom
aloisklink:add-uvloop-license-info-to-asyncio

Conversation

@aloisklink

@aloisklink aloisklink commented Aug 1, 2023

Copy link
Copy Markdown
Contributor

Some of the asyncio SSL changes in GH-31275 were taken from v0.16.0 of the uvloop project. In order to comply with the MIT license, we need to just need to document the copyright information.

Design decisions

How did I pick the files to add licensing info to?

I went through commit 13c10bf and added the # SPDX-FileCopyrightText: ... for changes to any file that has substantial code taken from https://github.com/MagicStack/uvloop/tree/v0.16.0.

The uvloop MIT license copyright text is Copyright (c) 2015-present MagicStack Inc. http://magic.io, so I changed it to Copyright (c) 2015-2021 MagicStack Inc. http://magic.io, as when 13c10bf was committed, the uvloop code was last modified in 2021.

Why did I use the # SPDX-... comment format?

Since there isn't yet a standard way to document licensing/copyright info (see python/devguide#928 for the issue tracking this), I've used the # SPDX-FileCopyrightText/# SPDX-License-Identifier format since that's the SPDX spec, which is the most common method of doing copyright/licensing information, used by Linux.

Normally, we should also add a # SPDX-FileCopyrightText: Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; All Rights Reserved line, but then we'd have to update the line every year, and I think the LICENSE file already covers this.

Why is there no # Licensed to PSF under a Contributor Agreement. comment?

As raised in #95649, there's no information about whether the contributor actually had the rights to relicense this code under the PSF.

Personally, the changes in Lib/asyncio seem to come from uvloop code authored by either @asvetlov, or @MagicStack employees, so it should be pretty easy to relicense these files under the PSF, assuming @MagicStack approves. See https://github.com/MagicStack/uvloop/commits/v0.16.0/uvloop/sslproto.pyx (MagicStack/uvloop@ef29dab is by an author that isn't @MagicStack or @asvetlov, but that change is pretty trivial, so it should still be okay to relicense).

However, Lib/test/test_asyncio/test_ssl.py seems to have a bunch of different authors from uvloop. And since there doesn't seem to be a uvloop CLA, even if @MagicStack approves, I don't think we can relicense this file under the PSF.


📚 Documentation preview 📚: https://cpython-previews--107536.org.readthedocs.build/

@ghost

ghost commented Aug 1, 2023

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@AA-Turner

Copy link
Copy Markdown
Member

As prior art (just looking through Lib):

  • http.cookies, logging, profile, pstats, sqlite3, tarfile include the full licence text in comments
  • optparse and platform use a __copyright__ variable.

Given that code was incorporated here, perhaps the best route is instead to add the full uvloop licence to Doc/licence.rst with a note in that file about which modules use the uvloop code?

A

@AA-Turner AA-Turner added docs Documentation in the Doc dir topic-asyncio needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 1, 2023
@AA-Turner

Copy link
Copy Markdown
Member

(Adding the backport labels as whatever the end result is, the correct licence notices should exist in Python 3.11, where the change first appeared.)

@gvanrossum gvanrossum removed their request for review August 1, 2023 15:14
@aloisklink

Copy link
Copy Markdown
Contributor Author

Given that code was incorporated here, perhaps the best route is instead to add the full uvloop licence to Doc/licence.rst with a note in that file about which modules use the uvloop code?

Already done! Although, I've just linked to the asyncio module in general, instead of the specific asyncio.xxxx modules. See

cpython/Doc/license.rst

Lines 1045 to 1069 in efa45b0

asyncio
----------
The :mod:`asyncio` module contains the following notice::
Copyright (c) 2015-2021 MagicStack Inc. http://magic.io
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

As prior art [other modules] include the full licence text in comments

We still need some information in each individual file, since CPython's LICENSE file says "Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license." (and it's best practice to put licensing info in each file, especially when it's different from the rest of licenses).

But sticking the full license text in every file is very verbose and difficult to summarize. It's why the Linux kernel and lots of other OSS projects have switched to using the SPDX standard, so people can just write SPDX-License-Identifier: xxxx instead of having the full license text in the comments (see https://lwn.net/Articles/739183/). We still should have the full text of the license somewhere, but that's covered by the Doc/license.rst file.


FYI, I'm not a lawyer, so I'm just following what other projects do, like the Linux kernel.

I'm going to ping @tiran, since as the author of #95649 and python/devguide#928, they probably care the most about this subject.

@kumaraditya303 kumaraditya303 removed their request for review August 2, 2023 06:23

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update -- I realise I was unclear, I had intended to ask why we don't only include the notice in Doc/license.rst, but you've addressed my concerns. One suggestion on wording for the text in license:

Thanks!
Adam

Comment thread Doc/license.rst Outdated
asyncio
----------

The :mod:`asyncio` module contains the following notice::

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The :mod:`asyncio` module contains the following notice::
Parts of the :mod:`asyncio` module are incorporated from uvloop 0.16,
which is distributed under the MIT license::

@aloisklink aloisklink Aug 6, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Changed in aloisklink@d5aee03 (I've also made the uvloop 0.16 text a hyperlink to https://github.com/MagicStack/uvloop/tree/v0.16.0)

aloisklink added a commit to aloisklink/cpython that referenced this pull request Aug 6, 2023
Reword `Doc/license.rst` file, as suggested in
python#107536 (comment)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@AA-Turner

Copy link
Copy Markdown
Member

@aloisklink please may you resolve the conflicts?

A

Some of the asyncio SSL changes in pythonGH-31275 were taken from
[v0.16.0 of the uvloop project][1]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: https://github.com/MagicStack/uvloop/tree/v0.16.0
@aloisklink aloisklink force-pushed the add-uvloop-license-info-to-asyncio branch from d5aee03 to 4b7beed Compare January 4, 2024 22:28
@aloisklink

Copy link
Copy Markdown
Contributor Author

@aloisklink please may you resolve the conflicts?

Fixed! Thanks for the reminder :)

Although, I guess this means that there may now be conflicts if we backport this to Python 3.11/Python 3.12.

@AA-Turner AA-Turner merged commit dce30c9 into python:main Jan 12, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @aloisklink for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @aloisklink and @AA-Turner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker dce30c9cbc212e5455e100f35ac6afeb30dfd23e 3.12

@miss-islington-app

Copy link
Copy Markdown

Sorry, @aloisklink and @AA-Turner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker dce30c9cbc212e5455e100f35ac6afeb30dfd23e 3.11

@AA-Turner

Copy link
Copy Markdown
Member

@aloisklink do you want to have a go at the backports?

A

aloisklink added a commit to aloisklink/cpython that referenced this pull request Jan 14, 2024
…thonGH-107536)

Some of the asyncio SSL changes in pythonGH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: python#31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
(cherry picked from commit dce30c9)

Co-authored-by: Alois Klink <alois@aloisklink.com>
aloisklink added a commit to aloisklink/cpython that referenced this pull request Jan 14, 2024
…thonGH-107536)

Some of the asyncio SSL changes in pythonGH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: python#31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0

(cherry picked from commit dce30c9)
@bedevere-app

bedevere-app Bot commented Jan 14, 2024

Copy link
Copy Markdown

GH-114045 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Jan 14, 2024
@bedevere-app

bedevere-app Bot commented Jan 14, 2024

Copy link
Copy Markdown

GH-114046 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 14, 2024
@aloisklink aloisklink deleted the add-uvloop-license-info-to-asyncio branch January 14, 2024 00:20
AA-Turner pushed a commit that referenced this pull request Jan 14, 2024
… (#114045)

Some of the asyncio SSL changes in GH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: #31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0

(cherry picked from commit dce30c9)
AA-Turner pushed a commit that referenced this pull request Jan 14, 2024
… (#114046)

Some of the asyncio SSL changes in GH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: #31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0

(cherry picked from commit dce30c9)
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
…7536)

Some of the asyncio SSL changes in pythonGH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: python#31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…7536)

Some of the asyncio SSL changes in pythonGH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: python#31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…7536)

Some of the asyncio SSL changes in pythonGH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: python#31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir topic-asyncio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants