Skip to content

Commit

Permalink
python-sqlmodel: New package
Browse files Browse the repository at this point in the history
  • Loading branch information
podsvirov committed Jun 1, 2023
1 parent 62a79c4 commit 37ad98e
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mingw-w64-python-sqlmodel/0001-allow-newlest-sqlalchemy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- sqlmodel/pyproject.toml 2023-06-01 20:59:59.355735600 +0300
+++ python-build-MINGW32/pyproject.toml 2023-05-31 22:39:38.279909800 +0300
@@ -32,7 +32,7 @@

[tool.poetry.dependencies]
python = "^3.7"
-SQLAlchemy = ">=2.0.0,<=2.0.11"
+SQLAlchemy = ">=2.0.0"
pydantic = "^1.8.2"

[tool.poetry.dev-dependencies]
53 changes: 53 additions & 0 deletions mingw-w64-python-sqlmodel/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>

_realname=sqlmodel
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=0.0.8
pkgrel=1
pkgdesc='SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://github.com/tiangolo/sqlmodel'
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-pydantic"
"${MINGW_PACKAGE_PREFIX}-python-sqlalchemy")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-poetry"
"${MINGW_PACKAGE_PREFIX}-python-wheel"
"git")
#source=("${_realname}-$pkgver.tar.gz::${url}/archive/${pkgver}.tar.gz")
#sha256sums=('85bcd93ede1d3adbbf23b31f0499348343beef03e560a3c75c8e6e1ceaca1768')

# For more info see https://github.com/tiangolo/sqlmodel/pull/563
_sqlmodel_revision=4ce8d0720e9d76069257e46c35b1219b8ab72142
source=("git+https://github.com/farahats9/sqlmodel.git#commit=$_sqlmodel_revision"
'0001-allow-newlest-sqlalchemy.patch')
sha256sums=('SKIP'
'2a0a786bd97d3a49f378173153ba6b36446c8c004f0857aab884c5fe3abd13af')

prepare() {
#cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
cp -r "${_realname}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

patch -p1 -i "${srcdir}/0001-allow-newlest-sqlalchemy.patch"
}

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"

${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"

MSYS2_ARG_CONV_EXCL="--prefix=" \
"${MINGW_PREFIX}"/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}

0 comments on commit 37ad98e

Please sign in to comment.