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

gensim: added Gensim 2.1.0 and related tools #25804

Closed
wants to merge 7 commits into from

Conversation

aptlin
Copy link

@aptlin aptlin commented May 15, 2017

Motivation for this change

Making NLP analysis easier with Nix.

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
    • Linux
  • 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.

@mention-bot
Copy link

@sdll, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zimbatm, @zraexy, @vcunat and @FRidh to be potential reviewers.

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Looks good. Some minor changes are needed. I haven't tested the PR though.

sha256 = "1wn7bji9b80wn1yggmh7a0dlwzdjr6cp24x4p33j2rf29lxnm2kc";
};

propagatedBuildInputs = [
Copy link
Member

Choose a reason for hiding this comment

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

indentation

morfessor
];

checkPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

Note that currently this is the default checkPhase so its not necessary. No need to change it though.

};

propagatedBuildInputs = [ six ];

Copy link
Member

Choose a reason for hiding this comment

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

meta.license?

, msgpack
, six
}:
with rec{
Copy link
Member

Choose a reason for hiding this comment

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

use let ... in instead

, moto
, responses
}:
with rec{
Copy link
Member

Choose a reason for hiding this comment

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

use let ... in instead


# fails to find a test.support module
doCheck = false;
};
Copy link
Member

Choose a reason for hiding this comment

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

meta.license?


morfessor = callPackage ../development/python-modules/morfessor.nix { };

gensim = callPackage ../development/python-modules/gensim.nix { };
Copy link
Member

Choose a reason for hiding this comment

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

even though the order of the attributes in this file is a mess, do try to stick to it.

Copy link
Author

@aptlin aptlin May 15, 2017

Choose a reason for hiding this comment

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

@FRidh, do you want me to order them alphabetically? They are in the order of the commits. Unfortunately, I did not know all the missing dependencies at the beginning, so I propose to leave the order as it is now.

Copy link
Member

Choose a reason for hiding this comment

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

Try to find for each attribute an appropriate place in the quasi-alphabetically ordered attributes

Copy link
Author

Choose a reason for hiding this comment

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

What is the point, @FRidh, if they are all related to one package -- gensim? Spreading them over the entire file would only increase the entropy, it seems.

@FRidh FRidh added 6.topic: python 8.has: package (new) This PR adds a new package labels May 15, 2017
@aptlin
Copy link
Author

aptlin commented May 15, 2017

Thank you very much for the review, @FRidh, I have updated the files with the changes requested.

@FRidh
Copy link
Member

FRidh commented May 15, 2017

Oh, I now noticed one aspect that has to be fixed. Your expressions are in files named after the package. Instead, the rule is to put them in a folder, named after the package.

@aptlin
Copy link
Author

aptlin commented May 15, 2017

But there are other packages, like numpy, which are not in their own folder -- should they also be, in principle, moved to their own folders?

@FRidh
Copy link
Member

FRidh commented May 15, 2017

But there are other packages, like numpy, which are not in their own folder -- should they also be, in principle, moved to their own folders?

Yes, they should.

@aptlin
Copy link
Author

aptlin commented May 15, 2017

@FRidh, I have moved all the recipes related to the PR.

@aptlin
Copy link
Author

aptlin commented May 17, 2017

@FRidh, Travis CI on OS X seems to fail due to the following error:

pyemd/emd.cpp:458:10: fatal error: 'vector' file not found

Do you think we should try to fix it by specifying GCC_INSTALL_HOME?
See a similar question discussed here: harvard-acc/LLVM-Tracer#7

I have also updated the recipe for smart_open, which build failed because it's dependency, boto, is tailored to Python2 and decided to try to fix it by replacing boto with boto3.

I have also changed the doCheck boolean for selectors in the recipy for pyro4.

@aptlin aptlin force-pushed the gensim-2.1.0 branch 2 times, most recently from 61aba52 to 277f1f5 Compare May 17, 2017 10:21
@FRidh FRidh self-assigned this May 17, 2017
@aptlin aptlin force-pushed the gensim-2.1.0 branch 2 times, most recently from eb9486f to 3b44a28 Compare May 17, 2017 11:07
@aptlin
Copy link
Author

aptlin commented May 17, 2017

@FRidh, the problem with importing urllib2 persists in the Travis CI build of boto for GNU/Linux (I am not sure why boto and boto3 are built). Shall I disable checking of boto in python3 with doCheck = isPy27; in a separate PR?

@FRidh
Copy link
Member

FRidh commented May 17, 2017

@sdll just ignore Travis, we don't rely on it.

Currently I get

$ nix-build -A python.pkgs.gensim
...
/build/gensim-2.1.0/dist /build/gensim-2.1.0
Processing ./gensim-2.1.0-cp27-cp27mu-linux_x86_64.whl
Requirement already satisfied: scipy>=0.7.0 in /nix/store/xg1v4g2hzcvj7raakaf1gvxhsq3l95rb-python2.7-scipy-0.18.1/lib/python2.7/site-packages (from gensim==2.1.0)
Requirement already satisfied: six>=1.5.0 in /nix/store/m0apm5s8w43q8r9q9ciz3xj6vvxj5xci-python2.7-six-1.10.0/lib/python2.7/site-packages (from gensim==2.1.0)
Requirement already satisfied: smart-open>=1.2.1 in /nix/store/0l6jv4ip60gk8wvydsiki4a3ys09jr46-python2.7-smart_open-1.5.2/lib/python2.7/site-packages (from gensim==2.1.0)
Requirement already satisfied: numpy>=1.3 in /nix/store/2r7iirb4h95rnvvf4cns7471gkibnpsv-python2.7-numpy-1.11.3/lib/python2.7/site-packages (from gensim==2.1.0)
Collecting boto>=2.32 (from smart-open>=1.2.1->gensim==2.1.0)
  Could not find a version that satisfies the requirement boto>=2.32 (from smart-open>=1.2.1->gensim==2.1.0) (from versions: )
No matching distribution found for boto>=2.32 (from smart-open>=1.2.1->gensim==2.1.0)

builder for ‘/nix/store/6md6n0vqc9r58zfm8zq7p6d6am1349n0-python2.7-gensim-2.1.0.drv’ failed with exit code 1
error: build of ‘/nix/store/6md6n0vqc9r58zfm8zq7p6d6am1349n0-python2.7-gensim-2.1.0.drv’ failed

@aptlin
Copy link
Author

aptlin commented May 17, 2017

@FRidh, so we need to use boto then, not boto3, sorry for the confusion -- I checked only if smart_open builds fine. I have reverted to boto. Could you please try again?

@wldhx
Copy link
Member

wldhx commented Jun 7, 2017

@FRidh Is there anything preventing this from being merged? I just rebased this and built gensim locally with no issues.

@jyp
Copy link
Contributor

jyp commented Jun 22, 2017

I've done some overlapping changes in PR #26525. Perhaps you can rebase your work on master?

@FRidh
Copy link
Member

FRidh commented Aug 13, 2017

Closing because #26525 was merged. If there are other changes you would like to get in, please open a new PR.

@FRidh FRidh closed this Aug 13, 2017
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants