linto-ai / whisper-timestamped

Multilingual Automatic Speech Recognition with word-level timestamps and confidence
GNU Affero General Public License v3.0
1.99k stars 156 forks source link

Publication on Pypi failing #149

Closed Jeronymous closed 11 months ago

Jeronymous commented 11 months ago

see https://github.com/linto-ai/whisper-timestamped/actions/runs/7142325918/job/19451389880 There is an error

Run python /home/runner/work/_actions/etils-actions/pypi-auto-publish/v1/src/compare_version.py \
Traceback (most recent call last):
  File "/home/runner/work/_actions/etils-actions/pypi-auto-publish/v1/src/compare_version.py", line 146, in <module>
    main()
  File "/home/runner/work/_actions/etils-actions/pypi-auto-publish/v1/src/compare_version.py", line 45, in main
    pkg_name = find_pkg_name()
  File "/home/runner/work/_actions/etils-actions/pypi-auto-publish/v1/src/compare_version.py", line 78, in find_pkg_name
    raise ValueError(
ValueError: Could not auto-infer the package name: []. Please open an issue.
Error: Process completed with exit code 1.

@beveradb @bennyo27 Any idea how to fix this?

Note: The name of the package is defined in setup.py

Also for the record : I noticed the package was not automatically published on https://pypi.org/project/whisper-timestamped/#history So I did this change to fix this: https://github.com/linto-ai/whisper-timestamped/commit/66f54ca71d44b8e3020963149eaee1e643443983 (it seems that the name of the branch was wrong) Now I just wonder how it previously worked for version 1.13.3 ...

bennyo27 commented 11 months ago

I see, we can try manually inputting the pkg-name, as per the instructions here https://github.com/etils-actions/pypi-auto-publish. image

name: Auto-publish

on: [push, workflow_dispatch]

jobs:
  publish-job:
    if: github.ref == 'refs/heads/master'
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: etils-actions/pypi-auto-publish@v1
        with:
          pypi-token: ${{ secrets.PYPI_API_TOKEN }}
          gh-token: ${{ secrets.GITHUB_TOKEN }}
          parse-changelog: false
          pkg-name: "package_name"  # Replace with actual package name
Jeronymous commented 11 months ago

Thank you @bennyo27 Maybe it was because of the "dash" <-> "underscore" confusion somewhere...

I had another error that I fixed by modifying the setup.py

Getting closer but... Now there is this one on https://github.com/linto-ai/whisper-timestamped/actions/runs/7144443381/job/19458040933

ERROR    `long_description` has syntax errors in markup and would not be        
         rendered on PyPI.                                                      
         No content rendered from RST source.                                   

I don't see any "long_description" field defined, neither documented somewhere...

Is there by chance a way to test the build locally, without pushing modification?

And I still wonder how it worked with the 2 first builds...

I just wonder how it previously worked for version 1.13.3 ...

bennyo27 commented 11 months ago

For that issue, I think we should just be able to use the readme?

with open("README.md", encoding='utf-8') as f:
    long_description = f.read()

setup(
    # Add long description from README file
    long_description=long_description,
    long_description_content_type='text/markdown',

I think there is a way to test github actions locally but I'm not familiar with it https://github.com/nektos/act

It could be that github actions adds something to the flow of the pypi upload and that's why there are discrepancies in the builds

Jeronymous commented 11 months ago

Thanks a lot :pray: I see, long_description is an option of the setup.py I first try with a simple one, not the README.md, which is quite complicated (and maybe that was the reason of the failure : I suspect it was taking this by default).

bennyo27 commented 11 months ago

Thanks a lot 🙏 I see, long_description is an option of the setup.py I first try with a simple one, not the README.md, which is quite complicated (and maybe that was the reason of the failure : I suspect it was taking this by default).

Oh yea that may be why.

Jeronymous commented 11 months ago

It finally worked \o/

Thanks again for your kind help @bennyo27

bennyo27 commented 11 months ago

That is great to hear!