-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
google-app-engine-python-sdk: init at 1.9.35 #14237
Conversation
@@ -0,0 +1,24 @@ | |||
{ 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.
This is poor style, make dependencies explicit by passing them as individual parameters.
Please de-compose this into separate commits for each change. |
06d661c
to
ba3ad28
Compare
I've addressed all of @joachifm's comments except the request to comment why I suppose I could create a |
Okay, I didn't look too closely at what you were doing |
ba3ad28
to
d46bec1
Compare
Sorry, I guess this calls for some additional background explanation. App Engine is kind of weird as far as Python stuff goes. It provides some core libraries and expects the rest of your dependencies to be included in your app, so you don't set up The SDK isn't packaged as a Python library (no Maybe some/all of this belongs in comments? |
I may need some help figuring out how to fix this Travis failure. 😦
|
There's nothing to be done about it. Please do perform a sandboxed build on your own machine or wait for someone to do it for you. I think @FRidh may provide some useful feedback. |
Okay, I have done a sandboxed build, just wanted to make sure the Travis failure isn't indicative of a real problem. |
@@ -0,0 +1,24 @@ | |||
{ pkgs, stdenv, python27Full, python27Packages, makeWrapper }: | |||
with { | |||
python = python27Full; |
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.
do you need all of the extra modules? Would it be possible to instead pick only the exact modules you need?
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 far as I know, we only need sqlite3
. Is there a way to construct a python that only has this module? I see the includeModules
boolean, but I don't see an arg to specify a particular set of modules.
I understand why you made it into two separate packages and it kind of makes sense but I don't think it is necessary. While we discourage installing Python packages, installing a package to obtain its binaries/scripts does work. For example, In this case, having just a |
Okay. I like breaking things into pieces as small as possible, but I can appreciate the desire to have fewer packages too. |
d46bec1
to
02eca48
Compare
@FRidh I've combined the packages into one as requested. I still haven't figured out how to remove the dependency on |
@chris-martin see http://nixos.org/nixpkgs/manual/#sec-python |
When I do that, app engine fails to launch.
|
I'm finding that limitations in
|
Because you're not using |
I made a little progress by explicitly adding the sqlite3 module to This PR is working as is. The only remaining issue was that it depends on |
The trouble I've had minimizing the dependency set may be related to #492? |
Ping. This is not a work in progress. If nobody wants to merge this, let me know and I'll sadly close it. |
google-app-engine-sdk = | ||
if !isPy27 | ||
then throw "google-app-engine-sdk requires Python 2.7; it is not supported for interpreter ${python.executable}" | ||
else pkgs.stdenv.mkDerivation 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.
I think you can use mkPythonDerivation
now
# the SDK provides. For example, `dev_appserver.py` becomes | ||
# `google-app-engine-python-dev-appserver`. | ||
for f in $(find $out/lib/${python.libPrefix}/site-packages -maxdepth 1 -type f -regex ".*/[a-z][^/]*.py"); do | ||
makeWrapper $f \ |
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 won't need to call makeWrapper
any more then, but likely just want to create symbolic links
for f in $(find $out/lib/${python.libPrefix}/site-packages -maxdepth 1 -type f -regex ".*/[a-z][^/]*.py"); do | ||
makeWrapper $f \ | ||
$out/bin/google-app-engine-python-$(basename $f | sed s/_/-/ | sed s/\.py//) \ | ||
--prefix PATH : ${pkgs.python27Full}/bin |
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.
in any case, don't use another Python interpreter than the one that's in the package set, so use python
, not pkgs.pythonXX
. Nowadays the default interpreter includes all modules except tkinter
. If you do need tkinter
, add it to the propagatedBuildInputs
.
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.
Google App Engine only works with Python 2.7.9 (and now also 3.5.2).
sha256 = "19qxkxvb7nxs64mdjlxdhzbg16n5qwp8v229lvkpw9w0i8hghpj0"; | ||
}; | ||
|
||
unpackPhase = "unzip $src"; |
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.
pkgs.fetchzip ?
@chris-martin Any updates on this? Really want to use it 😄 |
@ben-z It does work, so you can merge it into your own nixpkgs fork if you want to use it. |
If I understand correctly this sdk doesn't provide any importable module, is therefore not a Python library but an application and thus does not belong in Edit: So @chris-martin explained it:
|
I don't do google cloud stuff anymore, but from what I can tell their Python SDK has been replaced by "google-cloud-sdk" (which we do have a nix package for), so this PR seems obsolete. |
There are two new packages here:
pkgs.python27Packages.google-app-engine-sdk
pkgs.google-app-engine-python-sdk
The first package is just unmodified SDK, useful if all you want to do is import the modules from python code. The second package provides commands to run the app-engine tools (for example,
google-app-engine-python-dev-appserver
to rundev_appserver.py
).nix-build --option build-use-chroot true
or nix.useChroot on NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)