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
pylode: init at 2.8.6 #95863
pylode: init at 2.8.6 #95863
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is supposed to be used as a standalone package. I recommend following the example of https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/autotiling/default.nix.
In all-packages.nix
, it's called as: autotiling = python3Packages.callPackage PATH_TO_NIX_FILE { };
I'll review this more thoroughly once it more closely matches existing best practices.
@drewrisinger I modified the PR. I tried following best practices from One thing I couldn't do was use
|
@ofborg eval |
Thanks. I meant generally with respect to formatting & layout. I'll leave comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Few formatting fixes
- Move package call to different location in
all-packages.nix
- Run tests
- Haven't tested build yet, waiting on tests.
pkgs/misc/pylode/default.nix
Outdated
propagatedBuildInputs = [ | ||
rdflib | ||
rdflib-jsonld | ||
requests | ||
dateutil | ||
markdown | ||
jinja2 | ||
gunicorn | ||
pytest | ||
falcon | ||
isodate | ||
six | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort alphabetically.
Pytest shouldn't need to be a runtime input (should probably be a checkInput
)
pkgs/misc/pylode/default.nix
Outdated
postPatch = '' | ||
substituteInPlace requirements.txt --replace "argparse" "" | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it actually fail to build with this in the requirements? If it builds, I'd say leave it in. argparse is a built-in python library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it actually fails if I leave argparse
in the requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. Strange. Thanks for checking 👍
pkgs/misc/pylode/default.nix
Outdated
sha256 = "01a6b916r32irnllfr0rxz2mn9v6xn94lrgjdb8dhkki9ninqddy"; | ||
}; | ||
|
||
# Waiting for argparse to be removed in requirements.txt from upstream package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference pull request/issue if there is one.
pkgs/misc/pylode/default.nix
Outdated
{ lib, buildPythonApplication, fetchFromGitHub, rdflib, rdflib-jsonld, requests, dateutil, markdown, jinja2, isodate, gunicorn, falcon, pytest, six }: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break onto separate lines and sort the packages alphabetically like:
{ lib, buildPythonApplication, fetchFromGitHub, rdflib, rdflib-jsonld, requests, dateutil, markdown, jinja2, isodate, gunicorn, falcon, pytest, six }: | |
{ lib | |
, buildPythonApplication | |
, fetchFromGitHub | |
, dateutil | |
, falcon | |
, ... | |
}: |
pkgs/misc/pylode/default.nix
Outdated
]; | ||
|
||
# Import errors in pylode tests | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try like this (replacing pytest
in arguments with pytestCheckHook
:
doCheck = false; | |
checkInputs = [ pytestCheckHook ]; |
My guess is that you're getting version conflicts between the installed version of pyLODE
in $out and the tests in the source directory. See #95689 (comment) (esp. 5.
) for a possible solution.
Tests are generally preferred if they exist. If this was a python package vs application, I'd recommend doing pythonImportsCheck = [ "name_of_python_package_here" ];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked in the upstream pyLODE package and it seems that the tests are failing over there with an import error. Opened an issue over there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koslambrou would you like to update this PR with tests enabled and version 2.8.4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doronbehar Still have to wait for 2.8.5. The tests are failing in 2.8.4 and the commit that solves this was added the day after the 2.8.4 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are failing in 2.8.4 and the commit that solves this was added the day after the 2.8.4 release.
Well then it should be fairly easy to grab that commit fetched from upstream. When doing it we usually put a comment that the referenced commit is included in 2.8.5 and should be removed with the update to a version newer then 2.8.4
pkgs/misc/pylode/default.nix
Outdated
homepage = "https://github.com/RDFLib/pyLODE"; | ||
description = "An OWL ontology documentation tool using Python and templating, based on LODE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically description is before homepage.
pkgs/top-level/all-packages.nix
Outdated
pylode = python3Packages.callPackage ../misc/pylode { }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are loosely sorted by directory. Your package probably doesn't belong here with the rest of the native python packages. Look for a place in the range of lines 15000+
pkgs/misc/pylode/default.nix
Outdated
meta = with lib; { | ||
homepage = "https://github.com/RDFLib/pyLODE"; | ||
description = "An OWL ontology documentation tool using Python and templating, based on LODE"; | ||
license = licenses.gpl3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of this is deprecated per https://discourse.nixos.org/t/lib-licenses-gpl3-co-are-now-deprecated/8206
It looks like gpl3Only
vs gpl3Plus
is appropriate here based on the license text.
Last comment I have is maybe this belongs in https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/science/biology because it's a taxonomy package? Doesn't seem like there's much in ./misc other than emulators |
I'd also still prefer to see some sort of self-test because python applications are fairly unstable due to constant library updates. |
Then, for the tests, I'll wait until the're fixed in the pyLODE package before requesting another review. This application is a documentation generator for ontology (taxonomy) web formats ( |
I'd suggest either pkgs/applications/science/biology or pkgs/applications/science/misc. I'm not too well-versed with best practices for those folders. |
@drewrisinger Updated to pyLODE v2.8.6 and all issues were resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Diff LGTM, minus changelog & @doronbehar comments
- Commits LGTM
- Builds via
nix-review
onx86_64-linux
:
1 package built:
pylode
|
||
meta = with lib; { | ||
description = "An OWL ontology documentation tool using Python and templating, based on LODE"; | ||
homepage = "https://github.com/RDFLib/pyLODE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best practice now is to add a meta.changelog
attribute if it exists.
homepage = "https://github.com/RDFLib/pyLODE"; | |
homepage = "https://github.com/RDFLib/pyLODE"; | |
changelog = "https://github.com/RDFlib/pyLODE..."; |
Or a more user-friendly documentation site if it exists, e.g. readthedocs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package has nothing of the sort. The only existing documentation is the README of the Github repository.
Result of 1 package built:
|
Motivation for this change
added new package: pylode at version 2.8.6
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)