parent
fad979d9ea
commit
5b9aabdfc7
|
@ -0,0 +1,52 @@
|
|||
class Snakefmt < Formula
|
||||
include Language::Python::Virtualenv
|
||||
|
||||
desc "Snakemake code formatter"
|
||||
homepage "https://github.com/snakemake/snakefmt/"
|
||||
url "https://files.pythonhosted.org/packages/ae/28/eea4835079021f73ce4855349b721eaed86b3c1d6883d3a506b2e7e23a63/snakefmt-0.7.0.tar.gz"
|
||||
sha256 "71c65050666c7300426d9c0b89aca80ccae8b15ade527d87b4ae9388e3fe567a"
|
||||
license "MIT"
|
||||
head "https://github.com/snakemake/snakefmt.git", branch: "master"
|
||||
|
||||
depends_on "black"
|
||||
depends_on "python@3.11"
|
||||
|
||||
resource "importlib-metadata" do
|
||||
url "https://files.pythonhosted.org/packages/e2/ae/0b037584024c1557e537d25482c306cf6327b5a09b6c4b893579292c1c38/importlib_metadata-1.7.0.tar.gz"
|
||||
sha256 "90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"
|
||||
end
|
||||
|
||||
resource "toml" do
|
||||
url "https://files.pythonhosted.org/packages/be/ba/1f744cdc819428fc6b5084ec34d9b30660f6f9daaf70eead706e3203ec3c/toml-0.10.2.tar.gz"
|
||||
sha256 "b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"
|
||||
end
|
||||
|
||||
resource "zipp" do
|
||||
url "https://files.pythonhosted.org/packages/8e/b3/8b16a007184714f71157b1a71bbe632c5d66dd43bc8152b3c799b13881e1/zipp-3.11.0.tar.gz"
|
||||
sha256 "a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766"
|
||||
end
|
||||
|
||||
def install
|
||||
virtualenv_install_with_resources
|
||||
|
||||
site_packages = Language::Python.site_packages("python3.11")
|
||||
black = Formula["black"].opt_libexec
|
||||
(libexec/site_packages/"homebrew-black.pth").write black/site_packages
|
||||
end
|
||||
|
||||
test do
|
||||
test_file = testpath/"Snakefile"
|
||||
test_file.write <<~EOS
|
||||
rule testme:
|
||||
output:
|
||||
"test.out"
|
||||
shell:
|
||||
"touch {output}"
|
||||
EOS
|
||||
test_output = shell_output("#{bin}/snakefmt --check #{test_file} 2>&1", 1)
|
||||
assert_match "[INFO] 1 file(s) would be changed 😬", test_output
|
||||
|
||||
assert_match "snakefmt, version #{version}",
|
||||
shell_output("#{bin}/snakefmt --version")
|
||||
end
|
||||
end
|
|
@ -570,6 +570,11 @@
|
|||
"shallow-backup": {
|
||||
"exclude_packages": ["six"]
|
||||
},
|
||||
"snakefmt": {
|
||||
"exclude_packages": [
|
||||
"pathspec", "black", "click", "mypy-extensions", "platformdirs"
|
||||
]
|
||||
},
|
||||
"snakemake": {
|
||||
"exclude_packages": ["tabulate", "PyYAML", "jsonschema", "attrs", "pyrsistent", "docutils"]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue