439 lines
20 KiB
Ruby
439 lines
20 KiB
Ruby
class Jupyterlab < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Interactive environments for writing and running code"
|
|
homepage "https://jupyter.org/"
|
|
url "https://files.pythonhosted.org/packages/18/13/bad942536fdec9dce4d5c32fdb6bb54633800bdf4eb43f677fe0cbe4009a/jupyterlab-3.4.8.tar.gz"
|
|
sha256 "1fafb8b657005d91603f3c3adfd6d9e8eaf33fdc601537fef09283332efe67cb"
|
|
license "BSD-3-Clause"
|
|
license all_of: [
|
|
"BSD-3-Clause",
|
|
"MIT", # semver.py
|
|
]
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_ventura: "ef65d66d25c30bf53e3f985ca3a7b7255c4108617b7434db12d745efe51a25fd"
|
|
sha256 cellar: :any, arm64_monterey: "a2b5567a0b9e52dbf9d831eacef29239aee3413d7ffd9283f612298e2870434e"
|
|
sha256 cellar: :any, arm64_big_sur: "90ee222a6dd1fa54a315cf00bd5eb606ff82d86db9a7dc8fbbfbaa916dce300a"
|
|
sha256 cellar: :any, ventura: "c188c10ad42309481202268c3fc20f5f75dd32db78007c221fc4351b9fd1a07f"
|
|
sha256 cellar: :any, monterey: "c0db45836ee1c296c1fc414793647f2b7c5330f0f79f6e52ea211171ddbdc75e"
|
|
sha256 cellar: :any, big_sur: "fbaeee46942d4c0d22733926874a0b91bbf7de3c7631b1340ea4406fe428c13a"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "00737c799921ba3b0f07e4d8429e572a1640e5b209b66e5a71f177c222d4a280"
|
|
end
|
|
|
|
depends_on "hatch" => :build
|
|
depends_on "python-build" => :build
|
|
depends_on "ipython"
|
|
depends_on "node"
|
|
depends_on "pandoc"
|
|
depends_on "pygments"
|
|
depends_on "python@3.11"
|
|
depends_on "six"
|
|
depends_on "zeromq"
|
|
|
|
uses_from_macos "expect" => :test
|
|
uses_from_macos "libxml2"
|
|
uses_from_macos "libxslt"
|
|
|
|
resource "anyio" do
|
|
url "https://files.pythonhosted.org/packages/67/c4/fd50bbb2fb72532a4b778562e28ba581da15067cfb2537dbd3a2e64689c1/anyio-3.6.1.tar.gz"
|
|
sha256 "413adf95f93886e442aea925f3ee43baa5a765a64a0f52c6081894f9992fdd0b"
|
|
end
|
|
|
|
resource "argon2-cffi" do
|
|
url "https://files.pythonhosted.org/packages/3f/18/20bb5b6bf55e55d14558b57afc3d4476349ab90e0c43e60f27a7c2187289/argon2-cffi-21.3.0.tar.gz"
|
|
sha256 "d384164d944190a7dd7ef22c6aa3ff197da12962bd04b17f64d4e93d934dba5b"
|
|
end
|
|
|
|
resource "argon2-cffi-bindings" do
|
|
url "https://files.pythonhosted.org/packages/b9/e9/184b8ccce6683b0aa2fbb7ba5683ea4b9c5763f1356347f1312c32e3c66e/argon2-cffi-bindings-21.2.0.tar.gz"
|
|
sha256 "bb89ceffa6c791807d1305ceb77dbfacc5aa499891d2c55661c6459651fc39e3"
|
|
end
|
|
|
|
resource "attrs" do
|
|
url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz"
|
|
sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"
|
|
end
|
|
|
|
resource "Babel" do
|
|
url "https://files.pythonhosted.org/packages/51/27/81e9cf804a34a550a47cc2f0f57fe4935281d479ae3a0ac093d69476f221/Babel-2.10.3.tar.gz"
|
|
sha256 "7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51"
|
|
end
|
|
|
|
resource "beautifulsoup4" do
|
|
url "https://files.pythonhosted.org/packages/e8/b0/cd2b968000577ec5ce6c741a54d846dfa402372369b8b6861720aa9ecea7/beautifulsoup4-4.11.1.tar.gz"
|
|
sha256 "ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693"
|
|
end
|
|
|
|
resource "bleach" do
|
|
url "https://files.pythonhosted.org/packages/c2/5d/d5d45a38163ede3342d6ac1ca01b5d387329daadf534a25718f9a9ba818c/bleach-5.0.1.tar.gz"
|
|
sha256 "0d03255c47eb9bd2f26aa9bb7f2107732e7e8fe195ca2f64709fcf3b0a4a085c"
|
|
end
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/cb/a4/7de7cd59e429bd0ee6521ba58a75adaec136d32f91a761b28a11d8088d44/certifi-2022.9.24.tar.gz"
|
|
sha256 "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
|
|
end
|
|
|
|
resource "cffi" do
|
|
url "https://files.pythonhosted.org/packages/2b/a8/050ab4f0c3d4c1b8aaa805f70e26e84d0e27004907c5b8ecc1d31815f92a/cffi-1.15.1.tar.gz"
|
|
sha256 "d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"
|
|
end
|
|
|
|
resource "charset-normalizer" do
|
|
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
|
|
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
|
|
end
|
|
|
|
resource "debugpy" do
|
|
url "https://files.pythonhosted.org/packages/8f/23/8dd369ef3a92bf5fdb4bf0cb84b721efbec43ae81b4f3694f6214b20d6d6/debugpy-1.6.3.zip"
|
|
sha256 "e8922090514a890eec99cfb991bab872dd2e353ebb793164d5f01c362b9a40bf"
|
|
end
|
|
|
|
resource "defusedxml" do
|
|
url "https://files.pythonhosted.org/packages/0f/d5/c66da9b79e5bdb124974bfe172b4daf3c984ebd9c2a06e2b8a4dc7331c72/defusedxml-0.7.1.tar.gz"
|
|
sha256 "1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"
|
|
end
|
|
|
|
resource "entrypoints" do
|
|
url "https://files.pythonhosted.org/packages/ea/8d/a7121ffe5f402dc015277d2d31eb82d2187334503a011c18f2e78ecbb9b2/entrypoints-0.4.tar.gz"
|
|
sha256 "b706eddaa9218a19ebcd67b56818f05bb27589b1ca9e8d797b74affad4ccacd4"
|
|
end
|
|
|
|
resource "fastjsonschema" do
|
|
url "https://files.pythonhosted.org/packages/7a/62/6df03bacda3544b5872d0b30f79c599ab84fc598858c77a77e1587d61ba3/fastjsonschema-2.16.2.tar.gz"
|
|
sha256 "01e366f25d9047816fe3d288cbfc3e10541daf0af2044763f3d0ade42476da18"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz"
|
|
sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"
|
|
end
|
|
|
|
resource "ipykernel" do
|
|
url "https://files.pythonhosted.org/packages/ff/6a/df4ec1ef6267ca60925e3beede9522afddd8c2d96776f7a9f7eacb2df662/ipykernel-6.16.0.tar.gz"
|
|
sha256 "7fe42c0d58435e971dc15fd42189f20d66bf35f3056bda4f6554271bc1fa3d0d"
|
|
end
|
|
|
|
resource "ipython_genutils" do
|
|
url "https://files.pythonhosted.org/packages/e8/69/fbeffffc05236398ebfcfb512b6d2511c622871dca1746361006da310399/ipython_genutils-0.2.0.tar.gz"
|
|
sha256 "eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
|
|
end
|
|
|
|
resource "Jinja2" do
|
|
url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz"
|
|
sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
|
|
end
|
|
|
|
resource "json5" do
|
|
url "https://files.pythonhosted.org/packages/47/12/611bf15000c1fc54af909565aed1ad045e5ae1890d8c56cbfe5ceaf52446/json5-0.9.10.tar.gz"
|
|
sha256 "ad9f048c5b5a4c3802524474ce40a622fae789860a86f10cc4f7e5f9cf9b46ab"
|
|
end
|
|
|
|
resource "jsonschema" do
|
|
url "https://files.pythonhosted.org/packages/65/9a/1951e3ed40115622dedc8b28949d636ee1ec69e210a52547a126cd4724e6/jsonschema-4.17.1.tar.gz"
|
|
sha256 "05b2d22c83640cde0b7e0aa329ca7754fbd98ea66ad8ae24aa61328dfe057fa3"
|
|
end
|
|
|
|
resource "jupyter-client" do
|
|
url "https://files.pythonhosted.org/packages/4d/d1/b6161a5e8639a0d35aeb59a50d944dc4928775db2408ea10b23087e354b6/jupyter_client-7.3.5.tar.gz"
|
|
sha256 "3c58466a1b8d55dba0bf3ce0834e4f5b7760baf98d1d73db0add6f19de9ecd1d"
|
|
end
|
|
|
|
resource "jupyter-console" do
|
|
url "https://files.pythonhosted.org/packages/1b/2f/acb5851aa3ed730f8cde5ec9eb0c0d9681681123f32c3b82d1536df1e937/jupyter_console-6.4.4.tar.gz"
|
|
sha256 "172f5335e31d600df61613a97b7f0352f2c8250bbd1092ef2d658f77249f89fb"
|
|
end
|
|
|
|
resource "jupyter-core" do
|
|
url "https://files.pythonhosted.org/packages/e4/e0/13fc7f8b72f39d87c1c32918a99475911b7b2f28c1a9f2734a5ab5cc35ef/jupyter_core-4.11.1.tar.gz"
|
|
sha256 "2e5f244d44894c4154d06aeae3419dd7f1b0ef4494dc5584929b398c61cfd314"
|
|
end
|
|
|
|
resource "jupyter-server" do
|
|
url "https://files.pythonhosted.org/packages/bc/0b/59dadee82f0c7d960e2a8691dc1bce0ff7dbfde107993aadfb0ff87f9763/jupyter_server-1.19.1.tar.gz"
|
|
sha256 "d1cc3596945849742bc3eedf0699feeb50ad6c6045ebef02a9298b7f13c27e9f"
|
|
end
|
|
|
|
resource "jupyterlab-pygments" do
|
|
url "https://files.pythonhosted.org/packages/69/8e/8ae01f052013ee578b297499d16fcfafb892927d8e41c1a0054d2f99a569/jupyterlab_pygments-0.2.2.tar.gz"
|
|
sha256 "7405d7fde60819d905a9fa8ce89e4cd830e318cdad22a0030f7a901da705585d"
|
|
end
|
|
|
|
resource "jupyterlab-server" do
|
|
url "https://files.pythonhosted.org/packages/17/3b/9fbc041222daeb5d518b5e5e285a07cb1acc2fa9c94ebb393d249d2ea046/jupyterlab_server-2.15.2.tar.gz"
|
|
sha256 "c0bcdd4606e640e6f16d236ceac55336dc8bf98cbbce067af27524ccc2fb2640"
|
|
end
|
|
|
|
resource "MarkupSafe" do
|
|
url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz"
|
|
sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"
|
|
end
|
|
|
|
resource "mistune" do
|
|
url "https://files.pythonhosted.org/packages/cd/9b/0f98334812f548a5ee4399b76e33752a74fc7bb976f5efb34d962f03d585/mistune-2.0.4.tar.gz"
|
|
sha256 "9ee0a66053e2267aba772c71e06891fa8f1af6d4b01d5e84e267b4570d4d9808"
|
|
end
|
|
|
|
resource "nbclassic" do
|
|
url "https://files.pythonhosted.org/packages/a3/da/35f31f63d0bb6bec9e1e631ce3664ab99c135951a2a713708577f6ba8f80/nbclassic-0.4.4.tar.gz"
|
|
sha256 "f6c4fbac2c5efc6f5e7c02a69f5359a6040b90ac648719990d059bdec380afec"
|
|
end
|
|
|
|
resource "nbclient" do
|
|
url "https://files.pythonhosted.org/packages/01/21/917a25fbc2b37ed37135be97efb4c98526008505451ffa841adcd7d11ed5/nbclient-0.6.8.tar.gz"
|
|
sha256 "268fde3457cafe1539e32eb1c6d796bbedb90b9e92bacd3e43d83413734bb0e8"
|
|
end
|
|
|
|
resource "nbconvert" do
|
|
url "https://files.pythonhosted.org/packages/1f/1e/4689f4876a2871f25092dea6e6edb8c87619e54fd9cdfdf794c1676f315d/nbconvert-7.1.0.tar.gz"
|
|
sha256 "308c9648ebd20823cfd5af12202ac0ef5f8913fe35b51e72db28d2ca0f66a598"
|
|
end
|
|
|
|
resource "nbformat" do
|
|
url "https://files.pythonhosted.org/packages/44/08/6819f06aba37c6262911b0165e2680fa5e691d72b8f63634869cb4aad656/nbformat-5.6.1.tar.gz"
|
|
sha256 "146b5b9969391387c2089256359f5da7c718b1d8a88ba814320273ea410e646e"
|
|
end
|
|
|
|
resource "nest-asyncio" do
|
|
url "https://files.pythonhosted.org/packages/35/76/64c51c1cbe704ad79ef6ec82f232d1893b9365f2ff194111787dc91b004f/nest_asyncio-1.5.6.tar.gz"
|
|
sha256 "d267cc1ff794403f7df692964d1d2a3fa9418ffea2a3f6859a439ff482fef290"
|
|
end
|
|
|
|
resource "notebook" do
|
|
url "https://files.pythonhosted.org/packages/d5/94/b15c0e44c37e49cf77866ff56cc7644632229b79c113a0eafd908fc7c7d7/notebook-6.4.12.tar.gz"
|
|
sha256 "6268c9ec9048cff7a45405c990c29ac9ca40b0bc3ec29263d218c5e01f2b4e86"
|
|
end
|
|
|
|
resource "notebook-shim" do
|
|
url "https://files.pythonhosted.org/packages/80/14/215050c5ee184bd60e7d1e9e7e68d09c4dcacb18d3fb49c1fff4e061b94f/notebook_shim-0.1.0.tar.gz"
|
|
sha256 "7897e47a36d92248925a2143e3596f19c60597708f7bef50d81fcd31d7263e85"
|
|
end
|
|
|
|
resource "packaging" do
|
|
url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz"
|
|
sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"
|
|
end
|
|
|
|
resource "pandocfilters" do
|
|
url "https://files.pythonhosted.org/packages/62/42/c32476b110a2d25277be875b82b5669f2cdda7897c165bd22b78f366b3cb/pandocfilters-1.5.0.tar.gz"
|
|
sha256 "0b679503337d233b4339a817bfc8c50064e2eff681314376a47cb582305a7a38"
|
|
end
|
|
|
|
resource "prometheus-client" do
|
|
url "https://files.pythonhosted.org/packages/98/71/2f16cce64055263146eff950affe7b1ab2ff78736ff0d2b5578bc0817e49/prometheus_client-0.14.1.tar.gz"
|
|
sha256 "5459c427624961076277fdc6dc50540e2bacb98eebde99886e59ec55ed92093a"
|
|
end
|
|
|
|
resource "psutil" do
|
|
url "https://files.pythonhosted.org/packages/8f/57/828ac1f70badc691a716e77bfae258ef5db76bb7830109bf4bcf882de020/psutil-5.9.2.tar.gz"
|
|
sha256 "feb861a10b6c3bb00701063b37e4afc754f8217f0f09c42280586bd6ac712b5c"
|
|
end
|
|
|
|
resource "pycparser" do
|
|
url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz"
|
|
sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
|
|
end
|
|
|
|
resource "pyparsing" do
|
|
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
|
|
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
|
|
end
|
|
|
|
resource "pyrsistent" do
|
|
url "https://files.pythonhosted.org/packages/b8/ef/325da441a385a8a931b3eeb70db23cb52da42799691988d8d943c5237f10/pyrsistent-0.19.2.tar.gz"
|
|
sha256 "bfa0351be89c9fcbcb8c9879b826f4353be10f58f8a677efab0c017bf7137ec2"
|
|
end
|
|
|
|
resource "python-dateutil" do
|
|
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
|
|
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
|
|
end
|
|
|
|
resource "pytz" do
|
|
url "https://files.pythonhosted.org/packages/31/da/2d48d3499b59c7f3c5d5e1c79fcee5537c320c8ab7b7a0cd2db578bc34b3/pytz-2022.4.tar.gz"
|
|
sha256 "48ce799d83b6f8aab2020e369b627446696619e79645419610b9facd909b3174"
|
|
end
|
|
|
|
resource "pyzmq" do
|
|
url "https://files.pythonhosted.org/packages/46/0d/b06cf99a64d4187632f4ac9ddf6be99cd35de06fe72d75140496a8e0eef5/pyzmq-24.0.1.tar.gz"
|
|
sha256 "216f5d7dbb67166759e59b0479bca82b8acf9bed6015b526b8eb10143fb08e77"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
|
|
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
|
|
end
|
|
|
|
resource "Send2Trash" do
|
|
url "https://files.pythonhosted.org/packages/49/2c/d990b8d5a7378dde856f5a82e36ed9d6061b5f2d00f39dc4317acd9538b4/Send2Trash-1.8.0.tar.gz"
|
|
sha256 "d2c24762fd3759860a0aff155e45871447ea58d2be6bdd39b5c8f966a0c99c2d"
|
|
end
|
|
|
|
resource "sniffio" do
|
|
url "https://files.pythonhosted.org/packages/cd/50/d49c388cae4ec10e8109b1b833fd265511840706808576df3ada99ecb0ac/sniffio-1.3.0.tar.gz"
|
|
sha256 "e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"
|
|
end
|
|
|
|
resource "soupsieve" do
|
|
url "https://files.pythonhosted.org/packages/f3/03/bac179d539362319b4779a00764e95f7542f4920084163db6b0fd4742d38/soupsieve-2.3.2.post1.tar.gz"
|
|
sha256 "fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d"
|
|
end
|
|
|
|
resource "terminado" do
|
|
url "https://files.pythonhosted.org/packages/e2/93/eb3fac361b6d47ae0e4f602839d0b028825b94aa70b91936f7a3e85a7973/terminado-0.16.0.tar.gz"
|
|
sha256 "fac14374eb5498bdc157ed32e510b1f60d5c3c7981a9f5ba018bb9a64cec0c25"
|
|
end
|
|
|
|
resource "tinycss2" do
|
|
url "https://files.pythonhosted.org/packages/1e/5a/576828164b5486f319c4323915b915a8af3fa4a654bbb6f8fc8e87b5cb17/tinycss2-1.1.1.tar.gz"
|
|
sha256 "b2e44dd8883c360c35dd0d1b5aad0b610e5156c2cb3b33434634e539ead9d8bf"
|
|
end
|
|
|
|
resource "tomli" do
|
|
url "https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3/tomli-2.0.1.tar.gz"
|
|
sha256 "de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
|
|
end
|
|
|
|
resource "tornado" do
|
|
url "https://files.pythonhosted.org/packages/f3/9e/225a41452f2d9418d89be5e32cf824c84fe1e639d350d6e8d49db5b7f73a/tornado-6.2.tar.gz"
|
|
sha256 "9b630419bde84ec666bfd7ea0a4cb2a8a651c2d5cccdbdd1972a0c859dfc3c13"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
|
|
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
|
|
end
|
|
|
|
resource "webencodings" do
|
|
url "https://files.pythonhosted.org/packages/0b/02/ae6ceac1baeda530866a85075641cec12989bd8d31af6d5ab4a3e8c92f47/webencodings-0.5.1.tar.gz"
|
|
sha256 "b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
|
|
end
|
|
|
|
resource "websocket-client" do
|
|
url "https://files.pythonhosted.org/packages/99/11/01fe7ebcb7545a1990c53c11f31230afe1388b0b34256e3fd20e49482245/websocket-client-1.4.1.tar.gz"
|
|
sha256 "f9611eb65c8241a67fb373bef040b3cf8ad377a9f6546a12b620b6511e8ea9ef"
|
|
end
|
|
|
|
def python3
|
|
"python3.11"
|
|
end
|
|
|
|
def install
|
|
venv = virtualenv_create(libexec, python3)
|
|
ENV["JUPYTER_PATH"] = etc/"jupyter"
|
|
|
|
site_packages = Language::Python.site_packages(python3)
|
|
%w[ipython].each do |package_name|
|
|
package = Formula[package_name].opt_libexec
|
|
(libexec/site_packages/"homebrew-#{package_name}.pth").write package/site_packages
|
|
end
|
|
|
|
# gather packages to link based on options
|
|
linked_hatch = %w[jupyter-core jupyter-client nbformat ipykernel nbconvert]
|
|
linked_setuptools = %w[jupyter-console notebook]
|
|
unlinked_hatch = %w[jupyterlab-server]
|
|
unlinked_setuptools = resources.map(&:name).to_set - linked_hatch - linked_setuptools - unlinked_hatch
|
|
|
|
# `jupyterlab-pygments` requires `jupyterlab` to build. Since Homebrew doesn't
|
|
# allow circular dependencies, we locally build a `jupyterlab-pygments` wheel
|
|
# using the pre-built PyPI wheels for `jupyterlab` and its dependencies.
|
|
unlinked_setuptools -= ["jupyterlab-pygments"]
|
|
resource("jupyterlab-pygments").stage do
|
|
pybuild = Formula["python-build"].opt_bin/"pyproject-build"
|
|
system pybuild, "--wheel"
|
|
venv.pip_install Dir["dist/jupyterlab_pygments-*.whl"].first
|
|
end
|
|
|
|
hatch = Formula["hatch"].opt_bin/"hatch"
|
|
|
|
# install remaining packages into virtualenv and link specified packages
|
|
unlinked_setuptools.each do |r|
|
|
venv.pip_install resource(r)
|
|
end
|
|
unlinked_hatch.each do |r|
|
|
resource(r).stage do
|
|
system hatch, "build", "-t", "wheel"
|
|
venv.pip_install Dir["dist/*.whl"].first
|
|
end
|
|
end
|
|
linked_setuptools.each do |r|
|
|
venv.pip_install_and_link resource(r)
|
|
end
|
|
linked_hatch.each do |r|
|
|
resource(r).stage do
|
|
system hatch, "build", "-t", "wheel"
|
|
venv.pip_install_and_link Dir["dist/*.whl"].first
|
|
end
|
|
end
|
|
|
|
venv.pip_install_and_link buildpath
|
|
|
|
# remove bundled kernel
|
|
(libexec/"share/jupyter/kernels").rmtree
|
|
|
|
# remove non-native binaries
|
|
if OS.mac? && Hardware::CPU.arm?
|
|
site_packages = libexec/Language::Python.site_packages(python3)
|
|
(site_packages/"debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86_64.dylib").unlink
|
|
end
|
|
|
|
# install completion
|
|
resource("jupyter-core").stage do
|
|
bash_completion.install "examples/jupyter-completion.bash" => "jupyter"
|
|
zsh_completion.install "examples/completions-zsh" => "_jupyter"
|
|
end
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
Additional kernels can be installed into the shared jupyter directory
|
|
#{etc}/jupyter
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system bin/"jupyter-console --help"
|
|
assert_match python3, shell_output("#{bin}/jupyter kernelspec list")
|
|
|
|
(testpath/"console.exp").write <<~EOS
|
|
spawn #{bin}/jupyter-console
|
|
expect "In "
|
|
send "exit\r"
|
|
EOS
|
|
assert_match "Jupyter console", shell_output("expect -f console.exp")
|
|
|
|
(testpath/"notebook.exp").write <<~EOS
|
|
spawn #{bin}/jupyter-notebook --no-browser
|
|
expect "NotebookApp"
|
|
EOS
|
|
assert_match "NotebookApp", shell_output("expect -f notebook.exp")
|
|
|
|
(testpath/"nbconvert.ipynb").write <<~EOS
|
|
{
|
|
"cells": []
|
|
}
|
|
EOS
|
|
system bin/"jupyter-nbconvert", "nbconvert.ipynb", "--to", "html"
|
|
assert_predicate testpath/"nbconvert.html", :exist?, "Failed to export HTML"
|
|
|
|
assert_match "-F _jupyter",
|
|
shell_output("bash -c \"source #{bash_completion}/jupyter && complete -p jupyter\"")
|
|
|
|
# Ensure that jupyter can load the jupyter lab package.
|
|
assert_match(/^jupyterlab *: #{version}$/,
|
|
shell_output(bin/"jupyter --version"))
|
|
|
|
# Ensure that jupyter-lab binary was installed by pip.
|
|
assert_equal version.to_s,
|
|
shell_output(bin/"jupyter-lab --version").strip
|
|
|
|
port = free_port
|
|
fork { exec "#{bin}/jupyter-lab", "-y", "--port=#{port}", "--no-browser", "--ip=127.0.0.1", "--LabApp.token=''" }
|
|
sleep 10
|
|
assert_match "<title>JupyterLab</title>",
|
|
shell_output("curl --silent --fail http://localhost:#{port}/lab")
|
|
end
|
|
end
|