Skip to content

Add support for Python3 - #3

Open
shalakhin wants to merge 5 commits into
jzempel:masterfrom
shalakhin:master
Open

Add support for Python3#3
shalakhin wants to merge 5 commits into
jzempel:masterfrom
shalakhin:master

Conversation

@shalakhin

Copy link
Copy Markdown

I found this package to be quite good and decided to help adding support for Python3.

  • updated README to be Markdown formatted
  • setup.py script considers python2/3
  • tests.py are python2/3 compliant
  • config.py uses imports specific for each of python versions (i.e. urlparse is urllib.parse in Python3 etc.).
  • suds-py3 is used for Python 3 version and suds is left to be used for Python 2

@jzempel

jzempel commented Nov 3, 2014

Copy link
Copy Markdown
Owner

@OShalakhin, thanks. I pulled your request into a branch with some changes including fixes to get python2 working again. Please check it out. I had looked at doing this in the past and came to the conclusion that suds was in no shape to get py3 working. To be honest, I don't believe suds-py3 is ready, either. I tried installing from PyPI and get NameError: name 'unicode' is not defined when I try to run tests. Then I installed directly from github and get ImportError: cannot import name 'Object' on install (either setup.py or pip).

We'll probably have to sit on this until there is a reliable py3 solution for suds.

@shalakhin

Copy link
Copy Markdown
Author

I'll check suds-py3 one more time. Maybe it makes sense to port suds from the ground or at least with 2to3. But I haven't get any errors while made request. I think as suds-py3 has 1.0.0.0 version it should be pretty stable but I haven't compared it to suds.

@jzempel

jzempel commented Nov 3, 2014

Copy link
Copy Markdown
Owner

Be sure to run $ python setup.py test (configured for both python2 & python3) to see if the test cases are still valid with these changes. This is where I started running into problems with suds-py3. For example, 'unicode' is not defined problems here.

@shalakhin

Copy link
Copy Markdown
Author

@jzempel OK. I'll test it. Another question is how to launch tests as just python setup.py test fails without my commits. Should I provide some additional environment variables?

@shalakhin

Copy link
Copy Markdown
Author

No problem. I found how to test it. I had to create tests.cfg in the fedex folder.

@shalakhin

Copy link
Copy Markdown
Author

@jzempel What do you think about suds-jurko? It seems to be the fork from Fedora suds and it is actively developed and supports both python2 and python3.

Will check it.

@jzempel

jzempel commented Nov 4, 2014

Copy link
Copy Markdown
Owner

I had problems with suds-jurko in the past ... can't remember exactly what.

@shalakhin

Copy link
Copy Markdown
Author

@jzempel During testing with suds-jurko I found package_id is:

(TrackPackageIdentifier){
   Type = "TRACKING_NUMBER_OR_DOORTAG"
   Value = "794622912447"
 }

When it is passed to TrackingService.track(package_id) it waits for:

fedex/fedex/services/tracking.py line 37

kwargs["PackageIdentifier"] = package_id

What does it mean via FedEx API?

@jzempel

jzempel commented Nov 18, 2014

Copy link
Copy Markdown
Owner

@OShalakhin, not sure I'm following your question. But if you look at the wsdl you'll see that the PackageIdentifier element is of type TrackPackageIdentifier.

@shalakhin

Copy link
Copy Markdown
Author

@jzempel I got tests running successfully with suds-jurko. But commenting one part of the code. I asked guys working on suds-jurko to give me feedback how we'll deal with this.

https://bitbucket.org/jurko/suds/issue/70/bug-with-fedex-package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants