Update TODO.txt #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will test a downstream dependency to functionally test current (Python) package | |
# It uses the Python Package GitHub Actions workflow. | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
# and https://www.youtube.com/watch?v=l6fV09z5XHk | |
name: ci-build-downstream | |
on: | |
push: | |
branches: | |
- master # $default-branch only works in Workflows templates, not in Workflows, see https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable | |
pull_request: | |
branches: | |
- master | |
jobs: | |
testdownstream: | |
name: Unit test downstream package depending on our package | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["*", "pypy-3.9"] # check the list of versions: https://github.com/actions/python-versions/releases and https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md -- note that "*" represents the latest stable version of Python | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
# You can test your matrix by printing the current Python version | |
- name: Display Python version | |
run: | | |
python -c "import sys; print(sys.version)" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# The rest is managed by the pyproject.toml | |
- name: Echo current Python version | |
run: echo "${{ matrix.python-version }}" | |
- name: Install downstream package pyFileFixity depending on reedsolo as a complementary functional unit test | |
# Note: we need to install BEFORE so that we can install our update package reedsolo after (with cutting edge git version), and force pyFileFixity to use it (otherwise we would need to disable isolation build in pip if placed after, but it would be more messy). | |
# FIXME: Need to use the @ form once issue https://github.com/pypa/pip/issues/11951 is fixed, as supplying extras to an egg fragment is deprecated and will be removed in pip v25. | |
run: | | |
pip install --upgrade --editable git+https://github.com/lrq3000/pyFileFixity.git#egg=pyFileFixity[test] --verbose | |
# pip install --upgrade --editable pyfilefixity[test] --pre --verbose # As of pip 23.1, this is not supported, --editable requires a local path or a VCS url | |
- name: Install Cython module | |
if: ${{ matrix.python-version != 'pypy-3.9' }} # ${{}} GitHub expression syntax, need to place the target python-version in single quotes (not double quotes!) so that it does not stop parsing the literal at dots, otherwise dots will truncate the string https://docs.github.com/en/actions/learn-github-actions/expressions | |
run: | | |
pip install --upgrade --config-setting="--install-option=--no-cython-compile" cython>=3.0.0b2 | |
- name: Install the current package (necessary for src-layout) with cythonize | |
if: ${{ matrix.python-version != 'pypy-3.9' }} | |
# necessary to add --editable to install locally to be able to run the tests/* scripts, otherwise we can still run them but coverage will not detect the reedsolo files since they will be in site-packages, hence with a very different path, this is because without an editable install, with a src-layout there is no implicitly set PYTHONPATH, as described in https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout | |
run: | | |
pip install --upgrade --editable .[test] --config-setting="--build-option=--cythonize" --verbose | |
- name: Install the current package (necessary for src-layout) without cythonize (under PyPy) | |
if: ${{ matrix.python-version == 'pypy-3.9' }} | |
run: | | |
pip install --upgrade --editable .[test] --verbose | |
- name: Test downstream package pyFileFixity depending on reedsolo as a complementary functional unit test | |
run: | | |
pytest src/pyfilefixity |