Python 3.12.0 (#8728)

* Add python buildsystem

* tk rebuild

* Initial x86_64,i686 python 3.12 builds

* update meson package

* update python3 to have all compat

* update packages

* Add PYTHON env variable.

* add arm build

* update x86_64 binary

* add i686 binary

* update more packages

* fixup

* fixup

* updates

* fixup

* updates

* updates

* refactor python buildsystem

* refactor python buildsystem

* adjust buildsystems/python

* refactor buildsystems/python

* refactor some core py3 packages

* python package rebuilds

* fix package versioning

* update asciidoc

* update libxml2

* update itstool and py3_libxml2

* boost => 1.83

* update gnome packages

* update py3_pip

* update xcb_proto

* add pip buildsystem

* py3_websockets using pip buildsystem

* more pip updates

* update cython, libnghttp2

* update py3_packaging, py3_pyparsing

* rebuild libcaca

* update talloc, tevent

* update tdb

* update lmdb

* update py3_dnsmarkdown, py3_markdown

* update ldb

* fixup

* fix cmake llvm dep

* update py3_pyyaml

* more llvm17 adjustments

* update py3_pygments

* fixup

* smbclient => 4.19.0

* update py3_abimap

* update py3_pytz

* update py3_wcwidth py3_pyte

* build py3_xlrd.rb py3_et_xmlfile.rb py3_openpyxl.rb py3_olefile.rb py3_babel.rb

* py3_six

* build py3_pyicu.rb py3_pytimeparse.rb py3_text_unidecode.rb py3_slugify.rb py3_isodate.rb py3_leather.rb py3_parsedatetime.rb py3_agate.rb py3_agate_excel.rb

* update py3_packaging

* py3_dbfread.rb  py3_agate_dfb.rb py3_sqlalchemy.rb py3_agate_sql.rb

* py3_alabaster.rb py3_argcomplete.rb py3_appdirs.rb py3_click.rb

* add py3_soupsieve

* rebuild gstreamer for libvpx, build py3_editables.rb py3_pathspec.rb py3_pluggy.rb py3_trove_classifiers.rb py3_hatchling.rb py3_hatch_vcs.rb py3_hatch_fancy_pypi_readme.rb py3_attrs.rb py3_beautifulsoup4.rb py3_dateutil.rb py3_arrow.rb

* build py3_setuptools_scm.rb py3_semantic_version.rb py3_typing_extensions.rb py3_setuptools_rust.rb

* rebuild qtbase

* fixup packages

* update cpython

* make pip/python use nproc

* update numpy, but remove binaries

* Convert remaining python packages to pip without binaries

* add new packages to packages.yaml

* remove pip binaries

* refactor pip

* align pip update code betwen python3 and py3_pip

* fixup

* py3_pip needs building

* adjust depends logic

* refactor pip dependency

* bump buildessential

* bump version

* cleanup

* refactor pip

* switch py3_build to pip

* fixup depends ordering

* add spacing before no_compile_needed

* add missing no_compile_needed
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2023-10-06 16:41:29 -04:00
committed by GitHub
parent dfbda78fdf
commit 2d8645cd42
450 changed files with 58896 additions and 57426 deletions

View File

@@ -3,23 +3,23 @@ require 'package'
class Python3 < Package
description 'Python is a programming language that lets you work quickly and integrate systems more effectively.'
homepage 'https://www.python.org/'
version '3.11.5'
version '3.12.0'
license 'PSF-2.0'
compatibility 'all'
source_url "https://www.python.org/ftp/python/#{version}/Python-#{version}.tar.xz"
source_sha256 '85cd12e9cf1d6d5a45f17f7afe1cebe7ee628d3282281c492e86adf636defa3f'
source_sha256 '795c34f44df45a0e9b9710c8c71c15c671871524cd412ca14def212e8ccb155d'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.5_armv7l/python3-3.11.5-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.5_armv7l/python3-3.11.5-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.5_i686/python3-3.11.5-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.5_x86_64/python3-3.11.5-chromeos-x86_64.tar.zst'
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.12.0_armv7l/python3-3.12.0-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.12.0_armv7l/python3-3.12.0-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.12.0_i686/python3-3.12.0-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.12.0_x86_64/python3-3.12.0-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: '2a18f192044dde5208e8c40a43b15b2683526dc4ae44884b229e60cf4a85ff66',
armv7l: '2a18f192044dde5208e8c40a43b15b2683526dc4ae44884b229e60cf4a85ff66',
i686: '8ef1e1c7d7c85213ade5069158cbb2b16a777bd0be374e196b0feb4491961deb',
x86_64: '326265010b0a4407914db78bc6a1cb754817203f2bed0c107cee8a6b4134667b'
aarch64: '1241f2fb4681b09f2c0f9d00799222b63ecc79488040403d68186bc8093eaf6c',
armv7l: '1241f2fb4681b09f2c0f9d00799222b63ecc79488040403d68186bc8093eaf6c',
i686: '14a2bd096da4042114904389677b9b0ba44890a970b3c65d04b1191a2035fbe6',
x86_64: '59654b4d1746fbd04d42a42aeeae7bd4ca788bc36ff57942644ffb0d56061617'
})
depends_on 'autoconf_archive' => :build
@@ -60,18 +60,6 @@ class Python3 < Package
system "crew remove #{@replaces_installed.join(' ')}", exception: false
end
def self.patch
system "sed -i -e 's:#{CREW_LIB_PREFIX}:$(get_libdir):g' \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
Lib/site.py \
Lib/sysconfig.py \
Lib/test/test_site.py \
Makefile.pre.in \
Modules/getpath.c \
setup.py"
end
def self.prebuild
# Ensure that internal copies of expat, libffi and zlib aren't used
FileUtils.rm_rf 'Modules/expat'
@@ -99,13 +87,16 @@ class Python3 < Package
--with-ensurepip \
--enable-optimizations \
--with-platlibdir='lib#{CREW_LIB_SUFFIX}' \
--with-system-ffi \
--with-system-expat \
--with-system-libmpdec \
--with-tzpath=#{CREW_PREFIX}/share/zoneinfo \
--with-libc= \
--enable-shared"
system 'mold -run make'
File.write 'python_config_env', <<~PYTHON_CONFIG_EOF
# Force use of python3 over python2.7 in packages which check the variable to set the python used.
PYTHON=python3
PYTHON_CONFIG_EOF
end
end
@@ -145,14 +136,23 @@ class Python3 < Package
# Make python3 the default python
FileUtils.ln_sf 'python3', "#{CREW_DEST_PREFIX}/bin/python"
FileUtils.ln_sf 'pip3', "#{CREW_DEST_PREFIX}/bin/pip"
FileUtils.install 'builddir/python_config_env', "#{CREW_DEST_PREFIX}/etc/env.d/python", mode: 0o644
end
def self.postinstall
puts 'Updating pip packages...'.lightblue
@piplist = `pip list | cut -d' ' -f1`.split
@piplist.drop(2).each do |pip_pkg|
system "pip install #{pip_pkg} -U", exception: false
# Pip is installed inside Python 3. The following steps ensure that
# pip can properly build other packages from buildsystems/pip.
@required_pip_modules = %w[build installer setuptools wheel pyproject_hooks]
@pip_list = `pip list --exclude pip`
@required_pip_modules.each do |pip_pkg|
unless @pip_list.include?(pip_pkg)
puts "Installing #{pip_pkg} using pip..."
system "MAKEFLAGS=-j#{CREW_NPROC} pip install #{pip_pkg}"
end
end
puts 'Updating pip packages...'.lightblue
system 'pip list --outdated --format=json | python -c "import json, sys; print(\'\n\'.join([x[\'name\'] for x in json.load(sys.stdin)]))" | xargs -rn1 pip install -U', exception: false
puts "Please install tcl and tk with 'crew install tcl tk' if tkinter is needed.".lightblue unless ARCH == 'i686'
end
end