-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathvirtualenvwrapper.rb
82 lines (68 loc) · 3.83 KB
/
virtualenvwrapper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
class Virtualenvwrapper < Formula
include Language::Python::Virtualenv
desc "Python virtualenv extensions"
homepage "https://virtualenvwrapper.readthedocs.io/"
url "https://files.pythonhosted.org/packages/97/0b/1f6daec2e0bd25275953256f83f98fb337b78b9d03d44b7eb9619b72b046/virtualenvwrapper-6.1.1.tar.gz"
sha256 "112e7ea34a9a3ce90aaea54182f0d3afef4d1a913eeb75e98a263b4978cd73c6"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "e51d9ccf87aee13767c929170db8e7012d2ada9085798e262868fda6388252b5"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "e51d9ccf87aee13767c929170db8e7012d2ada9085798e262868fda6388252b5"
sha256 cellar: :any_skip_relocation, arm64_ventura: "e51d9ccf87aee13767c929170db8e7012d2ada9085798e262868fda6388252b5"
sha256 cellar: :any_skip_relocation, sonoma: "8e47b3f80979e56edd1b3bec6e2513b941508a182773534c9c9f63a84c5f59ac"
sha256 cellar: :any_skip_relocation, ventura: "8e47b3f80979e56edd1b3bec6e2513b941508a182773534c9c9f63a84c5f59ac"
sha256 cellar: :any_skip_relocation, arm64_linux: "a71fc25071321758866cdbb5ef9d2a111d9d6279ca800c4814d5271c3f426001"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41c4a7cb2fdb39da69b11eb2e7a89f0772b43df9d8f98100b986f1d6e480b998"
end
depends_on "python@3.13"
resource "distlib" do
url "https://files.pythonhosted.org/packages/0d/dd/1bec4c5ddb504ca60fc29472f3d27e8d4da1257a854e1d96742f15c1d02d/distlib-0.3.9.tar.gz"
sha256 "a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"
end
resource "filelock" do
url "https://files.pythonhosted.org/packages/9d/db/3ef5bb276dae18d6ec2124224403d1d67bccdbefc17af4cc8f553e341ab1/filelock-3.16.1.tar.gz"
sha256 "c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"
end
resource "pbr" do
url "https://files.pythonhosted.org/packages/b2/35/80cf8f6a4f34017a7fe28242dc45161a1baa55c41563c354d8147e8358b2/pbr-6.1.0.tar.gz"
sha256 "788183e382e3d1d7707db08978239965e8b9e4e5ed42669bf4758186734d5f24"
end
resource "platformdirs" do
url "https://files.pythonhosted.org/packages/13/fc/128cc9cb8f03208bdbf93d3aa862e16d376844a14f9a0ce5cf4507372de4/platformdirs-4.3.6.tar.gz"
sha256 "357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"
end
resource "stevedore" do
url "https://files.pythonhosted.org/packages/c4/59/f8aefa21020054f553bf7e3b405caec7f8d1f432d9cb47e34aaa244d8d03/stevedore-5.3.0.tar.gz"
sha256 "9a64265f4060312828151c204efbe9b7a9852a0d9228756344dbc7e4023e375a"
end
resource "virtualenv" do
url "https://files.pythonhosted.org/packages/3f/40/abc5a766da6b0b2457f819feab8e9203cbeae29327bd241359f866a3da9d/virtualenv-20.26.6.tar.gz"
sha256 "280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48"
end
resource "virtualenv-clone" do
url "https://files.pythonhosted.org/packages/85/76/49120db3bb8de4073ac199a08dc7f11255af8968e1e14038aee95043fafa/virtualenv-clone-0.5.7.tar.gz"
sha256 "418ee935c36152f8f153c79824bb93eaf6f0f7984bae31d3f48f350b9183501a"
end
def install
virtualenv_install_with_resources
(bin/"virtualenvwrapper.sh").unlink
(bin/"virtualenvwrapper.sh").write <<~SH
#!/bin/sh
export VIRTUALENVWRAPPER_PYTHON="#{libexec}/bin/python"
export VIRTUALENVWRAPPER_VIRTUALENV="${VIRTUALENVWRAPPER_VIRTUALENV:-#{libexec}/bin/virtualenv}"
export VIRTUALENVWRAPPER_VIRTUALENV_CLONE="${VIRTUALENVWRAPPER_VIRTUALENV_CLONE:-#{libexec}/bin/virtualenv-clone}"
source "#{libexec}/bin/virtualenvwrapper.sh"
SH
end
def caveats
<<~EOS
To activate virtualenvwrapper, add the following to your shell profile
e.g. ~/.profile or ~/.zshrc
source virtualenvwrapper.sh
EOS
end
test do
assert_match "created virtual environment",
shell_output("bash -c 'source virtualenvwrapper.sh; mktmpenv'")
end
end