-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
pythonPackage.markdownsuperscript: init at 2.0.0 #26985
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
Conversation
pkgs/top-level/python-packages.nix
Outdated
@@ -13451,6 +13451,26 @@ in { | |||
}; | |||
}; | |||
|
|||
markdownsuperscript = buildPythonPackage rec { |
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.
Please move this expression to python-modules
as described in the header of this file.
pkgs/top-level/python-packages.nix
Outdated
version = "2.0.0"; | ||
name = "markdownsuperscript-${version}"; | ||
|
||
src = pkgs.fetchurl { |
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.
fetchPypi
is preferred.
pkgs/top-level/python-packages.nix
Outdated
|
||
propagatedBuildInputs = with self; [ markdown ]; | ||
|
||
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.
add a comment when disabling tests
6e7428e
to
02d3154
Compare
Thanks for your remarks. I took them into account. |
|
||
propagatedBuildInputs = [ markdown ]; | ||
|
||
doCheck = false; # Tests depend on packages which are not available yet in nixpkgs |
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.
Are you going to use and maintain this package? If not, then I'm of the opinion you should add test dependencies since otherwise there's no way to tell whether it is working.
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.
@FRidh Today, I've tried activating the tests for this package. First, I've added the missing dependency (see #27018). Then, I've made the following changes to this derivation so that it would run the tests:
diff --git a/pkgs/development/python-modules/markdownsuperscript/default.nix b/pkgs/development/python-modules/markdownsuperscript/default.nix
index fdf9913e76..9677de0c99 100644
--- a/pkgs/development/python-modules/markdownsuperscript/default.nix
+++ b/pkgs/development/python-modules/markdownsuperscript/default.nix
@@ -1,18 +1,24 @@
-{ stdenv, buildPythonPackage, fetchPypi, markdown }:
+{ stdenv, buildPythonPackage, fetchFromGitHub, markdown, nose, codecov }:
buildPythonPackage rec {
pname = "MarkdownSuperscript";
version = "2.0.0";
name = "${pname}-${version}";
- src = fetchPypi {
- inherit pname version;
- sha256 = "1dsx21h9hkx098d5azpw81dcz23rrgzrwlymwv7jri348q26p748";
+ src = fetchFromGitHub {
+ owner = "jambonrose";
+ repo = "markdown_superscript_extension";
+ rev = "v${version}";
+ sha256 = "0kvnvicgnxmd9xlm9gi7nk9jqnhj2qp7238xxrxls385l0x07004";
};
+ buildInputs = [ nose codecov ]; # Tests only
+
propagatedBuildInputs = [ markdown ];
- doCheck = false; # Tests depend on packages which are not available yet in nixpkgs
+ patchPhase = ''
+ sed -i 's/==.*$//' requirements/test_requirements.txt
+ '';
meta = {
description = "An extension to the Python Markdown package enabling superscript text";
You may remark in passing that I've changed the source from PyPi to GitHub because initially I got the following error: ImportError: No module named tests
. And indeed, checking the source from PyPi I could see that the tests/
folder which is present in the source on GitHub wasn't there. However, after this change the tests still fail in the same way in Python 2 and in Python 3, I get a new error (showing only the tail of the trace):
File "/nix/store/4irqw5y5mj9dr41x1fl4cgqxpyaqvlpj-python3.6-bootstrapped-pip-9.0.1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1521, in _listdir
"Can't perform this operation for unregistered loader type"
NotImplementedError: Can't perform this operation for unregistered loader type
I don't know if this is a problem of version of a dependency or something else.
I'm also wondering if these tests are meant to be run by the user (there are no instructions on how to run them).
I'm not a Python programmer and I feel like I've lost already way too much time on this. Feel free to take over, to merge or to close the PR.
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.
@Zimmi48 sometimes getting the tests to work takes a lot of time and sometimes they just don't work at all. I appreciate the time you put in it, but if you notice it isn't working or going forward, then we simply merge what we have and leave it at that.
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.
@FRidh OK thanks. I suppose I should change the comment on the doCheck = false;
then. What do you think of:
doCheck = false; # Did not manage to get the tests to work, see PR #26985 for details on the failed attempt.
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.
# Missing test dependencies, see https://github.com/NixOS/nixpkgs/pull/26985
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.
as long as you have the reference here it is fine! :)
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 added :)
02d3154
to
ac86016
Compare
Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)