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

bitmath: init at 1.3.1.2 #37462

Merged
merged 3 commits into from Apr 10, 2018
Merged

bitmath: init at 1.3.1.2 #37462

merged 3 commits into from Apr 10, 2018

Conversation

Twey
Copy link
Contributor

@Twey Twey commented Mar 20, 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.

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


meta = with stdenv.lib; {
description = ''
module for representing and manipulating file sizes with different prefix
Copy link
Member

Choose a reason for hiding this comment

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

Start with a capital letter. The part within parentheses can be dropped.

};

doCheck = ! isPy36; # progressbar is incompatible with Py3?
buildInputs = if doCheck then [ progressbar mock ] else [ ];
Copy link
Member

Choose a reason for hiding this comment

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

checkInputs

'';
homepage = "https://github.com/tbielawa/bitmath";
license = licenses.mit;
platforms = platforms.all;
Copy link
Member

Choose a reason for hiding this comment

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

should be dropped

@Twey
Copy link
Contributor Author

Twey commented Mar 20, 2018

Thanks!

@Twey
Copy link
Contributor Author

Twey commented Mar 21, 2018

Is this okay?

@dotlambda
Copy link
Member

No, obviously not:
@GrahamcOfBorg build python3.pkgs.progressbar

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: python3.pkgs.progressbar

Partial log (click to expand)

    import progressbar
  File "/tmp/nix-build-python3.6-progressbar-2.3.drv-0/progressbar-2.3/progressbar/__init__.py", line 59, in <module>
    from progressbar.widgets import *
  File "/tmp/nix-build-python3.6-progressbar-2.3.drv-0/progressbar-2.3/progressbar/widgets.py", line 121, in <module>
    class FileTransferSpeed(Widget):
  File "/nix/store/b8gd0cbvkm59x8flbc53bvsvmskyig5a-python3-3.6.4/lib/python3.6/abc.py", line 133, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
ValueError: 'format' in __slots__ conflicts with class variable
builder for ‘/nix/store/c7yfzf813yb515qsf8k3jfsm84bp869x-python3.6-progressbar-2.3.drv’ failed with exit code 1
error: build of ‘/nix/store/c7yfzf813yb515qsf8k3jfsm84bp869x-python3.6-progressbar-2.3.drv’ failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: python3.pkgs.progressbar

Partial log (click to expand)

    import progressbar
  File "/build/progressbar-2.3/progressbar/__init__.py", line 59, in <module>
    from progressbar.widgets import *
  File "/build/progressbar-2.3/progressbar/widgets.py", line 121, in <module>
    class FileTransferSpeed(Widget):
  File "/nix/store/143hazf8s5236kvprxlrgw9fdgzkrg0v-python3-3.6.4/lib/python3.6/abc.py", line 133, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
ValueError: 'format' in __slots__ conflicts with class variable
builder for '/nix/store/nwh88rj5m2v184n7x34jx2va87vgcra9-python3.6-progressbar-2.3.drv' failed with exit code 1
�[31;1merror:�[0m build of '/nix/store/nwh88rj5m2v184n7x34jx2va87vgcra9-python3.6-progressbar-2.3.drv' failed

@FRidh
Copy link
Member

FRidh commented Mar 22, 2018

Seems like it should be disabled for Python 3.

@dotlambda
Copy link
Member

But their setup.py explicitly mentions Python 3: https://github.com/niltonvolpato/python-progressbar/blob/master/setup.py#L50

@Twey
Copy link
Contributor Author

Twey commented Mar 22, 2018

It might just not support Python 3.6 — the last commit was a couple of years ago.
What's the conventional way to say ‘not on Python 3’?
EDIT: Never mind, disabled

@Twey
Copy link
Contributor Author

Twey commented Mar 22, 2018

Apparently it's a known problem. There's a fork with Python 3 support, but it doesn't seem to be on PyPI. There's also progressbar2, which I think is the correct way forward, but it's not quite API-compatible and requires patches to the bitmath test suite.

I've just disabled progressbar for Python 3 for now.

@dotlambda
Copy link
Member

Sorry I forgot about this one.
Please remove the progressbar bump as it is included in #38483.
As soon as that PR is merged, you can rebase on staging and this can be merged.

sha256 = "1k8d1wmxqjc8cqzaixpxf45k6dl1kqhblr0g4wyjl0qa18q8wasd";
};

doCheck = ! isPy36; # progressbar is incompatible with Py3?
Copy link
Member

Choose a reason for hiding this comment

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

Not necessary because progressbar is now disabled on python3.

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 believe it's still necessary, because this package's tests expect progressbar, so if it's disabled on Py3 the tests will fail.

Copy link
Member

Choose a reason for hiding this comment

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

It won't even be built on Python 3, so no tests will be run. Just rebase on staging and you'll see what I mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact it doesn't even get to failing the tests — it will try to load progressbar for checkInputs and immediately fail.

Copy link
Member

Choose a reason for hiding this comment

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

That's what I meant with "it won't be built". Please just remove that doCheck = false line.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Looking at https://github.com/tbielawa/bitmath/blob/master/requirements.txt and https://github.com/tbielawa/bitmath/blob/master/requirements-py3.txt, it seems like progressbar231 is required for Python 2 and progressbar33 for Python 3. At least the latter should be packaged so that tests can be enabled for Python 3.
Btw, please use isPy3k instead of isPy36.

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 must admit, I'm a bit confused about the difference between progressbar, progressbar231, and progressbar33. They seem to be just different versions of the same package? Their description text is exactly the same. Is this a Python convention I'm unaware of?

Copy link
Member

Choose a reason for hiding this comment

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

It's because progressbar has been abandoned by its maintainer. Other people created newer versions, which diverged from each other.

Copy link
Contributor Author

@Twey Twey Apr 10, 2018

Choose a reason for hiding this comment

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

Well, I've packaged them up anyway. bitmath now tests with 3.6; thanks for the pointer!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot!

description = ''
Module for representing and manipulating file sizes with different prefix
notations
'';
Copy link
Member

Choose a reason for hiding this comment

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

Please use " and a single line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The line is 94 characters long if I stuff it all onto a single line; is that okay?

Copy link
Member

Choose a reason for hiding this comment

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

It's okay for me. I don't think there's a general limit of 80 characters for nixpkgs.

Module for representing and manipulating file sizes with different prefix
notations
'';
homepage = "https://github.com/tbielawa/bitmath";
Copy link
Member

Choose a reason for hiding this comment

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

no quotes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.progressbar231 python2.pkgs.progressbar33 python3.pkgs.progressbar33 python2.pkgs.bitmath python3.pkgs.bitmath

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python2.pkgs.progressbar231, python2.pkgs.progressbar33, python3.pkgs.progressbar33, python2.pkgs.bitmath, python3.pkgs.bitmath

Partial log (click to expand)

query device capacity works on a happy Linux host ... ok
test_query_device_capacity_mac_everything_is_wonderful (tests.test_query_device_capacity.TestQueryDeviceCapacity)
query device capacity works on a happy Mac OS X host ... ok
test_query_device_capacity_non_posix_system_fails (tests.test_query_device_capacity.TestQueryDeviceCapacity)
query device capacity fails on a non-posix host ... ok

----------------------------------------------------------------------
Ran 211 tests in 0.025s

OK

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python2.pkgs.progressbar231, python2.pkgs.progressbar33, python3.pkgs.progressbar33, python2.pkgs.bitmath, python3.pkgs.bitmath

Partial log (click to expand)

listdir: symbolic links in tree are followed ... ok
test_listdir_symlinks_follow_relpath_false (tests.test_file_size.TestFileSize)
listdir: symlinks followed, absolute paths are returned ... ok
test_listdir_symlinks_nofollow (tests.test_file_size.TestFileSize)
listdir: symbolic links in tree not followed ... ok

----------------------------------------------------------------------
Ran 211 tests in 0.184s

OK

inherit pname version;
sha256 = "0j0ifxk87xz3wkyacxaiqygghn27wwz6y5pj9k8j2yq7n33fbdam";
};

Copy link
Member

Choose a reason for hiding this comment

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

# no tests implemented
doCheck = false;

inherit pname version;
sha256 = "1zvf6zs5hzrc03p9nfs4p16vhilqikycvv1yk0pxn8s07fdhvzji";
};

Copy link
Member

Choose a reason for hiding this comment

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

# no tests implemented
doCheck = false;

@@ -11480,6 +11482,9 @@ in {

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

progressbar231 = callPackage ../development/python-modules/progressbar231 { };
progressbar33 = callPackage ../development/python-modules/progressbar33 { };
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 an empty line.

@Twey
Copy link
Contributor Author

Twey commented Apr 10, 2018

Done!

@dotlambda dotlambda merged commit 1bf566e into NixOS:staging Apr 10, 2018
@dotlambda
Copy link
Member

Thanks a lot!

@Twey Twey deleted the python-bitmath branch April 10, 2018 13:24
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