Giter Club home page Giter Club logo

Comments (12)

danielniccoli avatar danielniccoli commented on August 17, 2024 1

You were right. When downloading, name causes the action to download everything in that folder. If not given, the entire folder is downloaded, along with any other folder that may exist there.

from gh-action-pypi-publish.

shenxianpeng avatar shenxianpeng commented on August 17, 2024
Checking dist/artifact: ERROR    InvalidDistribution: Unknown distribution format: 'artifact'

From the above error message, it seems using actions/download-artifact@v3 changed your package name to artifact under the dist/ folder. so I guess you can try to fix the package name format from the download step of path, e.g. change path: dist/ to path: dist/mypackage.whl

from gh-action-pypi-publish.

danielniccoli avatar danielniccoli commented on August 17, 2024

If I name it python-package-distributions it works. So where's the difference between artifact and python-package-distributions. One name works, the other fails.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

@danielniccoli v3 of the action allows uploading/downloading artifacts without supplying the name input. In that case, their internals default to using the artifact name. That's not something related to this action, really.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

This is likely because when you download w/o a name, GH combines all the artifacts related to the workflow into one and that behavior is known to differ.

from gh-action-pypi-publish.

danielniccoli avatar danielniccoli commented on August 17, 2024

@danielniccoli v3 of the action allows uploading/downloading artifacts without supplying the name input. In that case, their internals default to using the artifact name. That's not something related to this action, really.

  1. Yes, I know that.
  2. I know that, too. But that's not the point of this issue.

from gh-action-pypi-publish.

danielniccoli avatar danielniccoli commented on August 17, 2024

This is likely because when you download w/o a name, GH combines all the artifacts related to the workflow into one and that behavior is known to differ.

My build process only creates one artifact.

The content of both archives artifact and python-package-distributions are identical. If it works for the archive python-package-distributions, it must work for artifact. So why does one throw an error? This still sounds like a bug with this action.

If you need logs, let me know how to collect them and I will help with that.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

So why does one throw an error?

Because artifact is a subfolder and GitHub's official action puts stuff in a nested folder structure. So if you want to use that, you'll have to adjust the packages-dir: input which defaults to dist/ to something else, like dist/artifact/, perhaps. The action will not traverse your folder structure to guess what you want to upload, it's your responsibility to set up a proper folder structure before calling this action: https://github.com/marketplace/actions/pypi-publish#non-goals.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

InvalidDistribution: Unknown distribution format: 'artifact'

FYI we don't output this error, it's the underlying call to Twine that does.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

If you need logs, let me know how to collect them and I will help with that.

Try injecting a call to tree dist/ or ls -alhR dist/ right after invoking the download action to see the difference. You should see that the structure GitHub's action produces is nested in one of the cases.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

This still sounds like a bug with this action.

It's not, because we don't do anything with GitHub artifacts at all. We only work with files on disk that you put there. And we only call twine and a few other helpers but don't do anything advanced like looking into deeply nested directories.

from gh-action-pypi-publish.

webknjaz avatar webknjaz commented on August 17, 2024

Perhaps, it might make sense to add an explanatory warning message if a folder called artifact/ exists. But it seems like too much special-casing to maintain. If someone else gets confused by this, I'll consider implementing such a check.

from gh-action-pypi-publish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.