Skip to content

Commit e1c8b33

Browse files
authored
Merge pull request #18715 from Homebrew/python-link-man-default
language/python: link manpages by default
2 parents c1aeee8 + c2d3f12 commit e1c8b33

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Library/Homebrew/language/python.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def needs_python?(python)
240240
).returns(Virtualenv)
241241
}
242242
def virtualenv_install_with_resources(using: nil, system_site_packages: true, without_pip: true,
243-
link_manpages: false, without: nil, start_with: nil, end_with: nil)
243+
link_manpages: true, without: nil, start_with: nil, end_with: nil)
244244
python = using
245245
if python.nil?
246246
wanted = python_names.select { |py| needs_python?(py) }
@@ -415,7 +415,7 @@ def pip_install(targets, build_isolation: true)
415415
build_isolation: T::Boolean,
416416
).void
417417
}
418-
def pip_install_and_link(targets, link_manpages: false, build_isolation: true)
418+
def pip_install_and_link(targets, link_manpages: true, build_isolation: true)
419419
bin_before = Dir[@venv_root/"bin/*"].to_set
420420
man_before = Dir[@venv_root/"share/man/man*/*"].to_set if link_manpages
421421

Library/Homebrew/test/language/python/virtualenv_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
f.libexec, "python", { system_site_packages: true, without_pip: true }
5050
).and_return(venv)
5151
expect(venv).to receive(:pip_install).with([r_a, r_b, r_c, r_d])
52-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
52+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
5353
f.virtualenv_install_with_resources(using: "python")
5454
end
5555

@@ -58,21 +58,21 @@
5858
f.libexec, "python3.12", { system_site_packages: true, without_pip: true }
5959
).and_return(venv)
6060
expect(venv).to receive(:pip_install).with([r_a, r_b, r_c, r_d])
61-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
61+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
6262
f.virtualenv_install_with_resources(using: "[email protected]")
6363
end
6464

6565
it "skips a `without` resource string and installs remaining resources in order" do
6666
expect(f).to receive(:virtualenv_create).and_return(venv)
6767
expect(venv).to receive(:pip_install).with([r_a, r_b, r_d])
68-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
68+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
6969
f.virtualenv_install_with_resources(using: "python", without: r_c.name)
7070
end
7171

7272
it "skips all resources in `without` array and installs remaining resources in order" do
7373
expect(f).to receive(:virtualenv_create).and_return(venv)
7474
expect(venv).to receive(:pip_install).with([r_b, r_c])
75-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
75+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
7676
f.virtualenv_install_with_resources(using: "python", without: [r_d.name, r_a.name])
7777
end
7878

@@ -91,14 +91,14 @@
9191
it "installs a `start_with` resource string and then remaining resources in order" do
9292
expect(f).to receive(:virtualenv_create).and_return(venv)
9393
expect(venv).to receive(:pip_install).with([r_c, r_a, r_b, r_d])
94-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
94+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
9595
f.virtualenv_install_with_resources(using: "python", start_with: r_c.name)
9696
end
9797

9898
it "installs all resources in `start_with` array and then remaining resources in order" do
9999
expect(f).to receive(:virtualenv_create).and_return(venv)
100100
expect(venv).to receive(:pip_install).with([r_d, r_b, r_a, r_c])
101-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
101+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
102102
f.virtualenv_install_with_resources(using: "python", start_with: [r_d.name, r_b.name])
103103
end
104104

@@ -117,14 +117,14 @@
117117
it "installs an `end_with` resource string as last resource" do
118118
expect(f).to receive(:virtualenv_create).and_return(venv)
119119
expect(venv).to receive(:pip_install).with([r_a, r_c, r_d, r_b])
120-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
120+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
121121
f.virtualenv_install_with_resources(using: "python", end_with: r_b.name)
122122
end
123123

124124
it "installs all resources in `end_with` array after other resources are installed" do
125125
expect(f).to receive(:virtualenv_create).and_return(venv)
126126
expect(venv).to receive(:pip_install).with([r_a, r_d, r_c, r_b])
127-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
127+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
128128
f.virtualenv_install_with_resources(using: "python", end_with: [r_c.name, r_b.name])
129129
end
130130

@@ -143,7 +143,7 @@
143143
it "installs resources in correct order when combining `without`, `start_with` and `end_with" do
144144
expect(f).to receive(:virtualenv_create).and_return(venv)
145145
expect(venv).to receive(:pip_install).with([r_d, r_c, r_b])
146-
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: false })
146+
expect(venv).to receive(:pip_install_and_link).with(buildpath, { link_manpages: true })
147147
f.virtualenv_install_with_resources(using: "python", without: r_a.name,
148148
start_with: r_d.name, end_with: r_b.name)
149149
end
@@ -254,7 +254,7 @@
254254
expect(virtualenv).to receive(:pip_install).with("foo", { build_isolation: true })
255255
expect(Dir).to receive(:[]).with(src_bin/"*").twice.and_return(bin_before, bin_after)
256256

257-
virtualenv.pip_install_and_link "foo"
257+
virtualenv.pip_install_and_link("foo", link_manpages: false)
258258

259259
expect(src_bin/"kilroy").to exist
260260
expect(dest_bin/"kilroy").to exist

0 commit comments

Comments
 (0)