-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(basedpyright): use python installation
- Loading branch information
Showing
1 changed file
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
require "language/node" | ||
|
||
class Basedpyright < Formula | ||
include Language::Python::Virtualenv | ||
|
||
desc "Pyright fork with various improvements and built-in pylance features" | ||
homepage "https://github.com/DetachHead/basedpyright" | ||
url "https://github.com/DetachHead/basedpyright/archive/refs/tags/v1.15.1.tar.gz" | ||
sha256 "51fb7cfc0ad1eae6073c4b6360466f7f696b8b25b5779aee20589a4e01d3dd22" | ||
url "https://files.pythonhosted.org/packages/10/56/0b764d7a0495a727057657d9541833be13467a0c36b8970cbe4ed8b9891a/basedpyright-1.15.1.tar.gz" | ||
sha256 "76e67453a3c3839506952de9f620d55aa1e3fcf2dbb276405df878bc83a185ee" | ||
license "MIT" | ||
revision 1 | ||
|
||
bottle do | ||
root_url "https://github.com/nikaro/homebrew-tap/releases/download/basedpyright-1.15.1" | ||
sha256 cellar: :any_skip_relocation, arm64_sonoma: "4c89a246d46f47cbda0ead165c15ab074c729d997d34885476f2132fc7316878" | ||
sha256 cellar: :any_skip_relocation, x86_64_linux: "161b32f442fb5c50e63b39f8753fb4e1c76258f96dfe25e178f8cdbf2bb34f93" | ||
end | ||
depends_on "cmake" => :build | ||
depends_on "rust" => :build | ||
depends_on "[email protected]" | ||
|
||
depends_on "node" | ||
resource "nodejs-wheel-binaries" do | ||
url "https://files.pythonhosted.org/packages/36/7a/9c3e424382eda040b01f344b7a64b11d2e4decc2c6d381f7ca68751603f8/nodejs_wheel_binaries-20.16.0.tar.gz" | ||
sha256 "85649da01bb3d0d3c9237d28545180254cda5417b4e2c219f53face0103fb2bf" | ||
end | ||
|
||
def install | ||
chdir "packages/pyright" do | ||
system "npm", "install", *Language::Node.std_npm_install_args(libexec) | ||
end | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
virtualenv_install_with_resources | ||
end | ||
|
||
test do | ||
Check warning on line 24 in Formula/basedpyright.rb
|
||
(testpath/"broken.py").write <<~EOS | ||
def wrong_types(a: int, b: int) -> str: | ||
return a + b | ||
EOS | ||
output = pipe_output("#{bin}/pyright broken.py 2>&1") | ||
assert_match "error: Expression of type \"int\" is incompatible with return type \"str\"", output | ||
end | ||
end |