Skip to content

Commit 150949c

Browse files
authored
Add CHANGELOG (#29)
Add `CHANGELOG.md` to list all notable changes.
1 parent 116ba6d commit 150949c

7 files changed

Lines changed: 49 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
All notable changes in **python-transip** are documented below.
3+
4+
## [Unreleased]
5+
### Added
6+
- This CHANGELOG file to be able to list all notable changes for each version of **python-transip**.
7+
8+
[Unreleased]: https://github.com/roaldnefs/python-transip/compare/v0.3.0...HEAD

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include COPYING COPYING.LESSER README.md
1+
include COPYING COPYING.LESSER README.md CHANGELOG.md
22
include tox.ini
33
recursive-include requirements *
44
recursive-include docs *.py *.rst user/*rst Makefile make.bat

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,26 @@
66

77

88
def get_version() -> str:
9+
"""
10+
Return the project version without having to import the module itself as it
11+
might not have been loaded yet.
12+
"""
913
with open("transip/__init__.py") as file:
1014
for line in file:
1115
if line.startswith("__version__"):
1216
return line.replace("\"", "").split()[-1]
1317

1418

1519
def get_long_description() -> str:
20+
"""
21+
Return the full description of the project. The full description consists
22+
of the combined README.md and CHANGELOG.md files.
23+
"""
1624
with open("README.md", "r") as file:
17-
return file.read()
25+
readme = file.read()
26+
with open("CHANGELOG.md", "r") as file:
27+
changelog = file.read()
28+
return readme + changelog
1829

1930

2031
setup(

transip/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Copyright (C) 2020 Roald Nefs <info@roaldnefs.com>
44
#
55
# This file is part of python-transip.
6-
6+
#
77
# python-transip is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU Lesser General Public License as published by
99
# the Free Software Foundation, either version 3 of the License, or
1010
# (at your option) any later version.
11-
11+
#
1212
# python-transip is distributed in the hope that it will be useful,
1313
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
# GNU Lesser General Public License for more details.
16-
16+
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with python-transip. If not, see <https://www.gnu.org/licenses/>.
1919

transip/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Copyright (C) 2020 Roald Nefs <info@roaldnefs.com>
44
#
55
# This file is part of python-transip.
6-
6+
#
77
# python-transip is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU Lesser General Public License as published by
99
# the Free Software Foundation, either version 3 of the License, or
1010
# (at your option) any later version.
11-
11+
#
1212
# python-transip is distributed in the hope that it will be useful,
1313
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
# GNU Lesser General Public License for more details.
16-
16+
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with python-transip. If not, see <https://www.gnu.org/licenses/>.
1919

transip/mixins.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Copyright (C) 2020, 2021 Roald Nefs <info@roaldnefs.com>
44
#
55
# This file is part of python-transip.
6-
6+
#
77
# python-transip is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU Lesser General Public License as published by
99
# the Free Software Foundation, either version 3 of the License, or
1010
# (at your option) any later version.
11-
11+
#
1212
# python-transip is distributed in the hope that it will be useful,
1313
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
# GNU Lesser General Public License for more details.
16-
16+
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with python-transip. If not, see <https://www.gnu.org/licenses/>.
1919

@@ -33,7 +33,8 @@
3333

3434

3535
class GetMixin:
36-
"""Retrieve an single ApiObject.
36+
"""
37+
Retrieve an single ApiObject.
3738
3839
Derived class must define ``_resp_get_attr``.
3940
@@ -45,7 +46,7 @@ class GetMixin:
4546

4647
_resp_get_attr: Optional[str] = None
4748

48-
def get(self, id: str, **kwargs) -> Optional[Type[ApiObject]]:
49+
def get(self, id: str) -> Optional[Type[ApiObject]]:
4950
if self._obj_cls or self.path or self._resp_get_attr:
5051
obj: Type[ApiObject] = self._obj_cls( # type: ignore
5152
self,
@@ -61,7 +62,7 @@ class DeleteMixin:
6162
client: TransIP
6263
path: str
6364

64-
def delete(self, id: str, **kwargs) -> None:
65+
def delete(self, id: str) -> None:
6566
if self.path:
6667
self.client.delete(f"{self.path}/{id}")
6768

@@ -77,7 +78,8 @@ def delete(self) -> None:
7778

7879

7980
class ListMixin:
80-
"""Retrieve a list of ApiObjects.
81+
"""
82+
Retrieve a list of ApiObjects.
8183
8284
Derived class must define ``_resp_list_attr``.
8385
@@ -89,7 +91,7 @@ class ListMixin:
8991

9092
_resp_list_attr: Optional[str] = None
9193

92-
def list(self, **kwargs) -> List[Type[ApiObject]]:
94+
def list(self) -> List[Type[ApiObject]]:
9395
objs: List[Type[ApiObject]] = []
9496
if self._obj_cls and self.path and self._resp_list_attr:
9597
for obj in self.client.get(self.path)[self._resp_list_attr]:
@@ -111,8 +113,8 @@ def get_update_attrs(self) -> Tuple[
111113
Union[Tuple[()], Tuple[str, ...]],
112114
Union[Tuple[()], Tuple[str, ...]]
113115
]:
114-
"""Return the required and optional attributes for updating a new
115-
object.
116+
"""
117+
Return the required and optional attributes for updating a new object.
116118
117119
Returns:
118120
tuple: a tuple containing a tuple of required and optional
@@ -124,7 +126,8 @@ def get_update_attrs(self) -> Tuple[
124126
return self._update_attrs
125127

126128
def _check_update_attrs(self, attrs) -> None:
127-
"""Check required attributes.
129+
"""
130+
Check required attributes.
128131
129132
Raises:
130133
AttributeError: If any of the required attributes is missing.
@@ -171,7 +174,8 @@ class CreateMixin:
171174
_create_attrs: Optional[CreateAttrsTuple] = None
172175

173176
def _check_create_attrs(self, attrs) -> None:
174-
"""Check required attributes.
177+
"""
178+
Check required attributes.
175179
176180
Raises:
177181
AttributeError: If any of the required attributes is missing.
@@ -190,8 +194,8 @@ def get_create_attrs(self) -> Tuple[
190194
Union[Tuple[()], Tuple[str, ...]],
191195
Union[Tuple[()], Tuple[str, ...]]
192196
]:
193-
"""Return the required and optional attributes for creating a new
194-
object.
197+
"""
198+
Return the required and optional attributes for creating a new object.
195199
196200
Returns:
197201
tuple: a tuple containing a tuple of required and optional
@@ -202,7 +206,7 @@ def get_create_attrs(self) -> Tuple[
202206
else:
203207
return self._create_attrs
204208

205-
def create(self, data: Optional[Dict[str, Any]] = None, **kwargs):
209+
def create(self, data: Optional[Dict[str, Any]] = None):
206210
if data is None:
207211
data = {}
208212

transip/v6/objects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Copyright (C) 2020, 2021 Roald Nefs <info@roaldnefs.com>
44
#
55
# This file is part of python-transip.
6-
6+
#
77
# python-transip is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU Lesser General Public License as published by
99
# the Free Software Foundation, either version 3 of the License, or
1010
# (at your option) any later version.
11-
11+
#
1212
# python-transip is distributed in the hope that it will be useful,
1313
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
# GNU Lesser General Public License for more details.
16-
16+
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with python-transip. If not, see <https://www.gnu.org/licenses/>.
1919

0 commit comments

Comments
 (0)