mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 05:04:00 +00:00
44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
|
diff --git a/scripts/build-pypi-package.sh b/scripts/build-pypi-package.sh
|
||
|
index 1035591..bb8cbae 100755
|
||
|
--- a/scripts/build-pypi-package.sh
|
||
|
+++ b/scripts/build-pypi-package.sh
|
||
|
@@ -98,7 +98,7 @@ rsync -avm --filter='- tests/' --filter='+ */' --filter='-! *.py' "${SCRIPTS_DIR
|
||
|
sed -i -e "/__version__/s/= \".*\"/= \"${PACKAGE_VERSION}\"/" "${BUILD_ROOT}/${MODULE_NAME}/version.py"
|
||
|
|
||
|
# Copy binary files.
|
||
|
-BINARY_FILE="${SCRIPTS_DIRECTORY}/../_build/default/main.exe"
|
||
|
+BINARY_FILE="NIX_BINARY_FILE"
|
||
|
if [[ ! -f "${BINARY_FILE}" ]]; then
|
||
|
echo "The binary file ${BINARY_FILE} does not exist."
|
||
|
echo "Have you run 'make' in the toplevel directory?"
|
||
|
@@ -146,7 +146,7 @@ def find_typeshed_files(base):
|
||
|
result.append((target, files))
|
||
|
return result
|
||
|
|
||
|
-with open('README.md') as f:
|
||
|
+with open('README.md', encoding='utf8') as f:
|
||
|
long_description = f.read()
|
||
|
|
||
|
setup(
|
||
|
@@ -205,20 +205,3 @@ fi
|
||
|
|
||
|
# Build.
|
||
|
python3 setup.py bdist_wheel
|
||
|
-
|
||
|
-# Move artifact outside the build directory.
|
||
|
-mkdir -p "${SCRIPTS_DIRECTORY}/dist"
|
||
|
-files_count="$(find "${BUILD_ROOT}/dist/" -type f | wc -l | tr -d ' ')"
|
||
|
-[[ "${files_count}" == '1' ]] || \
|
||
|
- die "${files_count} files created in ${BUILD_ROOT}/dist, but only one was expected"
|
||
|
-source_file="$(find "${BUILD_ROOT}/dist/" -type f)"
|
||
|
-destination="$(basename "${source_file}")"
|
||
|
-destination="${destination/%-any.whl/-${WHEEL_DISTRIBUTION_PLATFORM}.whl}"
|
||
|
-mv "${source_file}" "${SCRIPTS_DIRECTORY}/dist/${destination}"
|
||
|
-
|
||
|
-# Cleanup.
|
||
|
-cd "${SCRIPTS_DIRECTORY}"
|
||
|
-rm -rf "${BUILD_ROOT}"
|
||
|
-
|
||
|
-printf '\nAll done. Build artifact available at:\n %s\n' "${SCRIPTS_DIRECTORY}/dist/${destination}"
|
||
|
-exit 0
|