Merge pull request #3436 from lazka/python-tomli-bootstrap
python-tomli: rework bootstrap path
This commit is contained in:
commit
329cd2a7dd
@ -1,28 +1,28 @@
|
||||
pkgname=python-tomli
|
||||
pkgver=2.0.1
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="A lil' TOML parser"
|
||||
url="https://github.com/hukkin/tomli"
|
||||
license=('spdx:MIT')
|
||||
arch=('any')
|
||||
depends=('python')
|
||||
source=("https://pypi.debian.net/tomli/tomli-$pkgver-py3-none-any.whl"
|
||||
"install_wheel.py")
|
||||
sha256sums=('939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc'
|
||||
'668e64f912d6360330c403edb6100b21f6aa6dd6a7803d342fab8c35d8176ad9')
|
||||
makedepends=(
|
||||
'python-flit-core'
|
||||
'python-installer'
|
||||
)
|
||||
source=("https://github.com/hukkin/tomli/archive/$pkgver/$pkgname-$pkgver.tar.gz")
|
||||
sha256sums=('ad22dbc128623e0c156ffaff019f29f456eba8a5d5a05164dd34f63e560449df')
|
||||
|
||||
build() {
|
||||
mkdir dist
|
||||
cp "tomli-$pkgver-py3-none-any.whl" dist
|
||||
cd "tomli-${pkgver}"
|
||||
|
||||
python -m flit_core.wheel
|
||||
}
|
||||
|
||||
package() {
|
||||
_pythonpath=`python -c "import sysconfig; print(sysconfig.get_path('platlib'))"`
|
||||
_site_packages="${pkgdir}${_pythonpath}"
|
||||
mkdir -p "$_site_packages"
|
||||
python "${srcdir}/install_wheel.py" -i"${_site_packages}" dist/*.whl
|
||||
python -m compileall \
|
||||
-o 0 -o 1 -q -s"${pkgdir}" -p"/" "${_site_packages}"
|
||||
cd "tomli-${pkgver}"
|
||||
|
||||
install -Dm644 tomli*.dist-info/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
|
||||
python -m installer --destdir="${pkgdir}" dist/*.whl
|
||||
|
||||
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
|
||||
}
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
import argparse
|
||||
import sys
|
||||
import sysconfig
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile
|
||||
|
||||
def extract_wheel(whl_path, dest):
|
||||
print("Installing to", dest)
|
||||
with ZipFile(whl_path) as zf:
|
||||
zf.extractall(dest)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'wheel',
|
||||
type=Path,
|
||||
help=f'wheel to install (.whl file)',
|
||||
)
|
||||
purelib = Path(sysconfig.get_path('purelib')).resolve()
|
||||
parser.add_argument(
|
||||
'--installdir',
|
||||
'-i',
|
||||
type=Path,
|
||||
default=purelib,
|
||||
help=f'installdir directory (defaults to {purelib})',
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.installdir.is_dir():
|
||||
sys.exit(f"{args.installdir} is not a directory")
|
||||
|
||||
extract_wheel(args.wheel, args.installdir)
|
||||
Loading…
x
Reference in New Issue
Block a user