Skip to content

Commit de58aeb

Browse files
committed
Use setuptools_scm to manage package version numbers
1 parent 663786e commit de58aeb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pysolr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import re
1010
import time
1111
from xml.etree import ElementTree
12+
from pkg_resources import get_distribution, DistributionNotFound
1213

1314
import requests
1415

@@ -55,8 +56,11 @@
5556

5657
__author__ = 'Daniel Lindsley, Joseph Kocherhans, Jacob Kaplan-Moss'
5758
__all__ = ['Solr']
58-
__version__ = (3, 5, 0)
5959

60+
try:
61+
__version__ = get_distribution(__name__).version
62+
except DistributionNotFound:
63+
__version__ = (0, 0, 'dev0')
6064

6165
def get_version():
6266
return "%s.%s.%s" % __version__[:3]

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="pysolr",
9-
version="3.6.0",
9+
use_scm_version=True,
1010
description="Lightweight python wrapper for Apache Solr.",
1111
author='Daniel Lindsley',
1212
author_email='daniel@toastdriven.com',
@@ -33,5 +33,6 @@
3333
'solrcloud': [
3434
'kazoo==2.2'
3535
]
36-
}
36+
},
37+
setup_requires=['setuptools_scm'],
3738
)

0 commit comments

Comments
 (0)