Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using license expression #4617

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

lahma
Copy link
Contributor

@lahma lahma commented Feb 7, 2024

By using license expression it will show up correctly on nuget.org and helps license validators/checkers to know what is the exact license type. Usually you have this in csproj file producing the nuspec, but I checked what kind of file is generated with <PackageLicenseExpression>MIT</PackageLicenseExpression>. The package will also still contain the license file.

Currently on nuget.org:

image

Ideally like for Newtonsoft.Json:

image

@@ -6,7 +6,8 @@
<version>$version$</version>
<authors>Charlie Poole, Rob Prouse</authors>
<owners>Charlie Poole, Rob Prouse</owners>
<license type="file">LICENSE.txt</license>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
Copy link
Member

Choose a reason for hiding this comment

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

Is this url correct? Without it, the license points to this URL anyway, see NUnit3TestAdapter, and it then doesn't have the fields filled out. Do you have an another package as an example?

And the use of the licenseUrl was deprecated in 2018 I think.

Looking at Newtonsoft, I see the same error there, no year and no copyright holders.
image

Copy link
Member

@OsirisTerje OsirisTerje left a comment

Choose a reason for hiding this comment

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

Not sure this is the way to go, and if we do it, it must have the year info and owner info.

@lahma
Copy link
Contributor Author

lahma commented Feb 8, 2024

Sorry, I need to get back to this a bit later. Generally what you see is generated and "machine readable" so what should be advertised as the license and as an agreement.

Based on the general license notes the names of people seem to be a bit auxiliary to the actual license. They seem to mainly provide context about the work that has been done when permissive licenses are being used. So for example GitHub shows info as "MIT license" regardless of who has been named the actual person that did the hard work.

From NUnit repo the license "headers" GitHub provides:

image

And the right-hand bar

image

I hope I don't indicate I want to change the license, I would want just to provide the general go/no-go decision for anyone browsing the nuget.org. OK fair, I'm trying to make the license checkers happy 😉

@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

I force-pushed a fix to point to GitHub repository's license file. This hopefully still keeps license analyzers happy.

@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

...and it doesn't work...

========================================
PackageFramework
========================================
Attempting to build package from 'nunit.temp.nuspec'.
The licenseUrl and license elements cannot be used together.
An error occurred when executing task 'PackageFramework'.

So package needs to have just the expression and license can be part of the regular root package location, which it already is.

@OsirisTerje
Copy link
Member

About the license, it is not about showing the MIT license symbol, but when you go to that license, it has template fields that are not filled in - for year and names.

@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

Yes I understand the concern, but Microsoft has the same situation: https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection/8.0.0 , same kind of template link there but the actual package contains LICENSE.txt : https://nuget.info/packages/Microsoft.Extensions.DependencyInjection/8.0.0 .

I believe the expression is indicator of license format and restrictions and then the actual license is/can be part of the package and of course part of original repository which holds more details. So as a consumer if I see that it's MIT/Apache-2.0/BSD I know where I'm getting into and I know I just need to be ready to show the project's license which includes the actual authors and copyrights but I don't need to worry about redistribution rights etc.

@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

For reference I have this fairly popular NuGet package with same kind of template shown on NuGet.org, I don't mind - I still have the "actual license" that follows the template and has my name and year on it.

@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

@OsirisTerje
Copy link
Member

Got me there :-)

Copy link
Member

@OsirisTerje OsirisTerje left a comment

Choose a reason for hiding this comment

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

Have no choice anymore :-)

@OsirisTerje OsirisTerje merged commit 1ad9a85 into nunit:master Feb 17, 2024
5 checks passed
@lahma lahma deleted the license-expression branch February 17, 2024 19:52
@lahma
Copy link
Contributor Author

lahma commented Feb 17, 2024

Thanks for accepting the change, I hope it will be for the common good 🙂

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.

None yet

2 participants