Skip to content
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

linkchecker: 9.3 -> 9.3.1 #36228

Merged
merged 1 commit into from Mar 6, 2018
Merged

Conversation

tw-360vier
Copy link
Contributor

This also uses an older requests version because
linkchecker breaks with requests > 2.14.2.

Motivation for this change

Make linkchecker work

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions: Ubuntu
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

src = fetchurl {
url = "mirror://pypi/L/LinkChecker/${name}.tar.gz";
sha256 = "0v8pavf0bx33xnz1kwflv0r7lxxwj7vg3syxhy2wzza0wh6sc2pf";
# the original repository is abandoned, development is now happening here:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably also update the homepage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta.homepage is updated.
i think i worked out all the kinks now :)

propagatedBuildInputs = with python2Packages;[
# pin requests version until next release.
# see: https://github.com/linkcheck/linkchecker/issues/76
(requests.overridePythonAttrs(old: rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/home-assistant/default.nix for how to pin dependency version.


python2Packages.buildPythonApplication rec {
name = "LinkChecker-${version}";
version = "9.3";
version = "9.3.1";

buildInputs = with python2Packages ; [ pytest ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkInputs

@@ -1,22 +1,36 @@
{ stdenv, lib, fetchurl, python2Packages, gettext }:
{ stdenv, lib, fetchFromGitHub, python2Packages, gettext }:

python2Packages.buildPythonApplication rec {
name = "LinkChecker-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify pname instead.

patches = [
./add-no-robots-flag.patch
./no-version-check.patch
./e62e630e606a648ec2969551a74f2e68e9853f49.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use fetchpatch for that.

@tw-360vier
Copy link
Contributor Author

@dotlambda
Thanks for your pointers!
i'm not very experienced in packaging python applications.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tw-360vier I have done some cosmetic changes. Please pull these, do the requested changes and squash the commits. Also please prefix your commit message with pythonPackages. (EDIT: sorry, it's not in the pythonPackages namespace, no prefix then)

python2Packages.buildPythonApplication rec {
name = "LinkChecker-${version}";
version = "9.3";
pname = "LinkChecker-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pname should not include the version. name will be set to "${pname}-${version}" automatically

@@ -35,7 +62,7 @@ python2Packages.buildPythonApplication rec {

meta = {
description = "Check websites for broken links";
homepage = https://wummel.github.io/linkchecker/;
homepage = https://linkcheck.github.io/linkchecker/;
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ peterhoeg ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to become a maintainer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shure, i'll add myself when i update the pull request

src = fetchFromGitHub {
owner = "linkcheck";
repo = "linkchecker";
rev = "v${version}";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dotlambda
should "version" contain the "v" for the tag so it shows up in "${pname}-${version}" or is it allright this way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that should stay as it is.
The two major advantages of having pname and version are

  • we can use fetchPypi which expects pname and version (without a "v" prefix most of the time)
  • easier overriding because we do not need to override name nor pname

This also uses an older requests version because
linkchecker breaks with requests > 2.14.2.
@dotlambda
Copy link
Member

@GrahamcOfBorg build linkchecker

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

tests/test_robotparser.py ss                                             [ 48%]
tests/test_robotstxt.py .................                                [ 60%]
tests/test_strformat.py ................                                 [ 71%]
tests/test_updater.py s                                                  [ 71%]
tests/test_url.py ....s..........s.....................                  [ 96%]
tests/test_urlbuild.py ....                                              [ 99%]
tests/logger/test_csvlog.py .                                            [100%]

==================== 139 passed, 10 skipped in 6.67 seconds ====================
/nix/store/wwzjsz9gm766asqlbcgns6qpzv06f8v2-LinkChecker-9.3.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

tests/test_robotparser.py ss                                             [ 48%]
tests/test_robotstxt.py .................                                [ 60%]
tests/test_strformat.py ................                                 [ 71%]
tests/test_updater.py s                                                  [ 71%]
tests/test_url.py ....s..........s.....................                  [ 96%]
tests/test_urlbuild.py ....                                              [ 99%]
tests/logger/test_csvlog.py .                                            [100%]

=================== 139 passed, 10 skipped in 19.75 seconds ====================
/nix/store/l8j20q7zb191a1x4071lwv111kdfgk17-LinkChecker-9.3.1

@dotlambda dotlambda merged commit eae4965 into NixOS:master Mar 6, 2018
@dotlambda
Copy link
Member

Thanks a lot!

@tw-360vier
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants