Skip to content

Commit

Permalink
Merge pull request #5992 from AndroxxTraxxon/distutils-removal
Browse files Browse the repository at this point in the history
Futureproofing: Removing `distutils` dependencies
  • Loading branch information
guzzijones authored Sep 28, 2023
2 parents b2dad1e + c41021e commit 6f5ac8a
Show file tree
Hide file tree
Showing 30 changed files with 23 additions and 820 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ benchmark_histograms/
[._]sw[a-px]
[._]*.sw[a-p]x
[._]sw[a-p]x

**/build/lib/**
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Fixed

Added
~~~~~

* Move `git clone` to `user_home/.st2packs` #5845

* Error on `st2ctl status` when running in Kubernetes. #5851
Expand All @@ -37,6 +38,11 @@ Added
* Expose environment variable ST2_ACTION_DEBUG to all StackStorm actions.
Contributed by @maxfactor1

Changed
~~~~~~~
* Remove `distutils` dependencies across the project. #5992
Contributed by @AndroxxTraxxon

3.8.0 - November 18, 2022
-------------------------

Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/action_chain_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/announcement_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/http_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/inquirer_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/local_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
39 changes: 0 additions & 39 deletions contrib/runners/noop_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

from distutils.version import StrictVersion

# NOTE: This script can't rely on any 3rd party dependency so we need to use this code here
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
Expand All @@ -48,50 +46,13 @@
GET_PIP = "curl https://bootstrap.pypa.io/get-pip.py | python"

__all__ = [
"check_pip_is_installed",
"check_pip_version",
"fetch_requirements",
"apply_vagrant_workaround",
"get_version_string",
"parse_version_string",
]


def check_pip_is_installed():
"""
Ensure that pip is installed.
"""
try:
import pip # NOQA
except ImportError as e:
print("Failed to import pip: %s" % (text_type(e)))
print("")
print("Download pip:\n%s" % (GET_PIP))
sys.exit(1)

return True


def check_pip_version(min_version="6.0.0"):
"""
Ensure that a minimum supported version of pip is installed.
"""
check_pip_is_installed()

import pip

if StrictVersion(pip.__version__) < StrictVersion(min_version):
print(
"Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(
pip.__version__, min_version, GET_PIP
)
)
sys.exit(1)

return True


def fetch_requirements(requirements_file_path):
"""
Return a list of requirements and links by parsing the provided requirements file.
Expand Down
Loading

0 comments on commit 6f5ac8a

Please sign in to comment.