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

pythonPackages.patator: init at 0.7 #34642

Merged
merged 5 commits into from Mar 19, 2018
Merged

pythonPackages.patator: init at 0.7 #34642

merged 5 commits into from Mar 19, 2018

Conversation

y0no
Copy link

@y0no y0no commented Feb 5, 2018

Motivation for this change
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.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

name is not necessary for buildPython* anymore. Please remove it

dnspython
IPy
pysnmp
pyasn1
Copy link
Member

Choose a reason for hiding this comment

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

indentation

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I fix this in next commit =)

};
IPy = callPackage ../development/python-modules/IPy { };
# Alias to remove
ipy = callPackage ../development/python-modules/IPy { };
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with the old name? Most attributes in Nixpkgs are lowercase.

Copy link
Author

Choose a reason for hiding this comment

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

Don't know what's better between the real name (as a lots of packages), or all in lowercase. I think, in pypi you can have two different packages with the same name except but different capitalized letters.

Copy link
Member

Choose a reason for hiding this comment

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

No, that's not true. The attributes are preferably the normalized names, so ipy in this case.
https://www.python.org/dev/peps/pep-0503/#normalized-names

};

checkPhase = ''
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.2/client64/lib
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

If we don't do that, cx_Oracle don't find Oracle libs :/

Copy link
Member

Choose a reason for hiding this comment

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

You are referring to a path outside the store. That is incorrect. Furthermore, paths to libraries are better hardcoded. Also, something should run in the checkPhase.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, Is there a good way to handle the path?

sha256 = "335e432e6cc591437e316ba8c1da935484ca39fc79e595ccf60ccd9166e965f1";
};

