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

Pin down pip for now #374

Merged
merged 3 commits into from
Jul 18, 2023
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ that were not yet released.

_Unreleased_

- Pin down pip to an older version to avoid issues with an incompatible
`pip-tools` version. This does not yet update pip-tools to 7.0 as there
are significant regressions in 7.x. #374

- The `version` command can show dynamic versions now. #355

- `rye add` now properly checks some incompatible argument combinations. #347
Expand Down
131 changes: 129 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
# all-features: false

-e file:.
blinker==1.6.2
certifi==2023.5.7
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
flask==2.3.2
ghp-import==2.1.0
idna==3.4
itsdangerous==2.1.2
jaraco-classes==3.2.3
jinja2==3.1.2
markdown==3.3.7
markupsafe==2.1.2
Expand All @@ -28,7 +24,6 @@ mkdocs-material==9.1.12
mkdocs-material-extensions==1.1.1
mkdocs-simple-hooks==0.1.5
mkdocs-version-annotations==1.0.0
more-itertools==9.1.0
packaging==23.1
pygments==2.15.1
pymdown-extensions==9.11
Expand All @@ -40,4 +35,3 @@ requests==2.30.0
six==1.16.0
urllib3==2.0.2
watchdog==3.0.0
werkzeug==2.3.6
6 changes: 0 additions & 6 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
# all-features: false

-e file:.
blinker==1.6.2
certifi==2023.5.7
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
flask==2.3.2
ghp-import==2.1.0
idna==3.4
itsdangerous==2.1.2
jaraco-classes==3.2.3
jinja2==3.1.2
markdown==3.3.7
markupsafe==2.1.2
Expand All @@ -28,7 +24,6 @@ mkdocs-material==9.1.12
mkdocs-material-extensions==1.1.1
mkdocs-simple-hooks==0.1.5
mkdocs-version-annotations==1.0.0
more-itertools==9.1.0
packaging==23.1
pygments==2.15.1
pymdown-extensions==9.11
Expand All @@ -40,4 +35,3 @@ requests==2.30.0
six==1.16.0
urllib3==2.0.2
watchdog==3.0.0
werkzeug==2.3.6
10 changes: 7 additions & 3 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub const SELF_PYTHON_TARGET_VERSION: PythonVersionRequest = PythonVersionReques
suffix: None,
};

const SELF_VERSION: u64 = 3;
const SELF_VERSION: u64 = 4;

const SELF_REQUIREMENTS: &str = r#"
build==0.10.0
Expand Down Expand Up @@ -143,13 +143,16 @@ fn do_update(output: CommandOutput, venv_dir: &Path, app_dir: &Path) -> Result<(
let mut pip_install_cmd = Command::new(venv_bin.join("pip"));
pip_install_cmd.arg("install");
pip_install_cmd.arg("--upgrade");
pip_install_cmd.arg("pip");
// pin to a specific pip version to work around a bug with pip-tools. Fix this
// once 7.0.0 is stable. https://github.com/mitsuhiko/rye/issues/368
pip_install_cmd.arg("pip==23.1");
if output == CommandOutput::Verbose {
pip_install_cmd.arg("--verbose");
} else {
pip_install_cmd.arg("--quiet");
pip_install_cmd.env("PYTHONWARNINGS", "ignore");
}
pip_install_cmd.env("PIP_DISABLE_PIP_VERSION_CHECK", "1");
let status = pip_install_cmd
.status()
.context("unable to self-upgrade pip")?;
Expand All @@ -162,7 +165,8 @@ fn do_update(output: CommandOutput, venv_dir: &Path, app_dir: &Path) -> Result<(
pip_install_cmd
.arg("install")
.arg("-r")
.arg(req_file.path());
.arg(req_file.path())
.env("PIP_DISABLE_PIP_VERSION_CHECK", "1");
if output != CommandOutput::Quiet {
echo!("Installing internal dependencies");
}
Expand Down
1 change: 1 addition & 0 deletions rye/src/cli/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fn print_installed_deps(project: &PyProject) -> Result<(), Error> {
.arg(&python)
.arg("freeze")
.env("PYTHONWARNINGS", "ignore")
.env("PIP_DISABLE_PIP_VERSION_CHECK", "1")
.status()?;

if !status.success() {
Expand Down
3 changes: 2 additions & 1 deletion rye/src/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub fn install(
cmd.arg("--python")
.arg(&py)
.arg("install")
.env("PYTHONWARNINGS", "ignore");
.env("PYTHONWARNINGS", "ignore")
.env("PIP_DISABLE_PIP_VERSION_CHECK", "1");
sources.add_as_pip_args(&mut cmd);

if output == CommandOutput::Verbose {
Expand Down
3 changes: 2 additions & 1 deletion rye/src/piptools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ fn get_pip_tools_bin(py_ver: &PythonVersion, output: CommandOutput) -> Result<Pa
.arg(&py)
.arg("install")
.arg(PIP_TOOLS_VERSION)
.arg("-q");
.arg("-q")
.env("PIP_DISABLE_PIP_VERSION_CHECK", "1");
if output == CommandOutput::Verbose {
cmd.arg("--verbose");
} else {
Expand Down
2 changes: 1 addition & 1 deletion rye/src/pyproject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ pub fn latest_available_python_version(
};

all.sort();
all.into_iter().rev().next()
all.into_iter().next_back()
}

fn resolve_target_python_version(
Expand Down