python-gdbm@3.11 3.11.0 (new formula)

Closes #113811.

Signed-off-by: Michka Popoff <3406519+iMichka@users.noreply.github.com>
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Bo Anderson 2022-10-23 00:36:38 +01:00 committed by BrewTestBot
parent 5dece0a93f
commit bbc525d4bf
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
3 changed files with 55 additions and 0 deletions

1
Aliases/python-gdbm Symbolic link
View File

@ -0,0 +1 @@
../Formula/python-gdbm@3.11.rb

View File

@ -0,0 +1,53 @@
class PythonGdbmAT311 < Formula
desc "Python interface to gdbm"
homepage "https://www.python.org/"
url "https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz"
sha256 "64424e96e2457abbac899b90f9530985b51eef2905951febd935f0e73414caeb"
license "Python-2.0"
livecheck do
formula "python@3.11"
end
depends_on "gdbm"
depends_on "python@3.11"
def python3
"python3.11"
end
def install
cd "Modules" do
(Pathname.pwd/"setup.py").write <<~EOS
from setuptools import setup, Extension
setup(name="gdbm",
description="#{desc}",
version="#{version}",
ext_modules = [
Extension("_gdbm", ["_gdbmmodule.c"],
include_dirs=["#{Formula["gdbm"].opt_include}"],
libraries=["gdbm"],
library_dirs=["#{Formula["gdbm"].opt_lib}"])
]
)
EOS
system python3, *Language::Python.setup_install_args(libexec, python3),
"--install-lib=#{libexec}"
rm_r libexec.glob("*.egg-info")
end
end
test do
testdb = testpath/"test.db"
system python3, "-c", <<~EOS
import dbm.gnu
with dbm.gnu.open("#{testdb}", "n") as db:
db["testkey"] = "testvalue"
with dbm.gnu.open("#{testdb}", "r") as db:
assert db["testkey"] == b"testvalue"
EOS
end
end

View File

@ -31,6 +31,7 @@
"python@3.9", "python@3.9",
"python@3.10", "python@3.10",
"python@3.11", "python@3.11",
"python-gdbm@3.11",
"python-tk@3.9", "python-tk@3.9",
"python-tk@3.10", "python-tk@3.10",
"python-tk@3.11", "python-tk@3.11",