Skip to content

Commit

Permalink
Merge branch 'new_attrs'
Browse files Browse the repository at this point in the history
Closes #11
  • Loading branch information
Roguelazer committed Oct 2, 2019
2 parents 96759ad + b1cc8c4 commit 30a2a58
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "pypy3.5"
before_script:
- wget https://github.com/kr/beanstalkd/archive/v1.10.tar.gz -O /tmp/beanstalkd.tar.gz
Expand Down
6 changes: 6 additions & 0 deletions docs/source/CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
pystalk ChangeLog
#################

====
NEXT
====
* add compatibility for `attrs` 19.2.0 and above
* drop support for Python 3.3.x

=====
0.5.1
=====
Expand Down
8 changes: 7 additions & 1 deletion pystalk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ class Job(object):
job_data = attr.ib()


@attr.s(frozen=True, hash=True, cmp=True)
if getattr(attr, "__version_info__", (0,)) >= (19, 2):
_attrs_kwargs = dict(eq=True)
else:
_attrs_kwargs = dict(cmp=True)


@attr.s(frozen=True, hash=True, **_attrs_kwargs)
class BeanstalkError(Exception):
"""Common error raised when something goes wrong with beanstalk"""

Expand Down
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import os.path
from setuptools import setup, find_packages

Expand All @@ -8,7 +9,13 @@
for line in f:
install_requires.append(line.rstrip())

with open(os.path.join(project_root, 'README.md'), encoding='utf-8') as f:

read_kwargs = {}

if sys.version_info > (3, 0):
read_kwargs['encoding'] = 'utf-8'

with open(os.path.join(project_root, 'README.md'), **read_kwargs) as f:
long_description = f.read()


Expand All @@ -24,7 +31,7 @@
license="ISC",
install_requires=install_requires,
packages=find_packages(exclude=['tests']),
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
project_urls={
'CI': 'https://travis-ci.org/EasyPost/pystalk',
},
Expand All @@ -33,10 +40,10 @@
"Environment :: Console",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Topic :: Database",
Expand Down

0 comments on commit 30a2a58

Please sign in to comment.