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
papis: init at 0.5.2 + dependencies #34761
Conversation
}: | ||
|
||
buildPythonPackage rec { | ||
name = "papis-${version}"; |
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 specify pname
and leave out name
.
Same for the other packages.
, pkgs | ||
}: | ||
|
||
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.
buildPythonApplication
, configparser, habanero, papis-python-rofi, pylibgen | ||
, prompt_toolkit, pyparser, python_magic, pyyaml | ||
, requests, unidecode, urwid, vobject, tkinter | ||
, pkgs |
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 pass in vim
directly.
{ buildPythonPackage, lib, fetchFromGitHub }: | ||
|
||
buildPythonPackage rec { | ||
name = "papis-python-rofi-${version}"; |
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.
This should be called python-rofi.
pkgs/top-level/python-packages.nix
Outdated
@@ -5810,6 +5816,10 @@ in { | |||
|
|||
paperwork-backend = callPackage ../applications/office/paperwork/backend.nix { }; | |||
|
|||
papis = callPackage ../applications/office/papis { }; | |||
|
|||
papis-python-rofi = callPackage ../development/python-modules/papis-python-rofi { }; |
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.
python-rofi
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.
Ah, I see. papis-python-rofi seems to be a fork of python-rofi. Then it's all right like that,
pkgs/top-level/python-packages.nix
Outdated
@@ -5810,6 +5816,10 @@ in { | |||
|
|||
paperwork-backend = callPackage ../applications/office/paperwork/backend.nix { }; | |||
|
|||
papis = callPackage ../applications/office/papis { }; |
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 to all-packages.nix
and use python3Packages.callPackage
pkgs/top-level/python-packages.nix
Outdated
|
||
src = pkgs.fetchurl { | ||
url = "mirror://pypi/p/python-magic/${name}.tar.gz"; | ||
sha256 = "1hx2sjd4fdswswj3yydn2azxb59rjmi9b7jzh94lf1wnxijjizbr"; | ||
sha256 = "128j9y30zih6cyjyjnxhghnvpjm8vw40a1q7pgmrp035yvkaqkk0"; |
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.
Would you mind moving this to development/python-modules/
, specifying pname
, version
and using fetchPypi
?
For checking whether the dependents of python-magic still compile, use |
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 papis package should be put in pkgs/tools/...
since it's command line only.
6b0e120
to
e4d8e76
Compare
|
nox is failing, but even the following command fails on unstable
do we need to ask maintainers to fix the packages? |
}; | ||
|
||
# Python 2.x is not supported. | ||
disabled = !isPy3k && !isPyPy; |
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.
So, Python 2 isn't supported but PyPy is?
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.
my fault
}; | ||
|
||
# strictly requires 1.6.5 but nix has 1.6.6 only | ||
preConfigure = "sed -i 's/1.6.5/1.6.6/' requirements.txt"; |
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.
prePatch
I think you should rather replace ==
by >=
to make this patch future-proof.
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.
yeah that was stupid by me, fixing
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.
You could also create an upstream 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.
I'm not on bitbucket and I'm not willed to sign up, and I could not find his mail address. He is @grimmy on github
pname = "pyparser"; | ||
version = "1.0"; | ||
|
||
src = fetchFromBitbucket { |
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.
Why not fetchPypi
? fetchPypi
is generally preferred because this makes it easier to override the src
. However, in case e.g. tests are not uploaded to PyPI, it is better to use other sources.
The same applies for all other packages.
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.
for this and for papis tests are missing, for one other they are failing. Fixed others
sha256 = "1kp2iyx20lpc9dv4qg5fgwf83a1wx6f7hj1ldqyncg0kn9xcrhbg"; | ||
}; | ||
|
||
meta = { |
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.
You could put a with lib;
here to get rid of the lib.
prefix if you want.
|
||
meta = { | ||
description = "Get a BibTeX entry from an arXiv id number, using the arxiv.org API"; | ||
homepage = http://nathangrigg.github.io/arxiv2bib/; |
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.
Wrong descripion and homepage.
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.
Thanks
If these packages do have maintainers, then yes it would nice to tell them about it. |
sha256 = "0aplb4zdpgbpmaw9qj0vr7qip9q5w7sl1m1lp1nc9jmjfij9i0hf"; | ||
}; | ||
|
||
preConfigure = "sed -i 's/parse==/parse>=/' requirements.txt"; |
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.
postPatch
|
||
propagatedBuildInputs = [ file ]; | ||
|
||
patchPhase = '' |
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.
postPatch
pkgs/tools/misc/papis/default.nix
Outdated
sha256 = "0cw6ajdaknijka3j2bkkkn0bcxqifk825kq0a0rdbbmc6661pgxb"; | ||
}; | ||
|
||
preConfigure = "sed -i 's/configparser>=3.0.0/# configparser>=3.0.0/' setup.py"; |
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.
postPatch
pkgs/tools/misc/papis/default.nix
Outdated
vim | ||
]; | ||
|
||
preCheck = '' |
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.
Why is this needed? Leave an explanation.
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.
Done!
5b5b272
to
3be6a08
Compare
@GrahamcOfBorg build python2.pkgs.python-magic python3.pkgs.python-magic |
Failure on x86_64-linux (full log) Partial log (click to expand)
|
Failure on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
@GrahamcOfBorg build python2.pkgs.python_magic python3.pkgs.python_magic |
Should python_magic be renamed to python-magic? Any guideline on the naming convention? I don't like the underscore but I kept it as it was |
Please specify the appropriate |
pylibgen also needs an appropriate |
f5b9b0f
to
8d57878
Compare
Fixed tests, let me know |
}; | ||
|
||
# Required for tests only | ||
buildInputs = [ mock ]; |
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.
checkInputs
}: | ||
|
||
buildPythonPackage rec { | ||
name = "habanero-${version}"; |
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.
pname
sha256 = "128j9y30zih6cyjyjnxhghnvpjm8vw40a1q7pgmrp035yvkaqkk0"; | ||
}; | ||
|
||
propagatedBuildInputs = [ file ]; |
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 don't think this is necessary. Is it, @FRidh?
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.
No, it is not. The patch introduces it so it can be found during run-time. I doubt it needs to be explicitly added during build-time.
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.
removed
7a27d43
to
3bd19ec
Compare
I had to change dateparser too because it was needed in order to run habanero tests. However tests on python3 are failing (as per comment). Failing tests are only 3 and because of this error: AssertionError: False is not true : Didn't found any of the expected messages (['year is out of range', "('year must be in 1..9999'"]) -- message was: ValueError('year -2986 is out of range',) So it might be possible to fix it upstream, I'll bump the issue |
I just created a PR for dateparser :D |
:D no problem, I'll wait for dateparser merge. |
@nico202 You can remove your commit regarding dateparser and rebase on master. |
@dotlambda thanks for everything, I know that has been a long review I'm sorry, I hope this time it's ok |
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.
Almost there ;)
# Required for tests only | ||
checkInputs = [ mock ]; | ||
|
||
checkPhase = "python -m unittest discover -s tests"; |
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.
${python.interpreter}
instead of python
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.
ehm python is undefined
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 add it to dependencies
propagatedBuildInputs = [ requests ]; | ||
|
||
# It's not using unittest | ||
checkPhase = "python tests/test_pylibgen.py -c 'test_api_endpoints()'"; |
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.
${python.interpreter}
instead of python
Changed papis github url since yesterday it was moved to papis/papis |
Motivation for this change
Papis is a powerful and highly extensible command-line based document and bibliography manager.
https://github.com/alejandrogallo/papis
Things done
Added all papis missing dependencies (arxiv2bib, habanero, papis-python-rofi, pylibgen)
Updated python-magic from 0.4.10 to 0.4.13
(HELP WANTED: I don't know how to check if all packages depending on python-magic still works, how do I check it?
I checked beancount and it installs, relatorio and tests are ok, s3cmd installs (has no tests). How do I ask nix to do this automatically for all the dependencies?)
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)