@@ -46,63 +46,6 @@ def run(self):
46
46
shutil .rmtree (os .path .join (path , '.installed.cfg' ), ignore_errors = True )
47
47
print ("Repository is now clean!" )
48
48
49
- class VersionInfo (type ):
50
- @property
51
- def info (cls ):
52
- if not cls ._info :
53
- try :
54
- cls ._info = list (int (x ) for x in open (cls .path , 'r' ).read ().strip ().split ('.' ))
55
- except ValueError :
56
- print ('Version parts shall all be integers' )
57
- sys .exit (1 )
58
- if len (cls ._info ) != 3 :
59
- print ('Version number is not conform, there should be exactly three parts' )
60
- sys .exit (1 )
61
- return cls ._info
62
-
63
- def __str__ (cls ):
64
- return '.' .join (map (str , cls .info ))
65
-
66
- # Hack for metaclass support in both Py2 and Py3
67
- class VersionInfo_metaclass (VersionInfo ):
68
- def __new__ (cls , * bases ):
69
- return VersionInfo ('version_info' , bases , {})
70
-
71
- class Version (VersionInfo_metaclass (Command )):
72
- description = 'Bump version number'
73
- user_options = [
74
- ('major' , 'M' , 'Bump major part of version number' ),
75
- ('minor' , 'm' , 'Bump minor part of version number' ),
76
- ('patch' , 'p' , 'Bump patch part of version number' )]
77
- path = os .path .join (os .path .dirname (__file__ ), 'VERSION' )
78
- _info = None
79
-
80
- def finalize_options (self , * args , ** kwarg ): pass
81
- def initialize_options (self , * args , ** kwarg ):
82
- self .major = None
83
- self .minor = None
84
- self .patch = None
85
-
86
- def run (self ):
87
- MAJOR , MINOR , PATCH = (0 ,1 ,2 )
88
- prev = str (Version )
89
- if self .major :
90
- Version .info [MAJOR ] += 1
91
- Version .info [MINOR ] = 0
92
- Version .info [PATCH ] = 0
93
- if self .minor :
94
- Version .info [MINOR ] += 1
95
- Version .info [PATCH ] = 0
96
- if self .patch :
97
- Version .info [PATCH ] += 1
98
- if self .major or self .minor or self .patch :
99
- with open (self .path , 'w' ) as f :
100
- f .write (str (Version ))
101
- print ("Bumped version from {} to {}" .format (prev , str (Version )))
102
- else :
103
- print ("Please choose at least one part to bump: --major, --minor or --patch!" )
104
- sys .exit (1 )
105
-
106
49
107
50
class PyTest (TestCommand ):
108
51
user_options = [
@@ -192,8 +135,7 @@ def requirements(spec=None):
192
135
193
136
194
137
setup (name = 'git-repo' ,
195
- version = str (Version ),
196
- description = 'Tool for managing remote repositories from your git CLI!' ,
138
+ description = 'Tool for managing repository services from your git CLI tool' ,
197
139
classifiers = [
198
140
# 'Development Status :: 2 - Pre-Alpha',
199
141
# 'Development Status :: 3 - Alpha',
@@ -217,10 +159,12 @@ def requirements(spec=None):
217
159
author = 'Bernard `Guyzmo` Pratz' ,
218
160
219
161
setup_requires = [
162
+ 'setuptools_scm' ,
220
163
'setuptools-markdown' ,
221
- 'wheel>=0.25.0'
164
+ 'wheel>=0.25.0' ,
222
165
],
223
166
long_description_markdown_filename = 'README.md' ,
167
+ use_scm_version = {'version_scheme' :'guess-next-dev' },
224
168
include_package_data = True ,
225
169
install_requires = requirements (),
226
170
tests_require = requirements ('test' ),
@@ -229,7 +173,6 @@ def requirements(spec=None):
229
173
'buildout' : Buildout ,
230
174
'dist_clean' : DistClean ,
231
175
'test' : PyTest ,
232
- 'bump' : Version ,
233
176
},
234
177
entry_points = """
235
178
# -*- Entry points: -*-
0 commit comments