GitHub Actions 在多个 tox-runs 之间访问 python 包工件

问题描述

按照 tox 的文档,我应该能够在不同的 tox 运行之间share artefacts。虽然我在本地工作,但无法通过 GitHub 操作使其工作。

enter image description here

tox.ini

[tox]
envlist = py38
toxworkdir = {toxinidir}/../.tox/pandas_ml_utils

[testenv]
setenv =
    TOX_KERNEL = pd_utils_tox
    __VERSION__ = 0.2.0
deps =
    # does not work (the documented way)
    {distshare}/pandas-ml-common-*.zip
    -rdev-requirements.txt
commands =
    python -m ipykernel install --user --name {env:TOX_KERNEL} --display-name "{env:TOX_KERNEL} py38"
    python -m unittest discover
# does not work either (workaround working locally)
#commands_pre =
#    python -m pip install "{distshare}/pandas-ml-common-{env:__VERSION__}.zip"
commands_post =
    python tox_clean_egg.py

pythonpackage.yml

# This workflow will install Python dependencies,run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]
    env:
      LD_LIBRARY_PATH: '/tmp/lib:/usr/lib:/usr/local/lib/'
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install tox
      run: pip install -U tox
    - name: execute tox tests on COMMON
      working-directory: pandas-ml-common
      run: tox -e py
    - name: execute tox tests on ML_UTILS
      working-directory: pandas-ml-utils
      run: tox -e py

编辑

我发现一个问题是需要修复版本并且通配符无法按文档工作。如果我使用:

deps =
    {distshare}/pandas-ml-common-{env:__VERSION__}.zip

然后我更进一步,但是 setup.py 失败了:

错误:找不到满足 pandas-ml-common==0.2.0 要求的版本

setup.py

setup(
   name=os.path.basename(os.path.dirname(os.path.abspath(__file__))),version=__version__,author='KIC',author_email='',packages=find_packages(),scripts=[],url=url,license='MIT',description=__doc__,long_description='\n'.join([fix_github_links(l) for l in open('Readme.md').readlines()]),long_description_content_type='text/markdown',install_requires=[f"pandas-ml-common=={__version__}",*open("requirements.txt").read().splitlines()],extras_require={
      "dev": open("dev-requirements.txt").read().splitlines(),},include_package_data=True,classifiers=[
      # Chose either "3 - Alpha","4 - Beta" or "5 - Production/Stable" as the current state of your package
      'Development Status :: 3 - Alpha','Intended Audience :: Developers','Topic :: Software Development :: Build Tools','License :: OSI Approved :: MIT License','Programming Language :: Python :: 3','Programming Language :: Python :: 3.7',],keywords=['pandas','ml','util','quant'],)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...