Skip to content

Commit

Permalink
Unpin msgpack version
Browse files Browse the repository at this point in the history
Remove Python 2.7 to remove the msgpack encoding ambiguity issue.
Remove Python 3.4 support just because it's dead.

fixes #171

Signed-off-by: Arcadiy Ivanov <[email protected]>
  • Loading branch information
arcivanov committed Mar 11, 2021
1 parent d1b81ba commit 0568a26
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 35 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
sudo: false
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- pypy
- "3.9"
- pypy3
- nightly
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
Expand All @@ -27,7 +25,7 @@ deploy:
secure: CpNaj4F3TZvpP1aSJWidh/XexrWODV2sBdObrYU79Gyh9hFl6WLsA3JM9BfVsy9cGb/P/jP6ly4Z0/6qdIzZ5D6FPOB1B7rn5GZ2LAMOypRCA6W2uJbRjUU373Wut0p0OmQcMPto6XJsMlpvOEq+1uAq+LLAnAGEmmYTeskZebs=
on:
tags: true
condition: '"$TRAVIS_PYTHON_VERSION" = "3.8" || "$TRAVIS_PYTHON_VERSION" = "2.7"'
condition: '"$TRAVIS_PYTHON_VERSION" = "3.9" || "$TRAVIS_PYTHON_VERSION" = "2.7"'
distributions: "sdist bdist_wheel"

matrix:
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ Python application.
Requirements
------------

- Python 2.7 or 3.4+
- ``msgpack-python``
- Python 3.5+
- ``msgpack``
- **IMPORTANT**: Version 0.8.0 is the last version supporting Python 2.6, 3.2 and 3.3
- **IMPORTANT**: Version 0.9.6 is the last version supporting Python 2.7 and 3.4

Installation
------------
Expand Down
12 changes: 3 additions & 9 deletions fluent/asyncsender.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import threading

try:
from queue import Queue, Full, Empty
except ImportError:
from Queue import Queue, Full, Empty
from queue import Queue, Full, Empty

from fluent import sender
from fluent.sender import EventTime
Expand Down Expand Up @@ -121,8 +115,8 @@ def _send(self, bytes_):
self._queue_overflow_handler(discarded_bytes)
try:
self._queue.put(bytes_, block=(not self._queue_circular))
except Full: # pragma: no cover
return False # this actually can't happen
except Full: # pragma: no cover
return False # this actually can't happen

return True

Expand Down
11 changes: 3 additions & 8 deletions fluent/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
except ImportError: # pragma: no cover
import json

try:
basestring
except NameError: # pragma: no cover
basestring = (str, bytes)

from fluent import sender


Expand Down Expand Up @@ -120,7 +115,7 @@ def _structuring(self, data, record):

if isinstance(msg, dict):
self._add_dic(data, msg)
elif isinstance(msg, basestring):
elif isinstance(msg, str):
self._add_dic(data, self._format_msg(record, msg))
else:
self._add_dic(data, {'message': msg})
Expand Down Expand Up @@ -171,8 +166,8 @@ def _format_by_dict_uses_time(self):
@staticmethod
def _add_dic(data, dic):
for key, value in dic.items():
if isinstance(key, basestring):
data[str(key)] = value
if isinstance(key, str):
data[key] = value


class FluentHandler(logging.Handler):
Expand Down
2 changes: 0 additions & 2 deletions fluent/sender.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import print_function

import errno
import socket
import struct
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,32 @@

setup(
name='fluent-logger',
version='0.9.6',
version='0.10.0',
description=desc,
long_description=open(README).read(),
package_dir={'fluent': 'fluent'},
packages=['fluent'],
install_requires=['msgpack<1.0.0'],
install_requires=['msgpack>1.0'],
author='Kazuki Ohta',
author_email='[email protected]',
maintainer='Arcadiy Ivanov',
maintainer_email='[email protected]',
url='https://github.com/fluent/fluent-logger-python',
download_url='http://pypi.python.org/pypi/fluent-logger/',
download_url='https://pypi.org/project/fluent-logger/',
license='Apache License, Version 2.0',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Development Status :: 5 - Production/Stable',
'Topic :: System :: Logging',
'Intended Audience :: Developers',
],
python_requires=">=2.7,!=3.0,!=3.1,!=3.2,!=3.3",
python_requires='>=3.5',
test_suite='tests'
)
4 changes: 1 addition & 3 deletions tests/mockserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def run(self):
def get_received(self):
self.join()
self._buf.seek(0)
# TODO: have to process string encoding properly. currently we assume
# that all encoding is utf-8.
return list(Unpacker(self._buf, encoding='utf-8'))
return list(Unpacker(self._buf))

def close(self):

Expand Down

0 comments on commit 0568a26

Please sign in to comment.