Skip to content

Feature/wsl#45

Merged
europanite merged 30 commits intomainfrom
feature/wsl
Oct 10, 2025
Merged

Feature/wsl#45
europanite merged 30 commits intomainfrom
feature/wsl

Conversation

@europanite
Copy link
Copy Markdown
Owner

Pull Request

Overview

added windows tests

Changes

  • .github/workflows
  • service/pyproject.toml

Testing

  • Built and ran locally without errors
  • All tests passed
  • Verified functionality manually (describe how)

Related Issues

  • Closes #

Checklist

  • Code is clean and free of unnecessary comments/debug prints
  • Proper naming conventions and documentation are followed
  • Updated documentation/README if necessary
  • CI pipeline passes successfully

Notes for Reviewers

@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment on lines +13 to +75
name: pytest - ${{ matrix.os }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
env:
PYTHONUTF8: "1"
PYTHONPATH: ${{ github.workspace }}/service
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install deps (Ubuntu)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
set -eux
python -m pip install -U pip
pip install -r service/requirements.test.txt
if [ -f service/pyproject.toml ] || [ -f service/setup.cfg ] || [ -f service/setup.py ]; then
pip install -e service
fi
- name: Install deps (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
python -m pip install -U pip
pip install -r service/requirements.test.txt
$hasPythonProject = (Test-Path -Path 'service/pyproject.toml') -or
(Test-Path -Path 'service/setup.cfg') -or
(Test-Path -Path 'service/setup.py')
if ($hasPythonProject) {
python -m pip install -e service
} else {
Write-Host 'service packaging files not found; skipping'
}
- name: Show versions
shell: bash
run: |
python --version
pip --version
pytest --version
python -c "import sys,platform,os;print(platform.platform());print(sys.version);print('PYTHONPATH=',os.environ.get('PYTHONPATH'))"
- name: Run tests with coverage
shell: bash
run: |
python -m coverage run -m pytest -q
python -m coverage xml -o coverage.xml
- name: Upload coverage.xml
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-py${{ matrix.python-version }}
path: coverage.xml
if-no-files-found: error

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 months ago

To fix the problem, add a permissions block to the workflow. The minimal recommended permission is contents: read, which allows jobs read-only access to the repository contents and is sufficient for most test workflows that do not need to write or modify repository resources. This is best added at the root level, immediately after the name and triggers, thereby applying it to all jobs unless overridden at the job level.
Steps:

  • Add the following block after line 1 and before on on line 2 (or, equivalently, after on and before concurrency):
    permissions:
      contents: read
    This will restrict the job’s permissions to the minimum required, satisfying the principle of least privilege and eliminating the CodeQL warning.
Suggested changeset 1
.github/workflows/pytest.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
--- a/.github/workflows/pytest.yml
+++ b/.github/workflows/pytest.yml
@@ -1,4 +1,6 @@
 name: Pytest
+permissions:
+  contents: read
 on:
   push:
   pull_request:
EOF
@@ -1,4 +1,6 @@
name: Pytest
permissions:
contents: read
on:
push:
pull_request:
Copilot is powered by AI and may make mistakes. Always verify output.
@europanite europanite merged commit b89fc7d into main Oct 10, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants