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.fritzconnection: init at 0.6.5 #33878

Merged
merged 1 commit into from Jan 18, 2018

Conversation

dotlambda
Copy link
Member

Motivation for this change

Does anyone have an idea why the substituteInPlace is only necessary for Python 3?

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.

@dotlambda
Copy link
Member Author

Whithout the prePatch block, I get the following error on Python 3:

======================================================================
ERROR: test (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test
Traceback (most recent call last):
  File "/nix/store/4wqa1whb42khic67rv9jgip30nxmaii8-python3-3.6.4/lib/python3.6/unittest/loader.py", line 153, in loadTestsFromName
    module = __import__(module_name)
  File "/tmp/nix-build-python3.6-fritzconnection-0.6.5.drv-0/fritzconnection-0.6.5/fritzconnection/test.py", line 16, in <module>
    from fritzconnection import (
ImportError: cannot import name 'FritzXmlParser'

But as it is, building and testing works fine on both, Python 2 and 3.

@FRidh
Copy link
Member

FRidh commented Jan 17, 2018

Interesting. There is a package called fritzconnection, and it has a module inside it called fritzconnection. The module contains the FritzXmlParser class. This class is not exposed by the package, so the only way to get it is to import from the module directly.

Packages and modules in the current folder take precedence over PYTHONPATH, so in this case it will load the fritzconnection module first. However, in Python 3 such an import is not allowed, and so it will load the package instead and fail. Using .fritzconnection works because this is a relative import.

To conclude, upstream likely does not test against Python 3.

description = "Python-Tool to communicate with the AVM FritzBox using the TR-064 protocol";
homepage = https://bitbucket.org/kbr/fritzconnection;
license = licenses.mit;
platforms = platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for setting this?

Copy link
Member Author

Choose a reason for hiding this comment

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

No particular. Does it hurt?

Copy link
Member

Choose a reason for hiding this comment

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

It is set correctly by buildPython* already. It should only be set in case a certain specific platform is not supported.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good to know :)
I've removed it

@dotlambda
Copy link
Member Author

Thanks for the explanation, @FRidh. I'll open an upstream issue asap.

@dotlambda
Copy link
Member Author

See https://bitbucket.org/kbr/fritzconnection/pull-requests/13.
Since the project doesn't seem very active, I don't think this will get merged any time soon.

@FRidh FRidh merged commit aee7a0e into NixOS:master Jan 18, 2018
@dotlambda dotlambda deleted the fritzconnection branch January 18, 2018 11:47
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