Get rid of pkg_resources
... because it was removed in Python 3.12. Change-Id: I2f44dd754adaeba4a13c7980935b2c190c3ba7a3
This commit is contained in:
parent
c0522e2419
commit
e4f0b29bd1
@ -14,18 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import pbr.version
|
import pbr.version
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
version_info = pbr.version.VersionInfo('python-zaqarclient')
|
version_info = pbr.version.VersionInfo('python-zaqarclient')
|
||||||
|
|
||||||
try:
|
version_string = version_info.version_string
|
||||||
# First, try to get our version out of PKG-INFO. If we're installed,
|
|
||||||
# this'll let us find our version without pulling in pbr. After all, if
|
|
||||||
# we're installed on a system, we're not in a Git-managed source tree, so
|
|
||||||
# pbr doesn't really buy us anything.
|
|
||||||
version_string = pkg_resources.get_provider(
|
|
||||||
pkg_resources.Requirement.parse('python-zaqarclient')).version
|
|
||||||
except pkg_resources.DistributionNotFound:
|
|
||||||
# No PKG-INFO? We're probably running from a checkout, then. Let pbr do
|
|
||||||
# its thing to figure out a version number.
|
|
||||||
version_string = str(version_info)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user