Skip to content

Commit

Permalink
initial attempt at removing distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
David Culbreth committed Jun 20, 2023
1 parent b9aec99 commit 47d30b0
Show file tree
Hide file tree
Showing 29 changed files with 14 additions and 808 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ REQUIREMENTS := test-requirements.txt requirements.txt
PIP_VERSION ?= 20.3.3
SETUPTOOLS_VERSION ?= 51.3.3
PIP_OPTIONS := $(ST2_PIP_OPTIONS)
PACKAGING_VERSION ?= 23.1

ifndef PYLINT_CONCURRENCY
PYLINT_CONCURRENCY := 1
Expand Down Expand Up @@ -662,6 +663,7 @@ distclean: clean
.PHONY: .requirements
.requirements: virtualenv
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
$(VIRTUALENV_DIR)/bin/pip install --upgrade "PACKAGING_VERSION==$(PACKAGING_VERSION)"
# Print out pip version
$(VIRTUALENV_DIR)/bin/pip --version
# Generate all requirements to support current CI pipeline.
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 47d30b0

Please sign in to comment.