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

nbdime: init at 1.0.6 #61606

Merged
merged 1 commit into from
Oct 30, 2019
Merged

nbdime: init at 1.0.6 #61606

merged 1 commit into from
Oct 30, 2019

Conversation

tbenst
Copy link
Contributor

@tbenst tbenst commented May 16, 2019

Motivation for this change

Adds a useful tool for diffing and merging of Jupyter notebooks. Also updated jsonschema--had to remove tests as couldn't get them to run due to new test framework based on tox. Perhaps @domenkozar has an idea?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Also not sure if I did this recompilation test correctly...

~/c/nixpkgs> nix-shell -p nix-review --run "nix-review wip"
these paths will be fetched (0.08 MiB download, 0.38 MiB unpacked):
  /nix/store/w7xgdpblmq59blg2qzcdj951rgl2h6v0-bash-interactive-4.4-p23-dev
  /nix/store/x9vlpm4wyzzjwjdmcm3sbpbq2lvs8n0r-nix-review-2.0.0
copying path '/nix/store/w7xgdpblmq59blg2qzcdj951rgl2h6v0-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/x9vlpm4wyzzjwjdmcm3sbpbq2lvs8n0r-nix-review-2.0.0' from 'https://cache.nixos.org'...
$ git fetch --force https://github.com/NixOS/nixpkgs master:refs/nix-review/0
From https://github.com/NixOS/nixpkgs
 * [new branch]              master     -> refs/nix-review/0
$ git worktree add /home/tyler/.cache/nix-review/rev-5fd27a66239c96ef088c45aa1a7fb40b74cf897e-dirty/nixpkgs efcdac63fee4280cdc276362199503b6acb75df2
Preparing worktree (detached HEAD efcdac63fee)
Checking out files: 100% (18930/18930), done.
HEAD is now at efcdac63fee nixos/pantheon: add geoclue application configuration
$ nix-env -f /home/tyler/.cache/nix-review/rev-5fd27a66239c96ef088c45aa1a7fb40b74cf897e-dirty/nixpkgs -qaP --xml --out-path --show-trace
No diff detected, stopping review...
$ git worktree prune

Sorry, something went wrong.

@teto
Copy link
Member

teto commented May 17, 2019

better use nix run nixpkgs.nix-review. As for the tox testing, nixpkgs' hypothesis seems to remove the tox.ini . IIRC, you can look into the tox.ini and run the test directly in the checkPhase.

@tbenst
Copy link
Contributor Author

tbenst commented May 17, 2019

@teto thanks! Tests aren't all passing so made an issue here: python-jsonschema/jsonschema#562

@teto
Copy link
Member

teto commented May 17, 2019

Until an upstream fix, you could run only specific tests with -k https://docs.python.org/3.7/library/unittest.html#command-line-interface, there are some examples in nixpkgs

@tbenst
Copy link
Contributor Author

tbenst commented May 17, 2019

@teto thx! incorporated all suggestions.

@tbenst
Copy link
Contributor Author

tbenst commented May 17, 2019

All tests now passing for jsonschema

@tbenst
Copy link
Contributor Author

tbenst commented May 27, 2019

Unfortunately, a number of python packages hardcode jsonshema~=2.6. This can be fixed by adding sed -i "s/jsonschema~=2.6/jsonschema/" requirements/base.txt to postPatch. Should I do all of this in this pull request or make a new one for jsonschema?

@teto
Copy link
Member

teto commented May 27, 2019

Unfortunately, a number of python packages hardcode

How many ? If many we could bump jsonschema while keeping the version of 2.6 at the same time. I am not fond of patching the requirement since it may induce some other problems.

@tbenst
Copy link
Contributor Author

tbenst commented May 27, 2019

@teto ~17 packages rely on jsonschema, although I'm not sure how many specify a version. I know that aws-sam-translator and cfn-lint rely on 2.6, but haven't checked any others. I tried having two versions, but get the following error when trying to build:

Found duplicated packages in closure for dependency 'jsonschema': 
  jsonschema 3.0.1 (/nix/store/di3bkdy954ngkpwnnxi2cqwdwvqh76rj-python3.7-jsonschema-3.0.1/lib/python3.7/site-packages)
  jsonschema 2.6.0 (/nix/store/5z3pax2qlzqyy4xbx0wn0yc3gdv1kpil-python3.7-jsonschema-2.6.0/lib/python3.7/site-packages)

Package duplicates found in closure, see above. Usually this happens if two packages depend on different version of the same dependency.

@teto
Copy link
Member

teto commented May 27, 2019

Ok not sure what to advise then, @FRidh should know better.

@tbenst
Copy link
Contributor Author

tbenst commented May 27, 2019

I was able to get work locally by using buildPythonApplication in nbdime and creating this overlay. Could do something similar for this pull request? That way can have two versions of jsonschema as @teto suggested.

(self: super: {
  nbdimeOverrides = python-self: python-super: {
    jsonschema = python-super.callPackage /Computer/packages/jsonschema.nix { };
      };
    pythonNbdime = super.python37.override {packageOverrides = self.nbdimeOverrides;};
  nbdime = super.callPackage /Computer/packages/nbdime.nix { python3Packages = self.pythonNbdime.pkgs; };
  })

@tbenst
Copy link
Contributor Author

tbenst commented Oct 30, 2019

@teto turns out the poetry pkg had to deal with jsonschema issue too. They resolved by making local nix derivation. I callPackage on this unlisted derivation. Let me know what you think..?

@tbenst tbenst force-pushed the nbdime branch 2 times, most recently from a4879f3 to b30bbe8 Compare October 30, 2019 16:54
@jonringer
Copy link
Contributor

@GrahamcOfBorg build python37Packages.nbdime python38Packages.nbdime

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

nix-review passes on NixOS
diff LGTM
executables seem to work

[4 built, 17 copied (86.7 MiB), 12.2 MiB DL]
https://github.com/NixOS/nixpkgs/pull/61606
2 package were build:
python37Packages.nbdime python38Packages.nbdime

darwin build is broken by ipython, unrelated to this PR

@jonringer jonringer merged commit 53feebb into NixOS:master Oct 30, 2019
@tbenst tbenst deleted the nbdime branch October 30, 2019 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants