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

Add the python package 'us' and update 'jellyfish' #33334

Closed
wants to merge 13 commits into from

Conversation

idontgetoutmuch
Copy link
Contributor

@idontgetoutmuch idontgetoutmuch commented Jan 2, 2018

Motivation for this change

It's a very useful package for doing analyses about the US

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

@idontgetoutmuch
Copy link
Contributor Author

bash-3.2$ nix-shell -p python35Packages.jellyfish --run "python3" -I nixpkgs=/Users/dom/nixpkgs
Python 3.5.4 (default, Dec 22 2017, 19:58:24) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> pkg_resources.get_distribution("jellyfish").version
'0.5.6'

and

bash-3.2$ nix-env -f /Users/dom/nixpkgs -qaP -A python35Packages | grep -i jelly
python35Packages.jellyfish                             python3.5-jellyfish-0.5.6

but

bash-3.2$ nix-shell -p python35Packages.us --run "python3" -I nixpkgs=/Users/dom/nixpkgs
these derivations will be built:
  /nix/store/7h1a989qcms53njd417ysxq9s9wvsfxq-python3.5-us-1.0.0.drv
building path(s) ‘/nix/store/jfp0d1xw15xz9pb0f3k3hh21zz1xr7r0-python3.5-us-1.0.0’
unpacking sources
unpacking source archive /nix/store/zwxy4pf14pxdr78cdzaaas08b05m4j5i-us-1.0.0.tar.gz
source root is us-1.0.0
setting SOURCE_DATE_EPOCH to timestamp 1503347245 of file us-1.0.0/us.egg-info/SOURCES.txt
patching sources
configuring
building
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/us
copying us/unitedstatesofamerica.py -> build/lib/us
copying us/__init__.py -> build/lib/us
copying us/states.py -> build/lib/us
creating build/lib/us/cli
copying us/cli/__init__.py -> build/lib/us/cli
copying us/cli/states.py -> build/lib/us/cli
running egg_info
writing us.egg-info/PKG-INFO
writing entry points to us.egg-info/entry_points.txt
writing dependency_links to us.egg-info/dependency_links.txt
writing requirements to us.egg-info/requires.txt
writing top-level names to us.egg-info/top_level.txt
reading manifest file 'us.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'us.egg-info/SOURCES.txt'
copying us/states.pkl -> build/lib/us
installing to build/bdist.macosx-10.6-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.6-x86_64
creating build/bdist.macosx-10.6-x86_64/wheel
creating build/bdist.macosx-10.6-x86_64/wheel/us
copying build/lib/us/unitedstatesofamerica.py -> build/bdist.macosx-10.6-x86_64/wheel/us
copying build/lib/us/states.pkl -> build/bdist.macosx-10.6-x86_64/wheel/us
copying build/lib/us/__init__.py -> build/bdist.macosx-10.6-x86_64/wheel/us
creating build/bdist.macosx-10.6-x86_64/wheel/us/cli
copying build/lib/us/cli/__init__.py -> build/bdist.macosx-10.6-x86_64/wheel/us/cli
copying build/lib/us/cli/states.py -> build/bdist.macosx-10.6-x86_64/wheel/us/cli
copying build/lib/us/states.py -> build/bdist.macosx-10.6-x86_64/wheel/us
running install_egg_info
Copying us.egg-info to build/bdist.macosx-10.6-x86_64/wheel/us-1.0.0-py3.5.egg-info
running install_scripts
creating build/bdist.macosx-10.6-x86_64/wheel/us-1.0.0.dist-info/WHEEL
creating '/private/tmp/nix-build-python3.5-us-1.0.0.drv-1/us-1.0.0/dist/us-1.0.0-py3-none-any.whl' and adding '.' to it
adding 'us/__init__.py'
adding 'us/states.pkl'
adding 'us/states.py'
adding 'us/unitedstatesofamerica.py'
adding 'us/cli/__init__.py'
adding 'us/cli/states.py'
adding 'us-1.0.0.dist-info/DESCRIPTION.rst'
adding 'us-1.0.0.dist-info/entry_points.txt'
adding 'us-1.0.0.dist-info/metadata.json'
adding 'us-1.0.0.dist-info/top_level.txt'
adding 'us-1.0.0.dist-info/WHEEL'
adding 'us-1.0.0.dist-info/METADATA'
adding 'us-1.0.0.dist-info/RECORD'
installing
/private/tmp/nix-build-python3.5-us-1.0.0.drv-1/us-1.0.0/dist /private/tmp/nix-build-python3.5-us-1.0.0.drv-1/us-1.0.0
Processing ./us-1.0.0-py3-none-any.whl
Collecting jellyfish==0.5.6 (from us==1.0.0)
  Could not find a version that satisfies the requirement jellyfish==0.5.6 (from us==1.0.0) (from versions: )
No matching distribution found for jellyfish==0.5.6 (from us==1.0.0)
builder for ‘/nix/store/7h1a989qcms53njd417ysxq9s9wvsfxq-python3.5-us-1.0.0.drv’ failed with exit code 1
error: build of ‘/nix/store/7h1a989qcms53njd417ysxq9s9wvsfxq-python3.5-us-1.0.0.drv’ failed
/nix/var/nix/profiles/default/bin/nix-shell: failed to build all dependencies

buildPythonPackage rec {
pname = "us";
version = "1.0.0";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

name line needs to be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

pname = "us";
version = "1.0.0";
name = "${pname}-${version}";
doCheck = !stdenv.isDarwin;
Copy link
Member

Choose a reason for hiding this comment

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

why not? Add a comment when disabling tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I just copied an existing derivation - I will remove

{ lib
, buildPythonPackage
, fetchPypi
, stdenv
Copy link
Member

Choose a reason for hiding this comment

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

stdenv is not used so drop it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -9794,20 +9794,19 @@ in {
jabberbot = callPackage ../development/python-modules/jabberbot {};

jedi = callPackage ../development/python-modules/jedi { };

jellyfish = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

jellyfish upgrade needs to be dropped from this PR because it is currently in the staging branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FRidh it seems that us requires jellyfish-0.5.6. Please advise.

Copy link
Member

Choose a reason for hiding this comment

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

I've just merged staging into master, so master has 0.5.6 in it. You can rebase on master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased just now

@idontgetoutmuch
Copy link
Contributor Author

@GrahamcOfBorg @FRidh does this PR work for you because (see my comments above) I run into version issues. Here's the key error message

Collecting jellyfish==0.5.6 (from us==1.0.0)
  Could not find a version that satisfies the requirement jellyfish==0.5.6 (from us==1.0.0) (from versions: )
No matching distribution found for jellyfish==0.5.6 (from us==1.0.0)

@FRidh
Copy link
Member

FRidh commented Jan 2, 2018

@idontgetoutmuch you've defined a function to build a Python package which has jellyfish. However, the function that builds the Python package (buildPythonPackage) needs to know that you want jellyfish to be a dependency. In this case, what is needed is propagatedBuildInputs = [ jellyfish ];.

@idontgetoutmuch
Copy link
Contributor Author

I don't understand why there is a merge conflict since I rebased on master :(

@idontgetoutmuch
Copy link
Contributor Author

I think rebasing again has made matters worse :(

@idontgetoutmuch
Copy link
Contributor Author

I will submit a new PR at some point.

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