Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.10.0 #84626

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Formula/python-tk@3.10.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
class PythonTkAT310 < Formula
desc "Python interface to Tcl/Tk"
homepage "https://www.python.org/"
# Keep in sync with python@3.10.
url "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz"
sha256 "c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758"
license "Python-2.0"

livecheck do
formula "python@3.10"
end

depends_on "python@3.10"
depends_on "tcl-tk"

def install
cd "Modules" do
tcltk_version = Formula["tcl-tk"].any_installed_version.major_minor
(Pathname.pwd/"setup.py").write <<~EOS
from setuptools import setup, Extension

setup(name="tkinter",
description="#{desc}",
version="#{version}",
ext_modules = [
Extension("_tkinter", ["_tkinter.c", "tkappinit.c"],
define_macros=[("WITH_APPINIT", 1)],
include_dirs=["#{Formula["tcl-tk"].opt_include}"],
libraries=["tcl#{tcltk_version}", "tk#{tcltk_version}"],
library_dirs=["#{Formula["tcl-tk"].opt_lib}"])
]
)
EOS
system Formula["python@3.10"].bin/"python3", *Language::Python.setup_install_args(libexec),
"--install-lib=#{libexec}"
rm_r Dir[libexec/"*.egg-info"]
end
end

test do
system Formula["python@3.10"].bin/"python3", "-c", "import tkinter"

on_linux do
# tk does not work in headless mode
return if ENV["HOMEBREW_GITHUB_ACTIONS"]
end

system Formula["python@3.10"].bin/"python3", "-c", "import tkinter; root = tkinter.Tk()"
end
end
Loading