Skip to content

Commit

Permalink
fix: Package Upload to wheel
Browse files Browse the repository at this point in the history
This time it has been tested with https://test.pypi.org (after I created an account)
The upload is now working.
  • Loading branch information
carstencodes committed Apr 6, 2024
1 parent 46989b2 commit adcc3c2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions bdist/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ def clear_dir(path):
logger.info("Assuming version is %s", version_id)

ap_map: dict[str, str] = {
"darwin_amd64_v1": "macosx_x86_64",
"darwin_arm64": "darwin_aarch64",
"linux_amd64_v1": "manylinux1_x86_64",
"linux_arm64": "manylinux1_aarch64",
"linux_arm_7": "linux_armv7l",
"darwin_amd64_v1": "macosx_10_0_x86_64",
"darwin_arm64": "macosx_10_0_arm64",
"linux_amd64_v1": "manylinux2014_x86_64",
"linux_arm64": "manylinux2014_aarch64",
"linux_arm_7": "manylinux2014_armv7l",
"windows_amd64_v1": "win_amd64",
"windows_arm64": "win_arch64",
"windows_arm64": "win_arm64",
}

executables = {"protolint", "protoc-gen-protolint"}
Expand All @@ -95,10 +95,12 @@ def clear_dir(path):

p_executables = [dist / f"{exe}_{arch_platform}" / f"{exe}{suffix}" for exe in executables]

file_name = package_name.replace('-', '_')

logger.debug("Creating wheel data folder")
dataFolder = pdir / f"{package_name}-{version_id}.data"
dataFolder = pdir / f"{file_name}-{version_id}.data"
logger.debug("Creating wheel data folder")
distInfoFolder = pdir / f"{package_name}-{version_id}.dist-info"
distInfoFolder = pdir / f"{file_name}-{version_id}.dist-info"

dataFolder.mkdir(parents=True, exist_ok=True)
distInfoFolder.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -171,7 +173,7 @@ def clear_dir(path):
rl.write(distInfoFolder.name + "/RECORD,,\n")
wheel_content.append(distInfoFolder / "RECORD")

whl_file = wheel / f"{package_name}-{version_id}-{tag}.whl"
whl_file = wheel / f"{file_name}-{version_id}-{tag}.whl"
if whl_file.is_file():
logger.debug("Removing existing wheel file")
whl_file.unlink()
Expand Down

0 comments on commit adcc3c2

Please sign in to comment.