mechanize: update to version 0.4.8, support Python 3.10. (#9477)

Minor clean ups.
This commit is contained in:
OscarL
2023-09-21 01:37:03 -03:00
committed by GitHub
parent 581388483d
commit d101e25cde
2 changed files with 88 additions and 91 deletions

View File

@@ -0,0 +1,88 @@
SUMMARY="Stateful programmatic web browsing in Python"
DESCRIPTION="Stateful programmatic web browsing in Python, after Andy \
Lesters Perl module WWW::Mechanize.
- The browser class mechanize.Browser implements the interface of \
urllib2.OpenerDirector, so any URL can be opened, not just http.
- Easy HTML form filling.
- Convenient link parsing and following.
- Browser history (.back() and .reload() methods).
- The Referer HTTP header is added properly (optional).
- Automatic observance of robots.txt.
- Automatic handling of HTTP-Equiv and Refresh."
HOMEPAGE="https://github.com/python-mechanize/mechanize
http://pypi.python.org/pypi/mechanize"
COPYRIGHT="2017 Kovid Goyal, John J Lee, Gisle Aas, Johnny Lee, Andy Lester"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://pypi.python.org/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="5e86ac0777357e006eb04cd28f7ed9f811d48dffa603d3891ac6d2b92280dc91"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
html5lib_$pythonPackage
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
TEST_REQUIRES+="
html5lib_$pythonPackage
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
TEST()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
python=python${PYTHON_VERSIONS[$i]}
$python run_tests.py
done
}