Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: '/github/workspace/wheelhouse/*' #90

Closed
andy-brainome opened this issue Jan 12, 2022 · 7 comments · Fixed by #91
Labels
invalid This doesn't seem right

Comments

@andy-brainome
Copy link

andy-brainome commented Jan 12, 2022

My github actions script is breaking without any changes to the script.
The print_hash setting appears to be ignored and thus erroring out because there are no hashes.

## first I identify what is available to be uploaded from the wheelhouse directory
Run ls -latR wheelhouse
  ls -latR wheelhouse
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
wheelhouse:
total 12
drwxr-xr-x 2 runner docker 4096 Jan 12 20:09 btc_pip_dist-3.9-ubuntu-latest
drwxr-xr-x 3 runner docker 4096 Jan 12 20:09 .
drwxr-xr-x 3 runner docker 4096 Jan 12 20:09 ..

wheelhouse/btc_pip_dist-3.9-ubuntu-latest:
total 2260
-rw-r--r-- 1 runner docker 2304081 Jan 12 20:09 brainome-1.8.80-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
drwxr-xr-x 2 runner docker    4096 Jan 12 20:09 .
drwxr-xr-x 3 runner docker    4096 Jan 12 20:09 ..

## second I run the verify and upload 
Run pypa/gh-action-pypi-publish@release/v1
  with:
    user: __token__
    password: ***
    repository_url: https://test.pypi.org/legacy/
    packages_dir: wheelhouse/\*/
    verbose: true
    verify_metadata: true
    skip_existing: false
    print_hash: false
/usr/bin/docker run --name a6825092b92cd3441479187c9d283f7e5ebcc_aff43d --label 6a6825 --workdir /github/workspace --rm -e INPUT_USER -e INPUT_PASSWORD -e INPUT_REPOSITORY_URL -e INPUT_PACKAGES_DIR -e INPUT_VERBOSE -e INPUT_VERIFY_METADATA -e INPUT_SKIP_EXISTING -e INPUT_PRINT_HASH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/mlmeter/mlmeter":"/github/workspace" 6a6825:092b92cd3441479187c9d283f7e5ebcc  "__token__" "***" "https://test.pypi.org/legacy/" "wheelhouse/*/" "true" "false" "true" "false"
Checking wheelhouse/btc_pip_dist-3.9-ubuntu-latest/brainome-1.8.80-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED
Traceback (most recent call last):
  File "/app/print-hash.py", line 9, in <module>
    for file_object in packages_dir.iterdir():
  File "/usr/local/lib/python3.9/pathlib.py", line 1160, in iterdir
Showing hash values of files to be uploaded:
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '/github/workspace/wheelhouse/*'
@andy-brainome
Copy link
Author

I've come up with the work around - I've set

verbose: false

allows the publishing to complete unabated

@andy-brainome
Copy link
Author

It could be due to this script rewrite
0575dc8

@webknjaz
Copy link
Member

@meowmeowmeowcat could you take a look?

@webknjaz
Copy link
Member

@andy-brainome

