Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop run-time version constraints for modern pip #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions public/2.6/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip<10"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools<37"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel<0.30"]
args += ["wheel"]

delete_tmpdir = False
try:
Expand Down
4 changes: 2 additions & 2 deletions public/2.7/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ def cert_parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip<21.0"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools<45"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel"]

Expand Down
4 changes: 2 additions & 2 deletions public/3.3/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip<18"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools"]
if implicit_wheel:
args += ["wheel<0.30"]
args += ["wheel"]

# Add our default arguments
args = ["install", "--upgrade", "--force-reinstall"] + args
Expand Down
2 changes: 1 addition & 1 deletion public/3.4/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip<19.2"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools"]
if implicit_wheel:
Expand Down
2 changes: 1 addition & 1 deletion public/3.5/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def cert_parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip<21.0"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools"]
if implicit_wheel:
Expand Down
2 changes: 1 addition & 1 deletion public/3.6/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def determine_pip_install_arguments():
pre_parser.add_argument("--no-wheel", action="store_true")
pre, args = pre_parser.parse_known_args()

args.append("pip<22.0")
args.append("pip")

if include_setuptools(pre):
args.append("setuptools")
Expand Down
2 changes: 1 addition & 1 deletion public/3.7/get-pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def determine_pip_install_arguments():
pre_parser.add_argument("--no-wheel", action="store_true")
pre, args = pre_parser.parse_known_args()

args.append("pip<24.1")
args.append("pip")

if include_setuptools(pre):
args.append("setuptools")
Expand Down
29 changes: 8 additions & 21 deletions scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,34 @@
SCRIPT_CONSTRAINTS = {
"default": {
"pip": "",
"setuptools": "",
"wheel": "",
},
"2.6": {
"pip": "<10",
"setuptools": "<37",
"wheel": "<0.30",
},
"2.7": {
"pip": "<21.0",
"setuptools": "<45",
"wheel": "",
},
"3.2": {
# Pip older than v9.0.0 does not support Requires-Python so we have to manually
# constrain the pip, setuptools and wheel versions that are installed at runtime.
"pip": "<8",
"setuptools": "<30",
"wheel": "<0.30",
},
"3.3": {
"pip": "<18",
"setuptools": "",
"wheel": "<0.30",
},
"3.4": {
"pip": "<19.2",
"setuptools": "",
"wheel": "",
},
"3.5": {
"pip": "<21.0",
"setuptools": "",
"wheel": "",
},
"3.6": {
"pip": "<22.0",
"setuptools": "",
"wheel": "",
},
"3.7": {
"pip": "<24.1",
"setuptools": "",
"wheel": "",
},
}

Expand Down Expand Up @@ -248,7 +234,7 @@ def detect_newline(f: TextIO) -> str:


def generate_one(variant, mapping, *, console, pip_versions):
# Determing the correct wheel to download
# Determine the correct wheel to download
pip_version = determine_latest(pip_versions.keys(), constraint=mapping["pip"])
wheel_url, wheel_hash = pip_versions[pip_version]

Expand All @@ -264,10 +250,11 @@ def generate_one(variant, mapping, *, console, pip_versions):
newline = detect_newline(f)
rendered_template = f.read().format(
zipfile=encoded_wheel,
installed_version=pip_version,
pip_version=mapping["pip"],
setuptools_version=mapping["setuptools"],
wheel_version=mapping["wheel"],
bundled_pip_version=pip_version,
# These constraints are only used for pip versions that don't support Requires-Python.
pip_version_constraint=mapping.get("pip"),
setuptools_version_constraint=mapping.get("setuptools"),
wheel_version_constraint=mapping.get("wheel"),
minimum_supported_version=mapping["minimum_supported_version"],
)
# Write the script to the correct location
Expand Down
8 changes: 4 additions & 4 deletions templates/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version {installed_version}).
# an entire copy of pip (version {bundled_pip_version}).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
Expand Down Expand Up @@ -71,13 +71,13 @@ def determine_pip_install_arguments():
pre_parser.add_argument("--no-wheel", action="store_true")
pre, args = pre_parser.parse_known_args()

args.append("pip{pip_version}")
args.append("pip")

if include_setuptools(pre):
args.append("setuptools{setuptools_version}")
args.append("setuptools")

if include_wheel(pre):
args.append("wheel{wheel_version}")
args.append("wheel")

return ["install", "--upgrade", "--force-reinstall"] + args

Expand Down
8 changes: 4 additions & 4 deletions templates/pre-10.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version {installed_version}).
# an entire copy of pip (version {bundled_pip_version}).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
Expand Down Expand Up @@ -147,11 +147,11 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip{pip_version}"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools{setuptools_version}"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel{wheel_version}"]
args += ["wheel"]

delete_tmpdir = False
try:
Expand Down
8 changes: 4 additions & 4 deletions templates/pre-18.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version {installed_version}).
# an entire copy of pip (version {bundled_pip_version}).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
Expand Down Expand Up @@ -147,11 +147,11 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip{pip_version}"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools{setuptools_version}"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel{wheel_version}"]
args += ["wheel"]

# Add our default arguments
args = ["install", "--upgrade", "--force-reinstall"] + args
Expand Down
8 changes: 4 additions & 4 deletions templates/pre-19.3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version {installed_version}).
# an entire copy of pip (version {bundled_pip_version}).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
Expand Down Expand Up @@ -147,11 +147,11 @@ def parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip{pip_version}"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools{setuptools_version}"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel{wheel_version}"]
args += ["wheel"]

# Add our default arguments
args = ["install", "--upgrade", "--force-reinstall"] + args
Expand Down
8 changes: 4 additions & 4 deletions templates/pre-21.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version {installed_version}).
# an entire copy of pip (version {bundled_pip_version}).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
Expand Down Expand Up @@ -149,11 +149,11 @@ def cert_parse_args(self, args):

# Add any implicit installations to the end of our args
if implicit_pip:
args += ["pip{pip_version}"]
args += ["pip"]
if implicit_setuptools:
args += ["setuptools{setuptools_version}"]
args += ["setuptools"]
if implicit_wheel:
args += ["wheel{wheel_version}"]
args += ["wheel"]

# Add our default arguments
args = ["install", "--upgrade", "--force-reinstall"] + args
Expand Down
Loading
Loading