python自动版本不能使用github操作进行
我有一个自动化的github操作工作流程,该工作流程应该使用发行标签的版本构建并上传到PYPI。
但是,无论标签如何,动作都以0.0.0版本构建包装 (
?构建文件:
GA Workflow
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 }}
Setup.py
import setuptools
if __name__ == "__main__":
setuptools.setup()
Setup.cfg
[metadata]
name = pyenergydiagram
author = Remi Delaporte-Mathurin
author_email = [email protected]
description = Plot potential energy diagram in python
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/RemDelaporteMathurin/pyEnergyDiagram
license = MIT
license_file = LICENSE
classifiers =
Natural Language :: English
Topic :: Scientific/Engineering
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
License :: OSI Approved :: MIT License
Operating System :: OS Independent
project_urls =
Source = https://github.com/RemDelaporteMathurin/pyEnergyDiagram
Tracker = https://github.com/RemDelaporteMathurin/pyEnergyDiagram/issues
[options]
packages = find:
python_requires= >=3.6
install_requires =
numpy >= 1.22
matplotlib >= 3.5.1
scipy >= 1.8
[options.extras_require]
tests =
pytest >= 5.4.3
Project.toml
[build-system]
requires = [
"setuptools >= 45",
"wheel",
"setuptools_scm[toml] >= 6.2",
"setuptools_scm_git_archive",
]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "pyenergydiagram/_version.py"
提前感谢您的帮助!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对此很陌生,但基于本文:
可能更改设置
。
有
I am pretty new to this, but based on this article:
https://medium.com/@VersuS_/automate-pypi-releases-with-github-actions-4c5a9cfe947d
Potentially changing your setup.py to include:
and then editing your GA to include:
Hope that helps!
该文件应为“ pyproject.toml”非“ project.toml”。因此,这并没有被行动所困扰。
The file should be name "pyproject.toml" not "project.toml". Therefore it wasn't caught up by the actions.