Fix build and add py.typed

This commit is contained in:
IRBorisov 2024-04-12 13:26:42 +03:00
parent 61815e7628
commit e7331dd34e
4 changed files with 12 additions and 11 deletions

View File

@ -1 +1 @@
0.1.0 0.1.1

0
cctext/py.typed Normal file
View File

View File

@ -3,24 +3,25 @@ Set-Location $PSScriptRoot\..
$packageName = 'cctext' $packageName = 'cctext'
$output = 'dist' $output = 'dist'
$python = '.\venv\Scripts\python.exe' $python = '.\venv\Scripts\python.exe'
if (-not (Test-Path -Path $python -PathType Leaf)) {
if (-not (Test-Path -Path ${python} -PathType Leaf)) {
& 'python' -m venv .\venv & 'python' -m venv .\venv
& $python -m pip install -r requirements-build.txt & ${python} -m pip install -r requirements-build.txt
} }
if (Test-Path -Path $output\$packageName) { if (Test-Path -Path $output\$packageName) {
Remove-Item $output\$packageName -Recurse -Force Remove-Item $output\$packageName -Recurse -Force
} }
& $python -m build --outdir=$output\ & ${python} -m build --outdir=${output}\
$wheel = Get-Childitem -Path $output\*.whl -Name $wheel = Get-Childitem -Path ${output}\*.whl -Name
if (-not $wheel) { if (-not ${wheel}) {
Write-Error "No wheel generated for $packageName" Write-Error "No wheel generated for ${packageName}"
Exit 1 Exit 1
} }
& $python -m pip install -I $output\$wheel & ${python} -m pip install -I ${output}\${wheel}
& $python -m unittest & ${python} -m unittest
$exitcode = $LASTEXITCODE $exitcode = $LASTEXITCODE
& $python -m pip uninstall -y $packageName & ${python} -m pip uninstall -y $packageName
Exit $exitcode Exit $exitcode

View File

@ -2,4 +2,4 @@
from setuptools import setup from setuptools import setup
if __name__ == "__main__": if __name__ == "__main__":
setup() setup(zip_safe=False)