Skip to content

Commit

Permalink
Replace the distutils package (#69)
Browse files Browse the repository at this point in the history
`distutils` package is deprecated. Use `packaging` library instead.

Fixes: #67

Signed-off-by: Aravinda Vishwanathapura <mail@aravindavk.in>
  • Loading branch information
aravindavk committed Feb 15, 2024
1 parent e803685 commit b3abf1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gstatus/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

from optparse import OptionParser
from distutils.version import LooseVersion as version
from packaging.version import parse as version
from shutil import get_terminal_size

try:
Expand Down
15 changes: 1 addition & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/python

from setuptools import setup
import distutils.command.install_scripts
import shutil

from gstatus import version
Expand All @@ -10,15 +9,6 @@
long_description = f.read().strip()
f.close()

# idea from http://stackoverflow.com/a/11400431/2139420
class strip_py_ext(distutils.command.install_scripts.install_scripts):
def run(self):
distutils.command.install_scripts.install_scripts.run(self)
for script in self.get_outputs():
if script.endswith(".py"):
shutil.move(script, script[:-3])


setup(
name = "gstatus",
version= version.VERSION,
Expand All @@ -28,7 +18,7 @@ def run(self):
author_email = "pcuzner@redhat.com",
url = "https://github.com/gluster/gstatus",
license = "GPLv3",
install_requires=['glustercli'],
install_requires=['glustercli', 'packaging'],
packages = [
"gstatus",
"gstatus.glusterlib",
Expand All @@ -37,8 +27,5 @@ def run(self):
"console_scripts": [
"gstatus = gstatus.__main__:main",
]
},
cmdclass = {
"install_scripts" : strip_py_ext
}
)

0 comments on commit b3abf1b

Please sign in to comment.