6 Commits

Author SHA1 Message Date
Sybren A. Stüvel
24eaacff84 Declare requests as dependency
It's used by the Shaman interface only, so other BAT functions could be
used without it as well.
2019-04-18 11:47:28 +02:00
Sybren A. Stüvel
5d376a8054 Allow testing with Tox 2019-04-18 11:43:18 +02:00
Sybren A. Stüvel
dabb249e9b Python 3.5 fixes
`typing.Deque` was introduced in Python 3.6, so we can only use it when
we no longer support Blender 2.79.
2019-03-01 15:12:24 +01:00
Sybren A. Stüvel
9074421ec3 Shaman server support
The Shaman server is a file storage system that identifies files by
SHA256sum and file length. BAT can send packs there by only uploading
changed/new files. The BAT pack is reproduced at the Shaman server's
checkout directory by creating symlinks to the files in its file
storage.

Retrying sending files:

When we can defer uploading a file (that is, when we have other files to
upload as well, and we could send the current file at a later moment) we
send an `X-Shaman-Can-Defer-Upload: true` header in the file upload
request. In that case, when someone else is already uploading that file,
a `208 Already Reported` response is sent and the connection is closed.
Python's Requests library unfortunately won't give us that response if
we're still streaming the request, and raise a ConnectionError exception
instead. This exception can mean two things:

- If the `X-Shaman-Can-Defer-Upload: true` header was sent: someone else
  is currently uploading that file, so defer it.
- If that header was not sent: that file is already completely uploaded
  and does not need to be uploaded again.

Instead of retrying each failed file, after a few failures we now just
resend the definition file to get a new list of files to upload, then
send those. This should considerably reduce the number of HTTP calls
when multiple clients are uploading the same set of files.
2019-03-01 14:07:24 +01:00
Sybren A. Stüvel
b52faa6e75 Added Twine to dev requirements
Twine is the recommended way to upload files to PyPi.
2018-11-27 16:06:51 +01:00
Sybren A. Stüvel
504b50178b Moved from requirements.txt to pipenv for package management 2018-07-10 16:02:14 +02:00