From dcc3158e56e02fffd685b6cf58d7f3278fdb98a2 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 23 Nov 2022 17:29:24 -0500 Subject: [PATCH] semgrep: migrate to python@3.11, drop jsonschema dep Closes #116546. Signed-off-by: Rui Chen Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/semgrep.rb | 25 +++++++++++++++++-------- pypi_formula_mappings.json | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Formula/semgrep.rb b/Formula/semgrep.rb index 64de639362e..287160b0be2 100644 --- a/Formula/semgrep.rb +++ b/Formula/semgrep.rb @@ -32,16 +32,20 @@ class Semgrep < Formula depends_on "opam" => :build depends_on "pipenv" => :build depends_on "pkg-config" => :build - depends_on "jsonschema" depends_on "pcre" depends_on "python-typing-extensions" - depends_on "python@3.10" + depends_on "python@3.11" depends_on "tree-sitter" uses_from_macos "rsync" => :build fails_with gcc: "5" + resource "attrs" do + url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz" + sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6" + end + resource "boltons" do url "https://files.pythonhosted.org/packages/ad/1f/6c0608d86e0fc77c982a2923ece80eef85f091f2332fc13cbce41d70d502/boltons-21.0.0.tar.gz" sha256 "65e70a79a731a7fe6e98592ecfb5ccf2115873d01dbc576079874629e5c90f13" @@ -97,6 +101,11 @@ class Semgrep < Formula sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4" end + resource "jsonschema" do + url "https://files.pythonhosted.org/packages/65/9a/1951e3ed40115622dedc8b28949d636ee1ec69e210a52547a126cd4724e6/jsonschema-4.17.1.tar.gz" + sha256 "05b2d22c83640cde0b7e0aa329ca7754fbd98ea66ad8ae24aa61328dfe057fa3" + end + resource "packaging" do url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz" sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb" @@ -112,6 +121,11 @@ class Semgrep < Formula 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-lsp-jsonrpc" do url "https://files.pythonhosted.org/packages/99/45/1c2a272950679af529f7360af6ee567ef266f282e451be926329e8d50d84/python-lsp-jsonrpc-1.0.0.tar.gz" sha256 "7bec170733db628d3506ea3a5288ff76aa33c70215ed223abdb0d95e957660bd" @@ -194,15 +208,10 @@ class Semgrep < Formula ENV["SEMGREP_SKIP_BIN"] = "1" python_path = "cli" cd python_path do - venv = virtualenv_create(libexec, Formula["python@3.10"].bin/"python3.10") + venv = virtualenv_create(libexec, Formula["python@3.11"].bin/"python3.11") venv.pip_install resources.reject { |r| r.name == "ocaml-tree-sitter" } venv.pip_install_and_link buildpath/python_path end - - # we depend on jsonschema, but that's a separate formula, so install a `.pth` file to link them - site_packages = Language::Python.site_packages("python3.10") - jsonschema = Formula["jsonschema"].opt_libexec - (libexec/site_packages/"homebrew-jsonschema.pth").write jsonschema/site_packages end test do diff --git a/pypi_formula_mappings.json b/pypi_formula_mappings.json index c41674dbe60..eab7e93c6e4 100644 --- a/pypi_formula_mappings.json +++ b/pypi_formula_mappings.json @@ -566,7 +566,7 @@ }, "semgrep": { "package_name": "semgrep", - "exclude_packages": ["jsonschema", "attrs", "pyrsistent", "typing-extensions"] + "exclude_packages": ["typing-extensions"] }, "sgr": { "exclude_packages": ["typing-extensions", "jsonschema", "attrs", "pyrsistent"]