experimental: adds a new workflow for QA for testing PyPI packages with conda pypi install#222
experimental: adds a new workflow for QA for testing PyPI packages with conda pypi install#222travishathaway wants to merge 7 commits into
conda pypi install#222Conversation
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
|
this is pretty neat! Though I'm wondering who the target audience for this is and what their thoughts are. If it's useful to them I'm happy to give this a ✔️. For me, I think I feel good about running these tests on my own machine for investigation, and I don't think I would use this. I feel pretty good about the current test suite being able to point out any cross platform issues. But, it is pretty telling that lots of these tests failed. So maybe there is also opportunity to include this style of test in the normal test suite? |
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: qa-test-results-${{ matrix.os }}-py${{ inputs.python-version }} | ||
| path: | | ||
| ${{ runner.temp }}/**/*.log | ||
| retention-days: 7 |
| prefix = tmp_path / "env" | ||
|
|
||
| conda_cli( | ||
| "create", | ||
| "--prefix", | ||
| str(tmp_path / "env"), | ||
| "--channel", | ||
| "defaults", | ||
| "--override-channels", | ||
| "-y", | ||
| "python", | ||
| ) |
There was a problem hiding this comment.
This create is what tmp_env is for:
| prefix = tmp_path / "env" | |
| conda_cli( | |
| "create", | |
| "--prefix", | |
| str(tmp_path / "env"), | |
| "--channel", | |
| "defaults", | |
| "--override-channels", | |
| "-y", | |
| "python", | |
| ) | |
| with tmp_env( | |
| "--override-channels", | |
| "--channel=defaults", | |
| "python", | |
| ) as prefix: |
| """Register --qa-packages command line option""" | ||
| parser.addoption( | ||
| "--qa-packages", | ||
| action="append", |
There was a problem hiding this comment.
change this to "extend" and we can skip all of the argument formatting in the workflow
| run: | | ||
| # Parse multiline input into array | ||
| IFS=$' ' read -rd '' -a packages <<< "${{ inputs.packages }}" || true | ||
|
|
||
| # Build pytest command with --qa-packages for each package | ||
| pytest_args="-m qa -v --basetemp=${{ runner.os == 'Windows' && 'D:\\temp' || runner.temp }} tests/test_qa_wheels.py" | ||
| for pkg in "${packages[@]}"; do | ||
| # Trim whitespace | ||
| pkg=$(echo "$pkg" | xargs) | ||
| if [ -n "$pkg" ]; then | ||
| pytest_args="$pytest_args --qa-packages $pkg" | ||
| fi | ||
| done |
There was a problem hiding this comment.
Flatten it so it's more readable:
| run: | | |
| # Parse multiline input into array | |
| IFS=$' ' read -rd '' -a packages <<< "${{ inputs.packages }}" || true | |
| # Build pytest command with --qa-packages for each package | |
| pytest_args="-m qa -v --basetemp=${{ runner.os == 'Windows' && 'D:\\temp' || runner.temp }} tests/test_qa_wheels.py" | |
| for pkg in "${packages[@]}"; do | |
| # Trim whitespace | |
| pkg=$(echo "$pkg" | xargs) | |
| if [ -n "$pkg" ]; then | |
| pytest_args="$pytest_args --qa-packages $pkg" | |
| fi | |
| done | |
| env: | |
| BASETEMP: ${{ runner.os == 'Windows' && 'D:\\temp' || runner.temp }} | |
| run: | | |
| # Convert package list to --qa-packages arguments | |
| qa_args=$(echo "${{ inputs.packages }}" | xargs | sed 's/[^ ][^ ]*/--qa-packages &/g') | |
| # Run pixi/pytest | |
| pixi run --environment ${{ env.PIXI_ENV_NAME }} python -mpytest \ | |
| -m qa -v \ | |
| --basetemp="${BASETEMP}" \ | |
| $qa_args \ | |
| tests/test_qa_wheels.py |
Description
fixes: #213
I'm still personally unsure if this is actually useful and makes sense to merge, but I figured this would be a good place to have that conversation.
To see some runs, you can check out my fork: