Open giampaolo opened 10 years ago
Not planning on doing immediately though its in the roadmap. We mostly use it for the tryton magento integration and when tryton moves to python 3 this module should too. However, happy to accept a PR if you would like to implement it :)
running 2to3 should fix most issues I guess
With the following patch I'm able to install magento on Python 3.4. It uses "suds-jurko" instead of "suds" as apparently "suds" has not been ported yet and "suds-jurko" is the only viable alternative so far.
diff --git a/magento/api.py b/magento/api.py
index dc7c085..bda6977 100644
--- a/magento/api.py
+++ b/magento/api.py
@@ -9,9 +9,14 @@
:license: AGPLv3, see LICENSE for more details
'''
+import sys
+
PROTOCOLS = []
try:
- from xmlrpclib import ServerProxy
+ if sys.version_info <= (2, ):
+ from xmlrpclib import ServerProxy
+ else:
+ from xmlrpc.client import ServerProxy
except ImportError:
pass
else:
diff --git a/setup.py b/setup.py
index 16a1c32..ba9a7cb 100644
--- a/setup.py
+++ b/setup.py
@@ -8,10 +8,11 @@
:license: AGPLv3, see LICENSE for more details
'''
+
import os
from setuptools import setup
-execfile(os.path.join('magento', 'version.py'))
+exec(open(os.path.join('magento', 'version.py')).read())
setup(
name = 'magento',
@@ -26,15 +27,17 @@ setup(
zip_safe=False,
platforms='any',
install_requires=[
- 'suds>=0.3.9',
+ 'suds-jurko',
],
classifiers=[
'Development Status :: 6 - Mature',
'Environment :: Web Environment',
'Intended Audience :: Developers',
- 'License :: OSI Approved :: GNU Affero General Public License v3',
+ 'License :: OSI Approved :: GNU Affero General Public License v3',
'Operating System :: OS Independent',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
This patch seems to work perfectly. Any chance we could get this added to the repo? I'd like to be able to create a submodule out of your repo.
Can you send a patch to https://github.com/fulfilio/python-magento ? not maintained here anymore.
This is currently missing. Any plan to migrate magento to Python 3?