-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Set the license on the release detail page. #1284
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
Conversation
|
I've been poking around the issues page and found that this fix is probably insufficient (who would have thought that some people would put entire license text into that field!). I'm still very open to helping make this a useful branch and can work on the necessary changes. My initial thought that comes to mind is to display only the first line of text of the Something else to consider would be favoring an existing license Trove classifier over the |
|
@mblayman I'm of the mind to just ignore the Maybe @nlhkabu has a better idea. |
|
I updated this branch to be smarter than just using the
|
|
Thanks for your work on this @mblayman On my side I'd much prefer not to have a modal (we don't currently have one, so I'm not keen on integrating one just for this)... Regarding your solution: It looks as though if both a classifier and I'm a bit concerned about the first line strategy yeilding inconsistent results because of inconsistent data. @dstufft might be able to provide more information on what data we should expect here. |
|
@nlhkabu, I tried to write the code in a way that it will take the classifier if it exists. While it does always attempt to take the license metadata first, the presence of a classifier will always override the metadata value. I'll make sure it does that. Looks like I need to add another test for additional code coverage anyway. |
|
I updated a test case to a) boost coverage and b) show that a classifier is preferred over license metadata. I hope this clears things up. |
|
So we have a couple of open questions here in my mind.
Personally for myself I'm thinking:
One idea that's kind of sticking in my head though, is I wonder if it'd make sense to try and translate the classifiers to SPDX License language? Perhaps an even further idea is to repurpose the What do folks think about that? |
|
Those are good questions @dstufft.
While SPDX seems interesting, I suspect that repurposing the existing |
|
From a UI perspective, I'm not keen on moving the license to a separate tab - given the content could be just a few words, I think there is a risk it is going to look really odd. I think we should move license to the bottom of the header (e.g. under the 'pip install box'). This will allow for longer strings - including multiple licenses as @mblayman describes in point 3. For any licenses that are truncated after the first line, we can add a 'read more' link that launches the full thing in a modal (yes, Donald, I've come around to your thinking on the modal :P ). For launch I can probably live without the modal being done (with just the truncated text showing)- we should open a separate issue for this. |
|
This branch is now updated to support multiple license classifiers. I took @nlhkabu's advice and moved the license label so that it is below the |
|
They code changes here look reasonable to me, if @nlhkabu is happy with the UI changes (or if she plans on adjusting it herself) this looks fine to merge to me. |
|
@mblayman are you able to provide me with a screenshot so I can verify this visually? |
|
Thanks @mblayman - in the short term, can you please remove the right alignment. If I need to adjust the margins, I can do so when I make other updates to this section :) |
|
✨ 🎉 |
|
Sweet! Thanks for all the feedback along the way. It feels nice to be able to contribute a small bit back to a community that I've been working in for years. |


This branch includes a modification to the release detail page to replace the license
TODOwith theRelease.licenseattribute.I removed the hyperlink because
licenseis an unstructured text field from distutils and it's not possible to exactly determine what the URL of that field might be (e.g., the code might be able to guess the correct license URL for "BSD", however, "Project X custom license" would not be feasible to provide a license URL).The one aspect that I did not know how to handle was the case of a missing license. My thought was to put some default value like
UNKNOWNin that spot. I'm happy to do that, but I don't know how to set l20n so that it will know how to deal with a default value.As this is my first contribution to this project, I'd appreciate any feedback if I'm missing something important. Thanks! 😄