packages_dir: wheelhouse/*/

Do you have a nested dir structure for the dists?

@webknjaz webknjaz added bug Something isn't working invalid This doesn't seem right and removed bug Something isn't working labels Jan 13, 2022
@webknjaz
Copy link
Member

From the log it seems like it's a user error — I don't think that the trailing forward slash (/) should be there in the packages_dir arg. See how /* is appended at the end turning it into wheelhouse/*//*: https://github.com/pypa/gh-action-pypi-publish/blob/717ba43/twine-upload.sh#L54.

@andy-brainome
Copy link
Author

andy-brainome commented Jan 13, 2022

Sorry - for the confusion, my first build crash had omitted the trailing slash but it expired before I could copy/paste.
I've reproduced that configuration below along followed an working production configuration.
Notice the working output does not include "Showing hash values of files to be uploaded:"
nor have I seen that output in the past year

Yes - the , twine finds and verifies the nested wheels just fine and pathlib is not fooled by the double slash.

Checking wheelhouse/btc_pip_dist-3.9-ubuntu-latest/brainome-1.8.80-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED

**--- Broken dev build reproduction ---**
Run pypa/gh-action-pypi-publish@release/v1
  with:
    user: __token__
    password: ***
    repository_url: https://test.pypi.org/legacy/
    packages_dir: wheelhouse/*
    verbose: true
    verify_metadata: true
    skip_existing: false
    print_hash: false
/usr/bin/docker run --name a6825ffc5a13e2f7b41459b40f91a0ce2ec0b_28fcd4 --label 6a6825 --workdir /github/workspace --rm -e INPUT_USER -e INPUT_PASSWORD -e INPUT_REPOSITORY_URL -e INPUT_PACKAGES_DIR -e INPUT_VERBOSE -e INPUT_VERIFY_METADATA -e INPUT_SKIP_EXISTING -e INPUT_PRINT_HASH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/mlmeter/mlmeter":"/github/workspace" 6a6825:ffc5a13e2f7b41459b40f91a0ce2ec0b  "__token__" "***" "https://test.pypi.org/legacy/" "wheelhouse/*" "true" "false" "true" "false"
Checking wheelhouse/btc_pip_dist-3.8-ubuntu-latest/brainome-1.8.83-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED
Traceback (most recent call last):
  File "/app/print-hash.py", line 9, in <module>
    for file_object in packages_dir.iterdir():
  File "/usr/local/lib/python3.9/pathlib.py", line 1160, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '/github/workspace/wheelhouse/*'

Showing hash values of files to be uploaded:

**--- Working PRODUCTION build== verbose=false---**
Run pypa/gh-action-pypi-publish@release/v1
  with:
    user: __token__
    password: ***
    repository_url: https://test.pypi.org/legacy/
    packages_dir: wheelhouse/*
    verbose: false
    verify_metadata: true
    skip_existing: false
    print_hash: false
/usr/bin/docker run --name a6825133466598ff544f7bb5db9f4888bd7e9_bd0fad --label 6a6825 --workdir /github/workspace --rm -e INPUT_USER -e INPUT_PASSWORD -e INPUT_REPOSITORY_URL -e INPUT_PACKAGES_DIR -e INPUT_VERBOSE -e INPUT_VERIFY_METADATA -e INPUT_SKIP_EXISTING -e INPUT_PRINT_HASH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/mlmeter/mlmeter":"/github/workspace" 6a6825:133466598ff544f7bb5db9f4888bd7e9  "__token__" "***" "https://test.pypi.org/legacy/" "wheelhouse/*" "true" "false" "false" "false"
Checking wheelhouse/btc_pip_dist-3.7-Linux/brainome-1.8.115-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.7-Windows/brainome-1.8.115-cp37-cp37m-win_amd64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.7-macOS/brainome-1.8.115-cp37-cp37m-macosx_10_15_x86_64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.8-Linux/brainome-1.8.115-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.8-Windows/brainome-1.8.115-cp38-cp38-win_amd64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.8-macOS/brainome-1.8.115-cp38-cp38-macosx_10_15_x86_64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.9-Linux/brainome-1.8.115-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.9-Windows/brainome-1.8.115-cp39-cp39-win_amd64.whl: PASSED
Checking wheelhouse/btc_pip_dist-3.9-macOS/brainome-1.8.115-cp39-cp39-macosx_10_15_x86_64.whl: PASSED
Uploading distributions to https://test.pypi.org/legacy/
Uploading brainome-1.8.115-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl

  0%|          | 0.00/2.09M [00:00<?, ?B/s]
  0%|          | 8.00k/2.09M [00:00<00:29, 75.1kB/s]
100%|██████████| 2.09M/2.09M [00:01<00:00, 1.39MB/s]
Uploading brainome-1.8.115-cp37-cp37m-win_amd64.whl

  0%|          | 0.00/1.90M [00:00<?, ?B/s]
100%|██████████| 1.90M/1.90M [00:01<00:00, 1.30MB/s]
Uploading brainome-1.8.115-cp37-cp37m-macosx_10_15_x86_64.whl

  0%|          | 0.00/3.41M [00:00<?, ?B/s]
100%|██████████| 3.41M/3.41M [00:01<00:00, 1.87MB/s]
Uploading brainome-1.8.115-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl

  0%|          | 0.00/2.20M [00:00<?, ?B/s]
100%|██████████| 2.20M/2.20M [00:01<00:00, 1.75MB/s]
Uploading brainome-1.8.115-cp38-cp38-win_amd64.whl

  0%|          | 0.00/2.17M [00:00<?, ?B/s]
100%|██████████| 2.17M/2.17M [00:01<00:00, 1.78MB/s]
Uploading brainome-1.8.115-cp38-cp38-macosx_10_15_x86_64.whl

  0%|          | 0.00/3.57M [00:00<?, ?B/s]
100%|██████████| 3.57M/3.57M [00:01<00:00, 2.55MB/s]
Uploading brainome-1.8.115-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl

  0%|          | 0.00/2.20M [00:00<?, ?B/s]
100%|██████████| 2.20M/2.20M [00:01<00:00, 1.77MB/s]
Uploading brainome-1.8.115-cp39-cp39-win_amd64.whl

  0%|          | 0.00/2.06M [00:00<?, ?B/s]
100%|██████████| 2.06M/2.06M [00:01<00:00, 1.66MB/s]
Uploading brainome-1.8.115-cp39-cp39-macosx_10_15_x86_64.whl

  0%|          | 0.00/3.54M [00:00<?, ?B/s]
100%|██████████| 3.54M/3.54M [00:01<00:00, 2.55MB/s]

View at:
https://test.pypi.org/project/brainome/1.8.115/

@dukecat0
Copy link
Member

dukecat0 commented Jan 13, 2022

The issue is here:

python /app/print-hash.py "${INPUT_PACKAGES_DIR%%/}"

Removing the double quotes should fix this issue:

python /app/print-hash.py ${INPUT_PACKAGES_DIR%%/}

(As I found that

twine check ${INPUT_PACKAGES_DIR%%/}/*

has no double quotes around the ${INPUT_PACKAGES_DIR%%/}, so it works properly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants