summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 246ba0bd386c0f164df0b4c359650cd8f07c1189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Maintainer: Thiago Fran├ža<tfsthiagobr98@outlook.com>

_pkgname=poetry-core
pkgname=('python-poetry-core-git')
pkgver=1.0.0a9.r29.gb647193
pkgrel=1
pkgdesc="Python dependency management and packaging made easy (core package)"
arch=('any')
url="https://python-poetry.org/"
license=('MIT')
_deps=('cachecontrol' 'cachy' 'cleo' 'html5lib' 'jsonschema' 'lockfile'
       'pkginfo' 'pyparsing' 'pyrsistent' 'requests' 'requests-toolbelt'
       'shellingham' 'tomlkit' 'keyring' 'pexpect')
depends=("${_deps[@]/#/python-}")
makedepends=('python-dephell')
checkdepends=('git' 'python-pytest' 'python-pytest-mock' 'python-httpretty')
source=("${_pkgname}"::"git+https://github.com/python-poetry/${_pkgname}.git")
sha256sums=('SKIP')
            
pkgver() {
    cd "${srcdir}/${_pkgname}"
    ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' \
    || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

prepare() {
    # compile core
    cd "${srcdir}"/${_pkgname}

    dephell deps convert --level DEBUG --from pyproject.toml --to setup.py
}

build() {
    cd "${srcdir}"/${_pkgname}
    python setup.py build
}

check() {
    cd "${srcdir}"/${_pkgname}

    pytest
}

package() {
    cd "${srcdir}"/${_pkgname}

    python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
    
    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}