homebrew-core/Formula/flit.rb

90 lines
4.0 KiB
Ruby

class Flit < Formula
include Language::Python::Virtualenv
desc "Simplified packaging of Python modules"
homepage "https://github.com/takluyver/flit"
url "https://files.pythonhosted.org/packages/43/9c/59e673d4881dea932051e79d69779b6d02a87c4851dd58a86dd09ba57692/flit-3.6.0.tar.gz"
sha256 "b1464e006df4df4c8eeb37671c0e0ce66e1d04e4a36d91b702f180a25fde3c11"
license "BSD-3-Clause"
head "https://github.com/takluyver/flit.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "bb177fe09a7ed961572919cedc21deadf9bfd3c957fcfe68913656a0d8d63033"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d883d673947e7f35299c661c5af16cb6051752987dfd190333d1cfc2705c7d48"
sha256 cellar: :any_skip_relocation, monterey: "94aca99c5298f42e39f92be9ffe95d204fdec55df781efb968e14fb0478cf94d"
sha256 cellar: :any_skip_relocation, big_sur: "39e8595fb2e9889dab671fb417fe166300ac73a54bcd1ead0eea42cfb85f8e8f"
sha256 cellar: :any_skip_relocation, catalina: "efe0768d34cfae6659cbadaf34818125c1c2d059ef0977d71e3bb912c6e99be4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "09e7a3f701b67a604d53ae24e12a2115c33067ff7a2408e45895cb995f912877"
end
depends_on "python@3.10"
resource "certifi" do
url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz"
sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/68/e4/e014e7360fc6d1ccc507fe0b563b4646d00e0d4f9beec4975026dd15850b/charset-normalizer-2.0.9.tar.gz"
sha256 "b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/57/b1/b880503681ea1b64df05106fc7e3c4e3801736cf63deffc6fa7fc5404cf5/docutils-0.18.1.tar.gz"
sha256 "679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"
end
resource "flit-core" do
url "https://files.pythonhosted.org/packages/08/e9/0653f7783ba2ec2f954f19442878427f1d5bfccb01842d354453c2809b22/flit_core-3.6.0.tar.gz"
sha256 "5892962ab8b8ea945835b3a288fe9dd69316f1903d5288c3f5cafdcdd04756ad"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz"
sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/e7/01/3569e0b535fb2e4a6c384bdbed00c55b9d78b5084e0fb7f4d0bf523d7670/requests-2.26.0.tar.gz"
sha256 "b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"
end
resource "tomli" do
url "https://files.pythonhosted.org/packages/3d/6e/d290c9bf16159f02b70c432386aa5bfe22c2857ff460591912fd907b61f6/tomli-2.0.0.tar.gz"
sha256 "c292c34f58502a1eb2bbb9f5bbc9a5ebc37bee10ffb8c2d6bbdfa8eb13cc14e1"
end
resource "tomli-w" do
url "https://files.pythonhosted.org/packages/49/05/6bf21838623186b91aedbda06248ad18f03487dc56fbc20e4db384abde6c/tomli_w-1.0.0.tar.gz"
sha256 "f463434305e0336248cac9c2dc8076b707d8a12d019dd349f5c1e382dd1ae1b9"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/80/be/3ee43b6c5757cabea19e75b8f46eaf05a2f5144107d7db48c7cf3a864f73/urllib3-1.26.7.tar.gz"
sha256 "4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"
end
def install
virtualenv_install_with_resources
end
test do
(testpath/"sample.py").write <<~END
"""A sample package"""
__version__ = "0.1"
END
(testpath/"pyproject.toml").write <<~END
[build-system]
requires = ["flit_core"]
build-backend = "flit_core.buildapi"
[tool.flit.metadata]
module = "sample"
author = "Sample Author"
END
system bin/"flit", "build"
assert_predicate testpath/"dist/sample-0.1-py2.py3-none-any.whl", :exist?
assert_predicate testpath/"dist/sample-0.1.tar.gz", :exist?
end
end