openSUSE / py2pack

Generate distribution packages from PyPI
Apache License 2.0
69 stars 40 forks source link

py2pack does not work anymore since the PyPI XMLRPC api has been switched off #140

Closed lemmy04 closed 3 years ago

lemmy04 commented 3 years ago

Using py2pack fails:

lemmy@akari:~> py2pack search pygame searching for package pygame... Traceback (most recent call last):

[...]

xmlrpclib.Fault: <Fault -32500: "RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.">

I understand there is already a fix in the current sources, but no release of it yet? https://github.com/openSUSE/py2pack/pull/135

bnavigator commented 3 years ago

There are more uses of the XMLRPC API in py2pack than what has been removed by #135. See #139.

lemmy04 commented 3 years ago

I see... so the obvious question remains, what can be done to make py2pack work again, and whats the timeframe?

bnavigator commented 3 years ago

Just don't use search.

coogor commented 3 years ago

ROFL .... thats the little sister of 'dont use it'

bnavigator commented 3 years ago

py2pack fetch and generate still work. That's the main functionality of py2pack. Last time I checked, there is no good API equivalent for search not using XMLRPC.

ecsgh commented 3 years ago

py2pack fetch and generate still work. That's the main functionality of py2pack. Last time I checked, there is no good API equivalent for search not using XMLRPC.

No it doesn't.

First after install with: sudo zypper in pyton-py2pack as descripted in Wiki:

Traceback (most recent call last): File "/usr/bin/py2pack", line 6, in from py2pack import main File "/usr/lib/python2.7/site-packages/py2pack/init.py", line 28, in import requests ImportError: No module named requests

After install of module requests with: sudo zypper in python-requests

Traceback (most recent call last): File "/usr/bin/py2pack", line 6, in from py2pack import main File "/usr/lib/python2.7/site-packages/py2pack/init.py", line 33, in import xmlrpc

And this python module can i not found. I use Leap 15.2.

bnavigator commented 3 years ago

Yes it does.

  1. Even in Leap you should use python3 instead of python2. Python 2 is EOL. Most recent py2pack removed support for Python 2
  2. Your installation just first lacked (python2) python-requests and the the xmlrpc module because it could not be found in python 2.7
  3. Your error does not have to do with PyPI XMLRPC api being disabled by PyPI.

Side note:

% pip search py2pack                                                                                                       [0]
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/search.py", line 60, in run
    pypi_hits = self.search(query, options)
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/search.py", line 80, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib64/python3.9/xmlrpc/client.py", line 1116, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python3.9/xmlrpc/client.py", line 1456, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.9/site-packages/pip/_internal/network/xmlrpc.py", line 45, in request
    return self.parse_response(response.raw)
  File "/usr/lib64/python3.9/xmlrpc/client.py", line 1348, in parse_response
    return u.close()
  File "/usr/lib64/python3.9/xmlrpc/client.py", line 662, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: "RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.">
ecsgh commented 3 years ago

Yes it does. Sorry. No.

1. Even in Leap you should use python3 instead of python2. Python 2 is EOL. Most recent py2pack removed support for Python 2

I know and i wonder. Look in openSUSE Wiki: https://en.opensuse.org/openSUSE:Packaging_Python "First of all, you can search for it with py2pack, which can be found in the python-py2pack package and download the source tarball automatically with it if you found the correct module: "

And also in README.rst from py2pack stand:

sudo zypper install python-py2pack

So you should change the Readme and Wiki.

2. Your installation just first lacked (python2) python-requests and the the xmlrpc module because it could not be found in python 2.7

This have i write.

3. Your error does not have to do with PyPI XMLRPC api being disabled by PyPI.

I know also.

And python3-py2pack also not run:

Traceback (most recent call last): File "/usr/bin/py2pack", line 10, in sys.exit(main()) File "/usr/lib/python3.6/site-packages/py2pack/init.py", line 365, in main args.func(args) File "/usr/lib/python3.6/site-packages/py2pack/init.py", line 232, in generate fetch_data(args) File "/usr/lib/python3.6/site-packages/py2pack/init.py", line 273, in fetch_data args.fetched_data = pypi_json(args.name, args.version) File "/usr/lib/python3.6/site-packages/py2pack/init.py", line 58, in pypi_json return r.json() File "/usr/lib/python3.6/site-packages/requests/models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib64/python3.6/site-packages/simplejson/init.py", line 518, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 7 column 1 (char 6)

bnavigator commented 3 years ago

I know and i wonder. Look in openSUSE Wiki: https://en.opensuse.org/openSUSE:Packaging_Python "First of all, you can search for it with py2pack, which can be found in the python-py2pack package and download the source tarball automatically with it if you found the correct module: "

It's a wiki. If you know, change it!

And also in README.rst from py2pack stand:

sudo zypper install python-py2pack

Create a PR!

  1. Your error does not have to do with PyPI XMLRPC api being disabled by PyPI.

I know also.

Then why do you comment in #140, "py2pack does not work anymore since the PyPI XMLRPC api has been switched off" ?

> And python3-py2pack also not run:
> 
> Traceback (most recent call last):
> File "/usr/bin/py2pack", line 10, in
> sys.exit(main())
> File "/usr/lib/python3.6/site-packages/py2pack/**init**.py", line 365, in main
> args.func(args)
> File "/usr/lib/python3.6/site-packages/py2pack/**init**.py", line 232, in generate
> fetch_data(args)
> File "/usr/lib/python3.6/site-packages/py2pack/**init**.py", line 273, in fetch_data
> args.fetched_data = pypi_json(args.name, args.version)
> File "/usr/lib/python3.6/site-packages/py2pack/**init**.py", line 58, in pypi_json
> return r.json()
> File "/usr/lib/python3.6/site-packages/requests/models.py", line 900, in json
> return complexjson.loads(self.text, **kwargs)
> File "/usr/lib64/python3.6/site-packages/simplejson/**init**.py", line 518, in loads
> return _default_decoder.decode(s)
> File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
> obj, end = self.raw_decode(s)
> File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
> return self.scan_once(s, idx=_w(s, idx).end())
> simplejson.errors.JSONDecodeError: Expecting value: line 7 column 1 (char 6)

Now you are on to something. Since this is obviously still not a problem of the XMLRPC API, but something with (your?) simplejson library. File a separate issue or a bug at bugzilla.opensuse.org against Leap 15.2.

thesp0nge commented 3 years ago

It should be fixed now