poetry publish fails despite a dist folder being present #8357
-
Ok, I have been told it's better to keep the build and deployment in two separate jobs (for security reasons). So, I build my project (poetry build) and share the resulting dist folder with a second job that gets an ephemeral key and pushes to pypi. This used to work if the build step was in the same job. Here's an example: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
i get No files to publish. Run poetry build first or use the --build option. |
Beta Was this translation helpful? Give feedback.
-
The dist folder is present and as expected packed with
|
Beta Was this translation helpful? Give feedback.
-
Ayyup, I too fell for this tarp. That error message should really be updated to include this word of warning <3 |
Beta Was this translation helpful? Give feedback.
-
Ouch. I just fell over this error message.. and now I am not sure how to solve it. __version__ = "1.0.0"
## This is needed
def get_info():
return {
"package-name": "some_package", # Required
"name": "some", # Required
"description": "A package for something.", # Required
"connection-types": [
{
"connection-type": "foo",
"hook-class-name": "...."
}
],
"versions": [__version__], # Required
} Then in the [build-system]
requires = [
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"
[project]
dynamic = [
"version"
]
# required by poetry but unused due to usage of setuptools
[tool.poetry]
version = "0"
[tool.setuptools.dynamic]
version = { attr = "some_package.__version__" }
Always needing to update both files is not DRY. Has anybody any ideas? |
Beta Was this translation helpful? Give feedback.
The error message could definitely be improved, but
poetry
will only look for a built distribution matching the version number inpyproject.toml
. Since yourbuild
job updates this version, yourdeploy
job will need to do the same