moremoban / pypi-mobans

general python package templates using moban
Other
6 stars 7 forks source link

License classifier & templates #12

Open jayvdb opened 6 years ago

jayvdb commented 6 years ago

license is used to fill the setup(license='...'), but classifers also contains a license classifier.

It would be useful to add a license classifier automatically based on license, at least for the common ones.

http://pypi.python.org/pypi?%3Aaction=list_classifiers

My list is AGPL-3.0, GPL v3 & MIT.

https://gitlab.com/coala/mobans/blob/master/templates/coala-setup.py.jj2#L156

Also worth using license to populate a LICENSE file, but may be better done with some new voodoo in moban rather than a single LICENSE.jj2 .

chfw commented 6 years ago

I thought this license issue would be brought in the future. Yeah, truly that there are plenty of open source licenses out there. Let me get your list included at least.

jayvdb commented 6 years ago

Like the gitignore solution, we should import a maintained list of licenses.

https://github.com/moremoban/pypi-mobans/pull/22

As the licenses are not likely to be in jinja format, we'll probably need a new template engine for them.

SPDX would be the preferred list. I've asked for help at https://gitter.im/spdx-org/Lobby?at=5b179555b6eece791de2a03c

jayvdb commented 6 years ago

https://github.com/github/choosealicense.com/pull/489/files#diff-8d75fca200f1454e59f02d85f55bebcdR1 shows a fairly basic approach to converting spdx to a simpler language.

Maybe better to support that initiative, then use the github license list with a custom template language

jayvdb commented 6 years ago

'Master': https://github.com/spdx/license-list-XML/tree/master/src

Derived: https://github.com/spdx/license-list-data

Not sure: https://github.com/spdx/license-list

jayvdb commented 6 years ago

My current plan of attack is to try to use a Genshi text template that loads the SPDX 'master' xml files to render the license.

If that works, I'll do https://github.com/moremoban/moban/issues/45 .

It could probably also be done in jinja with custom globals plugins. (Will also try Mako using python blocks.)

jayvdb commented 6 years ago

It turns out mako isnt supported yet either, and I suspect that the engine loading mechanism will get a re-write after https://github.com/moremoban/moban/issues/23 as that will introduce lml, so I think I will just wait until that is finished.

jayvdb commented 5 years ago

openSUSE packaging requires license names match names given by SPDX. c.f. https://github.com/chfw/lml/issues/13

jayvdb commented 4 years ago

https://pypi.org/search/?q=choosealicense might include some useful tools.

chfw commented 3 years ago

Such an old issue. I will find some time to sort this out.