aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/tools/pyre/pyre-bdist-wheel.patch
blob: 1b6fea024e03d0bd632a5b161f0b0ef23d815273 (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
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