proycon / codemetapy

A Python package for generating and working with codemeta
https://codemeta.github.io/
GNU General Public License v3.0
24 stars 5 forks source link

Allow support for multiple author libraries #5

Closed matthewfeickert closed 3 years ago

matthewfeickert commented 3 years ago

It seems (though I haven't looked too deeply yet) that CodeMetaPy currently assumes that there is only a single author

https://github.com/proycon/codemetapy/blob/bbf2e574b63bc7c5a5df556dec42dcb876502442/codemeta/codemeta.py#L159-L161

which results in

(codemeta-example) $ python -m pip install -q --upgrade pip setuptools wheel
(codemeta-example) $ python -m pip install -q codemetapy "pyhf==0.5.2"
(codemeta-example) $ python -m pip list | grep CodeMetaPy
CodeMetaPy         0.3.4
$ codemetapy --no-extras pyhf > codemeta.json
$ head -n 19 codemeta.json
{
    "@context": [
        "https://doi.org/10.5063/schema/codemeta-2.0",
        "http://schema.org"
    ],
    "@type": "SoftwareSourceCode",
    "identifier": "pyhf",
    "name": "pyhf",
    "version": "0.5.2",
    "description": "(partial) pure Python HistFactory implementation",
    "license": "Apache, OSI Approved :: Apache Software License",
    "author": [
        {
            "@type": "Person",
            "givenName": "Matthew",
            "familyName": "Feickert Lukas Heinrich",
            "email": "lukas.heinrich@cern.ch, matthew.feickert@cern.ch, gstark@cern.ch"
        }
    ],

Is it possible to try to determine if there are multiple authors present? We could alternatively try to reformat the way the authors are listed in the metadata, though I think that having them just be comma separated isn't too uncommon.

Please let me know if you'd like any help on this in anyway.

proycon commented 3 years ago

Good point, there seems to be a discussion about this here as well: https://bugs.python.org/issue6992

It seems distutils itself doesn't really have an explicit solution for multiple authors/emails. I could attempt to parse the field by comma; though that would break packages that do "$surname, $firstname" (I didn't check but can imagine that could occur in some cases). But I agree that this is probably a good idea to implement.

proycon commented 3 years ago

I just released v0.3.5 which implements this.

matthewfeickert commented 3 years ago

Fantastic! Thank you very much @proycon!