Skip to content

Commit 40dbd68

Browse files
author
Zach Moody
authored
Merge pull request #65 from digitalocean/setuptools-scm
Use setuptools_scm for versioning.
2 parents 94cfda4 + 8f83639 commit 40dbd68

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: python
22

33
install:
4-
- pip install -r requirements.txt
5-
- pip install pep8
6-
- pip install nose
4+
- pip install .
5+
- pip install pycodestyle
76

87
python:
98
- "2.7"
109
- "3.6"
1110

1211
script:
13-
- python -m "nose"
14-
- pep8 pynetbox
12+
- python -m unittest discover
13+
- pycodestyle pynetbox
14+
- pycodestyle --ignore=E501 tests
1515

1616
jobs:
1717
include:

pynetbox/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

pynetbox/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from setuptools_scm import get_version
12
from pynetbox.api import Api as api
23
from pynetbox.lib import RequestError
3-
from os.path import join, dirname
44

5-
with open(join(dirname(__file__), 'VERSION')) as f:
6-
__version__ = f.read().strip()
5+
6+
__version__ = get_version(root='..', relative_to=__file__)

pynetbox/lib/endpoint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def all(self):
122122
]
123123

124124
def get(self, *args, **kwargs):
125-
"""Queries the DetailsView of a given endpoint.
125+
r"""Queries the DetailsView of a given endpoint.
126126
127127
:arg int,optional key: id for the item to be
128128
retrieved.
@@ -178,7 +178,7 @@ def get(self, *args, **kwargs):
178178
return self.return_obj(req.get(), **ret_kwargs)
179179

180180
def filter(self, *args, **kwargs):
181-
"""Queries the 'ListView' of a given endpoint.
181+
r"""Queries the 'ListView' of a given endpoint.
182182
183183
Takes named arguments that match the usable filters on a
184184
given endpoint. If an argument is passed then it's used as a
@@ -250,7 +250,7 @@ def filter(self, *args, **kwargs):
250250
return ret
251251

252252
def create(self, *args, **kwargs):
253-
"""Creates an object on an endpoint.
253+
r"""Creates an object on an endpoint.
254254
255255
Allows for the creation of new objects on an endpoint. Named
256256
arguments are converted to json properties, and a single object
@@ -335,7 +335,7 @@ def __init__(self, name, parent_obj=None):
335335
)
336336

337337
def list(self, **kwargs):
338-
"""The view operation for a detail endpoint
338+
r"""The view operation for a detail endpoint
339339
340340
Returns the response from NetBox for a detail endpoint.
341341

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
from setuptools import setup
2-
from os.path import join, dirname
3-
4-
with open(join(dirname(__file__), 'pynetbox/VERSION')) as f:
5-
version = f.read().strip()
62

73
setup(
84
name='pynetbox',
9-
version=version,
105
description='NetBox API client library',
116
url='https://github.com/digitalocean/pynetbox',
127
author='Zach Moody',
138
author_email='[email protected]',
149
license='Apache2',
1510
include_package_data=True,
11+
use_scm_version=True,
1612
packages=[
1713
'pynetbox',
1814
'pynetbox.lib'
1915
],
2016
install_requires=[
2117
'netaddr==0.*',
2218
'requests==2.*',
23-
'six==1.*'
19+
'six==1.*',
20+
'setuptools-scm==2.*'
2421
],
2522
zip_safe=False,
2623
keywords=['netbox'],

0 commit comments

Comments
 (0)