diff --git a/Aliases/python-gdbm b/Aliases/python-gdbm new file mode 120000 index 00000000000..f93d61d13b9 --- /dev/null +++ b/Aliases/python-gdbm @@ -0,0 +1 @@ +../Formula/python-gdbm@3.11.rb \ No newline at end of file diff --git a/Formula/python-gdbm@3.11.rb b/Formula/python-gdbm@3.11.rb new file mode 100644 index 00000000000..7131f74f532 --- /dev/null +++ b/Formula/python-gdbm@3.11.rb @@ -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 diff --git a/audit_exceptions/versioned_keg_only_allowlist.json b/audit_exceptions/versioned_keg_only_allowlist.json index a7237e02bde..9cacfbb989e 100644 --- a/audit_exceptions/versioned_keg_only_allowlist.json +++ b/audit_exceptions/versioned_keg_only_allowlist.json @@ -31,6 +31,7 @@ "python@3.9", "python@3.10", "python@3.11", + "python-gdbm@3.11", "python-tk@3.9", "python-tk@3.10", "python-tk@3.11",