pypa / flit

Simplified packaging of Python modules
https://flit.pypa.io/
BSD 3-Clause "New" or "Revised" License
2.16k stars 134 forks source link

Gracefully fail on `register` #85

Open Carreau opened 8 years ago

Carreau commented 8 years ago

It is apparently deprecated when uploading to warehouse:

$ flit register
Using repository at https://upload.pypi.io/legacy/                                                                                   I-flit.upload
Starting new HTTPS connection (1): upload.pypi.io                                                       I-requests.packages.urllib3.connectionpool
Traceback (most recent call last):
  File "/Users/bussonniermatthias/.local/bin/flit", line 4, in <module>
    main()
  File "/Users/bussonniermatthias/.local/lib/python3.5/site-packages/flit/__init__.py", line 104, in main
    register(meta, args.repository)
  File "/Users/bussonniermatthias/.local/lib/python3.5/site-packages/flit/upload.py", line 145, in register
    resp.raise_for_status()
  File "/Users/bussonniermatthias/anaconda/lib/python3.5/site-packages/requests/models.py", line 837, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 410 Client Error: This API is no longer supported, instead simply upload the file. for url: https://upload.pypi.io/legacy/
takluyver commented 8 years ago

I think it might make sense to distinguish between warehouse and legacy pypi in flit.

However, that failure already seems fairly graceful to me. The error message tells you what to do. We could hide the traceback, I guess.