Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Allow for more than one license, including directories #341

Closed
dhirschfeld opened this issue Apr 29, 2023 · 6 comments · Fixed by #342
Closed

Allow for more than one license, including directories #341

dhirschfeld opened this issue Apr 29, 2023 · 6 comments · Fixed by #342

Comments

@dhirschfeld
Copy link
Contributor

When specifying multiple license files like below:

  license: MIT
  license_family: MIT
  license_file:
    - LICENSE
    - NOTICE.md

boa throws the below error:

Recipe validation error

['LICENSE', 'NOTICE.md'] is not of type 'string'

Failed validating 'type' in schema['properties']['about']['properties']['license_file']:
    {'title': 'License File', 'type': 'string'}

On instance['about']['license_file']:
    ['LICENSE', 'NOTICE.md']

With conda-build multiple license files and also directories are allowed. This is important to be able to specify 3rd party licenses which should be included.

@dhirschfeld
Copy link
Contributor Author

dhirschfeld commented Apr 29, 2023

@dhirschfeld
Copy link
Contributor Author

Related PR: conda/conda-build#4153

@wolfv
Copy link
Member

wolfv commented Apr 30, 2023

Do you want to make a PR for the Pydantic type? I think the recipe works fine since we use conda-builds "packaging" code.

@dhirschfeld
Copy link
Contributor Author

Sure, I'll take a look and see what I can figure out...

@wolfv
Copy link
Member

wolfv commented May 1, 2023

I think it's just this line:

license_file: Optional[str] = None

@dhirschfeld
Copy link
Contributor Author

Slightly confused as my installed boa doesn't seem to have that file. Instead, there's recipe.v1.json:

"license_file": {
"title": "License File",
"type": "string"
},

There's also generate_schemas.sh which seems to create the recipe.v1.json from models.py, but if it's created at build time, why is it also committed to the source?

If I change my installed recipe.v1.json like below it seems to get rid of the error:

        "license_file": {
          "title": "License File",
          "type": "array",
          "items": {
            "type": "string"
          }
        },

...but then, in my PR, if I didn't also update the committed recipe.v1.json along with the model.py file they would be out of sync in the source?

Anyway, I'll put up a PR so the changes can be discussed there...

dhirschfeld added a commit to dhirschfeld/boa that referenced this issue May 1, 2023
@wolfv wolfv closed this as completed in #342 May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants