Skip to content

Commit

Permalink
0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SenadI committed Sep 4, 2017
1 parent 08c4144 commit a571e65
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 55 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.9.3 (2017-09-40)
==================
- Fix broken py2 compatibility
- Improve requirement handling for setup.py
- Fix `__eq__` method (yet again)

0.9.2 (2017-08-30)
==================
- Fix `__eq__` method for main resources.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.2
0.9.3
9 changes: 0 additions & 9 deletions requirements-dev.txt

This file was deleted.

12 changes: 9 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
six==1.10.0
requests==2.18.3
futures==3.0.4; python_version < '3.0'
-r requirements.txt
flake8==3.3.0
pytest==2.9.1
pytest-cov==2.3.1
pytest-pep8==1.0.6
requests_mock==1.3.0
faker==0.7.10
sphinx==1.5.1
sphinx_rtd_theme==0.1.9
13 changes: 4 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import io
import os
import re
import sys
from setuptools import setup, find_packages

from setuptools import setup, find_packages

# If version file exists, this happens during the installation phase,
# read the version from the version file.
Expand All @@ -18,13 +17,9 @@
with io.open(VERSION_FILE, 'w', encoding='utf-8') as f:
f.write(version)


with open('requirements.txt') as fp:
install_requires = fp.readlines()
if sys.version_info < (3, 0):
reg = re.compile('''^.*?;\s*python_version\s*<\s*'3\..*$''')
install_requires = [i for i in install_requires if not reg.match(i)]

install_requires = ["six==1.10.0", "requests==2.18.3"]
if sys.version_info < (3,):
install_requires.append("futures==3.0.4")

setup(
name='sevenbridges-python',
Expand Down
2 changes: 1 addition & 1 deletion sevenbridges/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
import logging

__version__ = "0.9.2"
__version__ = "0.9.3"

from sevenbridges.api import Api
from sevenbridges.config import Config
Expand Down
6 changes: 2 additions & 4 deletions sevenbridges/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import logging
import os
from configparser import NoSectionError

from six.moves import configparser as cp

from sevenbridges.errors import SbgError
Expand Down Expand Up @@ -76,7 +74,7 @@ def proxies(self):
}
except KeyError:
return format_proxies({})
except NoSectionError:
except cp.NoSectionError:
return format_proxies({})

@property
Expand All @@ -86,7 +84,7 @@ def advance_access(self):
'mode', 'advance_access')) if self.config_parser else False
except KeyError:
return False
except NoSectionError:
except cp.NoSectionError:
return False


Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ def id(self):
return self._id

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<App: id={id} rev={rev}>'.format(
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/billing_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ def __str__(self):
return six.text_type('<BillingGroup: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/division.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ def __str__(self):
return six.text_type('<Division: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ def __str__(self):
return six.text_type('<File: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, project, names=None, metadata=None, origin=None, tags=None,
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ def __str__(self):
return six.text_type('<Invoice: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ def __str__(self):
return six.text_type('<Marker: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, file, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ def __str__(self):
.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@inplace_reload
def save(self, inplace=True):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ def __str__(self):
return six.text_type('<Project: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, owner=None, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/storage_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ def __str__(self):
return six.text_type('<Export: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@property
def source(self):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/storage_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ def __str__(self):
return six.text_type('<Import: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@property
def result(self):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ def __str__(self):
return six.text_type('<Task: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, project=None, status=None, batch=None,
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ def __str__(self):
return six.text_type('<Team: id={id}>'.format(id=self.id))

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

@classmethod
def query(cls, division, offset=None, limit=None, api=None):
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/team_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ class TeamMember(Resource):
role = StringField(read_only=True)

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<Team member: username={username}>'
Expand Down
7 changes: 5 additions & 2 deletions sevenbridges/models/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ class Volume(Resource):
active = BooleanField(read_only=True)

def __eq__(self, other):
if self is None and other:
return False
if other is None and self:
return False
if self is other:
return True
else:
return self.id == other.id and self.__class__ == other.__class__
return self.id == other.id and self.__class__ == other.__class__

def __str__(self):
return six.text_type('<Volume: id={id}>'.format(id=self.id))
Expand Down

0 comments on commit a571e65

Please sign in to comment.