propagatedBuildInputs = with python3Packages; [
Copy link
Member

Choose a reason for hiding this comment

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

Please add the dependencies as arguments instead of python3Packages.

Copy link
Author

Choose a reason for hiding this comment

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

Why not. What's the difference ?

buildPythonPackage rec {
pname = "IPy";
version = "0.83";
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.

The name attribute is added by buildPython* and should therefore be removed.

buildPythonPackage rec {
pname = "ajpy";
version = "0.0.2";
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.

The name attribute is added by buildPython* and should therefore be removed.

buildPythonPackage rec {
pname = "cx_Oracle";
version = "6.1";
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.

The name attribute is added by buildPython* and should therefore be removed.

};

checkPhase = ''
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.2/client64/lib
Copy link
Member

Choose a reason for hiding this comment

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

You are referring to a path outside the store. That is incorrect. Furthermore, paths to libraries are better hardcoded. Also, something should run in the checkPhase.

buildPythonPackage rec {
pname = "mysqlclient";
version = "1.3.12";
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.

The name attribute is added by buildPython* and should therefore be removed.

buildPythonPackage rec {
pname = "patator";
version = "0.7";
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.

The name attribute is added by buildPython* and should therefore be removed.

@@ -0,0 +1,35 @@
{ stdenv, buildPythonPackage, isPy3k, python3Packages, fetchPypi }:
Copy link
Member

Choose a reason for hiding this comment

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

Don't pass in the package set; instead pass in individual requirements.

};
IPy = callPackage ../development/python-modules/IPy { };
# Alias to remove
ipy = callPackage ../development/python-modules/IPy { };
Copy link
Member

Choose a reason for hiding this comment

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

No, that's not true. The attributes are preferably the normalized names, so ipy in this case.
https://www.python.org/dev/peps/pep-0503/#normalized-names

@y0no
Copy link
Author

y0no commented Feb 6, 2018

Hope the changes requested are well fixed.

@dotlambda
Copy link
Member

You're still not running any checks in the checkPhase.
Also, please squash the commits.

@y0no
Copy link
Author

y0no commented Feb 6, 2018

Woops you are right. In fact, it seems that cx_Oracle tests need an Oracle database running in background. I think it will be better to pass the test if we don't want an error

@dotlambda
Copy link
Member

Yes, if it needs a database, then you can set doCheck = false. But don't forget to add a comment with the reason.

@dotlambda
Copy link
Member

Now, it would be nice if you replaced your 11 commits by 5, one for each package.
And please name your commits according to CONTRIBUTING.md, e.g. pythonPackages.mysqlclient: init at 1.3.12.

@y0no y0no force-pushed the add_patator branch 2 times, most recently from 42846ea to 537afb8 Compare February 6, 2018 10:37
@y0no
Copy link
Author

y0no commented Feb 6, 2018

Ok, I think it's good now.

@y0no y0no changed the title patator: init at 0.7 pythonPackages.patator: init at 0.7 Feb 6, 2018
@dotlambda
Copy link
Member

Very nice. Thank you! I'll try to build them...

@GrahamcOfBorg build python2.pkgs.ipy python3.pkgs.ipy
@GrahamcOfBorg build python2.pkgs.ajpy python3.pkgs.ajpy
@GrahamcOfBorg build python2.pkgs.cx_oracle python3.pkgs.cx_oracle
@GrahamcOfBorg build python2.pkgs.mysqlclient python3.pkgs.mysqlclient
@GrahamcOfBorg build python3.pkgs.patator

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

Package ‘oracle-instantclient-12.2.0.1.0’ in /var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/development/libraries/oracle-instantclient/default.nix:80 has an unfree license (‘unfree’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

reading manifest file 'ajpy.egg-info/SOURCES.txt'
writing manifest file 'ajpy.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/71brd1hj1qv93dn3cnl6lgh07cphsfhs-python2.7-ajpy-0.0.2
/nix/store/sc49lckzp43v71qw1pkqqdmzygdk5s4b-python3.6-ajpy-0.0.2

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

Package ‘oracle-instantclient-12.2.0.1.0’ in /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/rbvermaa-spot/pkgs/development/libraries/oracle-instantclient/default.nix:80 has an unfree license (‘unfree’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

running install tests
make: Nothing to be done for 'test'.
make: Nothing to be done for '/nix/store/dbmw100gg8cpyg07hc1cf188ad1h6mbr-python2.7-IPy-0.83'.
patching script interpreter paths in /nix/store/2rnp1b00f6d28bvq4kg1nh5jzaxng4zj-python3.6-IPy-0.83
checking for references to /tmp/nix-build-python3.6-IPy-0.83.drv-0 in /nix/store/2rnp1b00f6d28bvq4kg1nh5jzaxng4zj-python3.6-IPy-0.83...
running install tests
make: Nothing to be done for 'test'.
make: Nothing to be done for '/nix/store/2rnp1b00f6d28bvq4kg1nh5jzaxng4zj-python3.6-IPy-0.83'.
/nix/store/dbmw100gg8cpyg07hc1cf188ad1h6mbr-python2.7-IPy-0.83
/nix/store/2rnp1b00f6d28bvq4kg1nh5jzaxng4zj-python3.6-IPy-0.83

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

Package ‘oracle-instantclient-12.2.0.1.0’ in /var/lib/gc-of-borg/.nix-test-rs/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/development/libraries/oracle-instantclient/default.nix:80 has an unfree license (‘unfree’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83
strip is /nix/store/xmpjypwjmp2qi1chs5kr0hacnh161ls4-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83/lib
patching script interpreter paths in /nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83
checking for references to /build in /nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83...
running install tests
make: Nothing to be done for 'test'.
make: Nothing to be done for '/nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83'.
/nix/store/3zfxf3fhlpk531140g3lmvix1w7ryspd-python2.7-IPy-0.83
/nix/store/g3m1xicpgibmggzz90si1f2w994sw18f-python3.6-IPy-0.83

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

writing manifest file 'mysqlclient.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-3.6/_mysql.cpython-36m-x86_64-linux-gnu.so -> 

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/kav2cz1fqvyfff1ljbzzy38qm12khp1b-python2.7-mysqlclient-1.3.12
/nix/store/6va306zj54kfj4196pli6lwgf3k50dy2-python3.6-mysqlclient-1.3.12

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

writing top-level names to ajpy.egg-info/top_level.txt
reading manifest file 'ajpy.egg-info/SOURCES.txt'
writing manifest file 'ajpy.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
error: build of '/nix/store/4ibpyxf8c0c6ml9hnypa723lgsrcxayx-python2.7-ajpy-0.0.2.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

Package ‘oracle-instantclient-12.2.0.1.0’ in /var/lib/gc-of-borg/nix-test-rs-3/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-3/pkgs/development/libraries/oracle-instantclient/default.nix:80 has an unfree license (‘unfree’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

writing manifest file 'mysqlclient.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-aarch64-3.6/_mysql.cpython-36m-aarch64-linux-gnu.so ->

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/g6mknw0053ila77sfid4vcb4qvb891m0-python2.7-mysqlclient-1.3.12
/nix/store/j0mp03yghzw1dhwdw71x8qnnyqxnqy5m-python3.6-mysqlclient-1.3.12

@dotlambda
Copy link
Member

Ran 0 tests in 0.000s

Do ajpy and mysqlclient provide tests? If so, you should specify the appropriate checkPhase. Otherwise, please set doCheck = false and add a comment that there are no tests.

Regarding ipy, the tests don't seem to run there as well. Do you have an idea why?
Maybe use nosetests in the checkPhase? See https://github.com/autocracy/python-ipy/blob/master/.travis.yml
Another idea would be to use make -B.

@y0no
Copy link
Author

y0no commented Feb 6, 2018

Ajpy, patator doesn't seems to got tests.
Concerning mysqlclient, it's like cx_Oracle, we need a database to run the tests.
Finally, I have fixed the tests for IPy. As you mentionned, the tests are run with nose.

@FRidh
Copy link
Member

FRidh commented Feb 9, 2018

A dependency can't be built:

nix build python3.pkgs.cx_oracle -f .
builder for '/nix/store/6k80zw21b9chd00lqya0vfj03y8s91xw-oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm.drv' failed to produce output path '/nix/store/3ly42sshg74lqk1vw2fksagq6zd3sz0g-oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm'
cannot build derivation '/nix/store/1g1bbai4y39zx3b4y26c2waip8ymygdf-oracle-instantclient-12.2.0.1.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/pqy6859y8xs0gkd5758faz28aff6300d-python3.6-cx_Oracle-6.1.drv': 1 dependencies couldn't be built
[0 built (1 failed)]
error: build of '/nix/store/pqy6859y8xs0gkd5758faz28aff6300d-python3.6-cx_Oracle-6.1.drv' failed

@y0no
Copy link
Author

y0no commented Feb 9, 2018

Can this error be made because of oracle-instantclient license ? It correctly build on my laptop when oracle-instantclient is installed (package that I don't handle)

@FRidh
Copy link
Member

FRidh commented Feb 9, 2018

Right, it needs prefetching. That important part was not visible in the nix build output. You can ignore it.

@y0no
Copy link
Author

y0no commented Feb 9, 2018

So do I have to do something else to get the package merged ?

@dotlambda
Copy link
Member

@FRidh This looks fine, doesn't it? I did however not test if it works.

@dotlambda
Copy link
Member

ping @FRidh

@dotlambda
Copy link
Member

@y0no Can you rebase on master?
@FRidh Any objections against merging?

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

4 participants