From e7331dd34e8f48d38b508a16b333aa33a08c32bc Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:26:42 +0300 Subject: [PATCH] Fix build and add py.typed --- VERSION | 2 +- cctext/py.typed | 0 scripts/Build.ps1 | 19 ++++++++++--------- setup.py | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 cctext/py.typed diff --git a/VERSION b/VERSION index 6c6aa7c..6da28dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.1 \ No newline at end of file diff --git a/cctext/py.typed b/cctext/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/scripts/Build.ps1 b/scripts/Build.ps1 index c748c0a..f54a06e 100644 --- a/scripts/Build.ps1 +++ b/scripts/Build.ps1 @@ -3,24 +3,25 @@ Set-Location $PSScriptRoot\.. $packageName = 'cctext' $output = 'dist' $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 pip install -r requirements-build.txt + & ${python} -m pip install -r requirements-build.txt } if (Test-Path -Path $output\$packageName) { Remove-Item $output\$packageName -Recurse -Force } -& $python -m build --outdir=$output\ -$wheel = Get-Childitem -Path $output\*.whl -Name -if (-not $wheel) { - Write-Error "No wheel generated for $packageName" +& ${python} -m build --outdir=${output}\ +$wheel = Get-Childitem -Path ${output}\*.whl -Name +if (-not ${wheel}) { + Write-Error "No wheel generated for ${packageName}" Exit 1 } -& $python -m pip install -I $output\$wheel -& $python -m unittest +& ${python} -m pip install -I ${output}\${wheel} +& ${python} -m unittest $exitcode = $LASTEXITCODE -& $python -m pip uninstall -y $packageName +& ${python} -m pip uninstall -y $packageName Exit $exitcode \ No newline at end of file diff --git a/setup.py b/setup.py index 916c1fc..88519d7 100644 --- a/setup.py +++ b/setup.py @@ -2,4 +2,4 @@ from setuptools import setup if __name__ == "__main__": - setup() + setup(zip_safe=False)