-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support license #32
Comments
So there are two mechanisms for including a license, inline licenses and external files. This suggests in the medium-term, we should also emit |
The inline case looks like this:
import setuptools
setuptools.setup(
name="mypackage",
version="1.2.3",
license="""Mock License 1.0
This is a dummy license text to check how setuptools represents
it in the metadata so it can be exposed to pyproject.toml."""
)
PR#58 actually inspects that |
Oh I actually made some local improvements on the |
Yeah agreed. I had a feeling for a while that we might wind up going in that direction, but I thought it's something we didn't necessarily need to figure out until later. Printing to stdout was just easier 😛 Of course, one of the complications with writing to |
Yep, that's fair enough. Probably also when we do write out a new But… that can come later. :-)
The source actually reads
However, if I put it in
… I do see that
|
Ohhh that's interesting. Among other things, it probably means we should be more particular about adding tests that use both |
Indeed… I think with the "inline" case, we may have to assume it is truly "inlined" (and not an |
Yeah but setuptools should at least know whether it receives a string value that starts with |
BTW I saw that you pushed to |
Tried both versions, I think yours does a better job and is cleaner to boot. :-) |
Okay… so there's several ways a license can be included.
(Yep… and now for something completely different.) |
https://gist.github.com/sjlongland/1b79ac2f87a2c9ac5a947a27c99777a8 ← that basically describes the behaviour of Using Using
Unlike using |
Oh that is maddeningly inconsistent 😆 Personally, and this is most definitely just an opinion, I would follow a TDD approach here: start by writing simple test cases for all eight configurations. (assuming setuptools "officially" claims to support all of them - obviously anything that setuptools doesn't claim to support, we don't have to care about) The tests can be decorated with In fact, I think we could even make our initial release without having an implementation that covers all the cases. (i.e. there's really no pressure to do this completely correctly now) As far as I'm concerned, just getting something that works for some of the simpler projects would be a totally fine chunk of functionality to post on PyPI and start getting some feedback. |
How's it going with this feature? I think we're getting pretty close to the initial release milestone and this is one of the few things left |
I've been absolutely hammered by work… so it's taking waaay longer than I had hoped. I have some time this week-end, so should try and get it done then. |
So, having a look at this… also in relation to the library mentioned in #74, seems https://peps.python.org/pep-0639/ That PEP down further describes what it'd look like in the TOML: [project]
license = "MIT AND (Apache-2.0 OR BSD-2-Clause)"
license-files.globs = [
"LICENSE*",
"setuptools/_vendor/LICENSE*",
] Or specified explicitly: [project]
license = "MIT AND (Apache-2.0 OR BSD-2-Clause)"
license-files.paths = [
"LICENSE",
"setuptools/_vendor/LICENSE",
"setuptools/_vendor/LICENSE.APACHE",
"setuptools/_vendor/LICENSE.BSD",
] The core specification defines So it appears once the decision is made on PEP-639; if that's adopted it'll basically be a 1-1 mapping |
This issue entails adding support for writing the
license
field inpyproject.toml
when it is defined statically in the setuptools configuration.The text was updated successfully, but these errors were encountered: