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

spyder: withPackages passthru for python console (closes #70986) #71989

Closed
wants to merge 1 commit into from

Conversation

twhitehead
Copy link
Contributor

Motivation for this change

Address the issue in #70986. That is, the python process spyder spawned for the ipython console didn't have the required spyder-kernels module to interface with spyder.

It also builds a bit on top of that by adding a withPackages override that is essentially used in a python.withPackages statement for building the python process that spyder spawns for the ipython console. This lets the user add whatever packages they need to work with their code.

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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @gebner

@twhitehead
Copy link
Contributor Author

Been a couple of weeks now. Wondering if you guys might have a quick chance to give it a quick go over before any merge incompatibilities creep in between it and HEAD. Thanks. 😃

@jonringer
Copy link
Contributor

Is this package meant to be used by other python packages?

@twhitehead
Copy link
Contributor Author

I don't believe so. It a scientific python IDE. The withPackages addition is so you can specify what packages are available in its interactive sessions.

@jonringer
Copy link
Contributor

Then I would highly recommend removing it from python-modules and putting it into applications/scientific or something simliar

@gebner
Copy link
Member

gebner commented Nov 9, 2019

You can use it as a library to e.g. embed the spyder editor widget in another application, like CQ-editor. (See issue #65830.) That's why I've made spyder a python module in the first place.

@FRidh
Copy link
Member

FRidh commented Nov 9, 2019

I'll have a look today

@jonringer
Copy link
Contributor

interesting, I'm not super familiar with spyder, but if you did want to use it as a dependency in other packages, then I would recommend against doing the withPackages, as this might break composibility with other python packages.

I will defer to @FRidh though, as he's more familiar with withPackages and it's implications

@FRidh
Copy link
Member

FRidh commented Nov 11, 2019

I think this is no longer needed, see #70986 (comment).

@twhitehead
Copy link
Contributor Author

I think withPackages shouldn't conflict as it is a python passthru (i.e., as in python.withPackages ...) and not a python packages passthru. That is, using nix repl

nix-repl>  :l <nixpkgs>
nix-repl> lib.attrNames python.passthru
[ "buildEnv" "executable" "implementation" "interpreter" "isPy2" "isPy27" "isPy3" "isPy33" "isPy34" "isPy35" "isPy36" "isPy37" "isPy3k" "isPyPy" "libPrefix" "pkgs" "pythonAtLeast" "pythonForBuild" "pythonOlder" "pythonVersion" "sitePackages" "sourceVersion" "ucsEncoding" "withPackages" ]

while

nix-repl> lib.attrNames pythonPackages.nltk.passthru
[ "pythonModule" "pythonPath" "requiredPythonModules" ]

@twhitehead
Copy link
Contributor Author

My understanding of 6e9743f is that it addresses the fact that IPython wouldn't start, but it doesn't address the need to be able to specify the packages that are available in that IPython session (which would be whatever the code you are working on requires).

@FRidh
Copy link
Member

FRidh commented Nov 12, 2019

imports work fine. E.g., if I add numpy to the env I can import it.

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@twhitehead
Copy link
Contributor Author

Existing way to do this was given at end of issue #70986.

@twhitehead twhitehead closed this Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: python 10.rebuild-darwin: 0 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants