| 163 | class MyBuildPy(build_cmd): |
| 164 | ''' Subclass to write commit data into installation tree ''' |
| 165 | def run(self): |
| 166 | # loose as `.dev` is suppose to be invalid |
| 167 | print("check version number") |
| 168 | loose_pep440re = re.compile(r'^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d*)?$') |
| 169 | if not loose_pep440re.match(version): |
| 170 | raise ValueError("Version number '%s' is not valid (should match [N!]N(.N)*[{a|b|rc}N][.postN][.devN])" % version) |
| 171 | |
| 172 | |
| 173 | build_cmd.run(self) |
| 174 | # this one will only fire for build commands |
| 175 | if hasattr(self, 'build_lib'): |
| 176 | self._record_commit(self.build_lib) |
| 177 | |
| 178 | def make_release_tree(self, base_dir, files): |
| 179 | # this one will fire for sdist |