File tree 3 files changed +14
-21
lines changed
3 files changed +14
-21
lines changed Original file line number Diff line number Diff line change 1
1
[build-system ]
2
- requires = [" setuptools>=42" ]
3
2
build-backend = " setuptools.build_meta"
3
+ requires = [
4
+ " setuptools>=45" ,
5
+ " wheel" ,
6
+ " setuptools_scm>=6.2" ,
7
+ ]
8
+
9
+ [tool .setuptools_scm ]
10
+ version_scheme = " python-simplified-semver"
Original file line number Diff line number Diff line change 1
1
[metadata]
2
2
name = teuthology
3
- version = attr: teuthology.__version__
4
3
long_description = file: README.rst
5
4
long_description_content_type = text/x-rst
6
5
url = https://github.com/ceph/teuthology
Original file line number Diff line number Diff line change 1
1
from __future__ import print_function
2
2
import os
3
+ try :
4
+ import importlib .metadata as importlib_metadata
5
+ except ImportError :
6
+ import importlib_metadata
7
+
8
+ __version__ = importlib_metadata .version ("teuthology" )
3
9
4
10
# Tell gevent not to patch os.waitpid() since it is susceptible to race
5
11
# conditions. See:
33
39
monkey .patch_all ()
34
40
35
41
import logging
36
- import subprocess
37
-
38
- __version__ = '1.1.0'
39
-
40
- # do our best, but if it fails, continue with above
41
-
42
- try :
43
- teuthology_dir = os .path .dirname (os .path .realpath (__file__ ))
44
- site_dir = os .path .dirname (teuthology_dir )
45
- git_dir = os .path .join (site_dir , '.git' )
46
- # make sure we use git repo otherwise it is a released version
47
- if os .path .exists (git_dir ):
48
- __version__ += '-' + str (subprocess .check_output (
49
- 'git rev-parse --short HEAD' .split (),
50
- cwd = site_dir
51
- ).decode ()).strip ()
52
- except Exception as e :
53
- # before logging; should be unusual
54
- print ("Can't get version from git rev-parse %s" % e , file = sys .stderr )
55
42
56
43
# If we are running inside a virtualenv, ensure we have its 'bin' directory in
57
44
# our PATH. This doesn't happen automatically if scripts are called without
You can’t perform that action at this time.
0 commit comments