Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

GitHub Actions access python package artifacts between multiple tox-runs

Following the documentation of tox I should be able to share artefacts between different tox runs. While I got this working locally I can't get this to work via GitHub actions.

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

EDIT

I found one problem is that the version need to be fixed and wild cards are not working as documented. If I use:

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

Then I get a bit further, but the setup.py failes:

ERROR: Could not find a version that satisfies the requirement 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='
'.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'],
)
question from:https://stackoverflow.com/questions/65601569/github-actions-access-python-package-artifacts-between-multiple-tox-runs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...