Action fails when setuptools.setup
values are parsed from text file
#86
-
I'm playing around with a dummy python package to understand how to properly use this action. This is my workflow file: name: Upload Python Package
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }} It fails giving
whenever I try to do something like this: import setuptools
import os
# loading version number from path
VERSION_PATH = os.path.join(os.path.dirname(__file__), "<my_pkg_name>", "VERSION.txt")
with open(VERSION_PATH, "r") as version_file:
version = version_file.read().strip()
setuptools.setup(
...
version=version,
... If I specify the version number by hand it works as expected. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Our action does not attempt to build your project, it only uploaded the dists that you've pre-built before running it. So your question is rather out of the scope of what this project is meant to solve. But let me give you some pointers:
P.S. If you have further |
Beta Was this translation helpful? Give feedback.
Our action does not attempt to build your project, it only uploaded the dists that you've pre-built before running it. So your question is rather out of the scope of what this project is meant to solve.
But let me give you some pointers:
pypa/build
which is a PEP 517 compliant build front-end.build
readspyproject.toml
's[build-system]
and based on it knows the build dependencies and the build back-end with a fallback tosetuptools
.setuptools
is what actually builds your project (it evaluatessetup.py
if it's present).setup.py
is what fails. In particular, you attempt opening a file that doesn't exist in that location.setuptools
, it's…