Skip to content

Commit 9e8ff86

Browse files
committed
Add MANIFEST.in
1 parent 92296aa commit 9e8ff86

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prune tests

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_vultr-python&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cssnr_vultr-python)
77
[![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/vultr-python/lint.yaml?logo=cachet&label=lint)](https://github.com/cssnr/vultr-python/actions/workflows/lint.yaml)
88
[![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/vultr-python/test.yaml?logo=cachet&label=test)](https://github.com/cssnr/vultr-python/actions/workflows/test.yaml)
9+
[![Deployments PyPi](https://img.shields.io/github/deployments/cssnr/vultr-python/pypi?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/vultr-python/)
910
[![Deployments Pages](https://img.shields.io/github/deployments/cssnr/vultr-python/github-pages?logo=materialformkdocs&logoColor=white&label=github-pages)](https://cssnr.github.io/vultr-python/)
1011
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/vultr-python?logo=github&label=updated)](https://github.com/cssnr/vultr-python/graphs/commit-activity)
1112
[![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/vultr-python?logo=bookstack&logoColor=white&label=repo%20size)](https://github.com/cssnr/vultr-python)
@@ -119,16 +120,18 @@ sshkey = vultr.post('ssh-keys', name='key-name', ssh_key='ssh-rsa AAAA...')
119120
vultr.delete(f"instances/019ad1a8-2aa3-7650-83d1-8520d65ed6af")
120121
```
121122

122-
Errors Handling
123+
Error Handling
123124

124125
```python
125126
from vultr import VultrException
126127

127128
try:
128129
instance = vultr.create_instance("atl", "vc2-1c-0.5gb-v6", os_id=2284)
129130
except VultrException as error:
130-
print(error.error) # 'Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.'
131-
print(error.status) # 400
131+
print(error.error)
132+
# 'Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.'
133+
print(error.status)
134+
# 400
132135
```
133136

134137
Full Documentation: [https://cssnr.github.io/vultr-python](https://cssnr.github.io/vultr-python/)

docs/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,18 @@ sshkey = vultr.post('ssh-keys', name='key-name', ssh_key='ssh-rsa AAAA...')
9696
vultr.delete(f"instances/019ad1a8-2aa3-7650-83d1-8520d65ed6af")
9797
```
9898

99-
Errors Handling
99+
Error Handling
100100

101101
```python
102102
from vultr import VultrException
103103

104104
try:
105105
instance = vultr.create_instance("atl", "vc2-1c-0.5gb-v6", os_id=2284)
106106
except VultrException as error:
107-
print(error.error) # 'Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.'
108-
print(error.status) # 400
107+
print(error.error)
108+
# 'Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.'
109+
print(error.status)
110+
# 400
109111
```
110112

111113
 

src/vultr/vultr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ def _get_obj_key(obj, key="id"):
217217

218218

219219
class VultrException(Exception):
220-
""" Exception class for all Vultr error responses. """
220+
"""Exception class for all Vultr error responses."""
221+
221222
def __init__(self, response: requests.Response):
222223
try:
223224
data = response.json()
@@ -226,7 +227,7 @@ def __init__(self, response: requests.Response):
226227
error = response.text
227228
status = response.status_code
228229
self.error: str = error
229-
"""Error Message returned from the API"""
230+
"""Error Message for 400 Codes"""
230231
self.status: int = status
231232
"""Response Status Code"""
232233
super().__init__(f"Error {self.status}: {self.error}")

0 commit comments

Comments
 (0)