homebrew-core/Formula/flit.rb

83 lines
3.5 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/eb/4b/be073a75a7ce2848b806327b95d529d31357d610778227eaabcac91c0024/flit-3.1.0.tar.gz"
sha256 "c45104d677572958cbe63ae99011bed16b6e1cf5d6620bc6a8c6f1cfcd7aa40b"
license "BSD-3-Clause"
head "https://github.com/takluyver/flit.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "2602eae9c5965f0ac1c98204f2e3bb624dce58237535d557bed1eba5a2ab1efa"
sha256 cellar: :any_skip_relocation, big_sur: "1e8c0e36b659387b1900f68f227bafd45832cff674e67fb0d6be3a9cceee39f1"
sha256 cellar: :any_skip_relocation, catalina: "8e61d34bb46534dd55a10db72279c14ef736bbda645a3a94ef69ee88fce83307"
sha256 cellar: :any_skip_relocation, mojave: "61ff0711ab473f56de9e2620ee0cd5da765b819c40158c6fd72e1af3bbd2f848"
end
depends_on "python@3.9"
resource "certifi" do
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz"
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz"
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/2f/e0/3d435b34abd2d62e8206171892f174b180cd37b09d57b924ca5c2ef2219d/docutils-0.16.tar.gz"
sha256 "c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
end
resource "flit-core" do
url "https://files.pythonhosted.org/packages/4c/8f/bed80c03f71cb3a2935882f391b53d2510c359191e5e0361650fa02d1365/flit_core-3.1.0.tar.gz"
sha256 "22ff73be39a2b3c9e0692dfbbea3ad4a9d127e5733736a87dbb8ddcbf7309b1e"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/6b/47/c14abc08432ab22dc18b9892252efaf005ab44066de871e72a38d6af464b/requests-2.25.1.tar.gz"
sha256 "27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"
end
resource "toml" do
url "https://files.pythonhosted.org/packages/be/ba/1f744cdc819428fc6b5084ec34d9b30660f6f9daaf70eead706e3203ec3c/toml-0.10.2.tar.gz"
sha256 "b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/d7/8d/7ee68c6b48e1ec8d41198f694ecdc15f7596356f2ff8e6b1420300cf5db3/urllib3-1.26.3.tar.gz"
sha256 "de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"
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