Closed Real-Gecko closed 2 years ago
The metadata reported by djlint (e.g. in djlint-1.9.3.dist-info/METADATA) is
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: click (>=8.0.1,<9.0.0)
Requires-Dist: colorama (>=0.4.4,<0.5.0)
Requires-Dist: coverage (>=6.3.1,<7.0.0)
Requires-Dist: cssbeautifier (>=1.14.4,<2.0.0)
Requires-Dist: html-tag-names (>=0.1.2,<0.2.0)
Requires-Dist: html-void-elements (>=0.1.0,<0.2.0)
Requires-Dist: importlib-metadata (>=4.11.0,<5.0.0)
Requires-Dist: jsbeautifier (>=1.14.4,<2.0.0)
Requires-Dist: pathspec (>=0.9.0,<0.10.0)
Requires-Dist: pytest (>=7.0.1,<8.0.0)
Requires-Dist: pytest-cov (>=3.0.0,<4.0.0)
Requires-Dist: regex (>=2022.1.18,<2023.0.0)
Requires-Dist: tomli (>=2.0.1,<3.0.0); python_version < "3.11"
Requires-Dist: tqdm (>=4.62.2,<5.0.0)
As you can see, the optionalness of coverage, pytest, and pytest-cov have been lost. I would believe that it is poetry's job to tag these dependencies as extras (e.g., following https://packaging.python.org/en/latest/specifications/core-metadata/#requires-dist-multiple-use) and perhaps you can report that to them(?); pypi2pkgbuild just follows whatever pip reports.
Well actually I believe this three shall be in dev category. I'm just curious why this packages were not marked as optional. How does pypi2pkgbuild
know that dependency is optional?
It doesn't know that, that's the point here...
So pypi2pkgbuild
does not have such possibility at all? Or is it just this particular case with djlint
?
This is not currently supported by pypi2pkgbuild, but as noted above, poetry doesn't actually report that the dependencies are optional, in any case.
Can you please explain how do you get info from poetry?
As far as I can see they've already fixed it on djLint
side.
https://github.com/Riverside-Healthcare/djLint/issues/322
Yet, I'm still curious if this feature can be added to pypi2pkgbuild
.
As noted in the issue you linked, this was incorrect/buggy metadata on djilint's side.
But they were marked as optional
in pyproject.toml
.
https://github.com/Riverside-Healthcare/djLint/blob/b4c835ca213e02a640d87916a8e165d5c6a22516/pyproject.toml#L39
So is it poetry
incorrectly reporting "optionality" or is it something else?
Yes.
I've created package for https://pypi.org/project/djlint/ and it added optional dependencies as normal dependencies.
Take a look at here: https://github.com/Riverside-Healthcare/djLint/blob/master/pyproject.toml
As you can see they're not marked as optional during installation.