From cc8879431c96d022038151352ff534d73d26a23e Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 23 Oct 2024 13:32:00 -0400 Subject: [PATCH 1/3] Move pytest config to pyproject.toml from setup.cfg --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 31 ------------------------------- pyproject.toml | 12 ++++++++++++ setup.cfg | 8 -------- 4 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 setup.cfg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5acc82d3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +# For documentation on GitHub Actions Workflows, see: +# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +name: "build" + +on: [ push, pull_request ] + +jobs: + build: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 # https://github.com/actions/checkout + with: + # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. + # Set fetch-depth: 0 to fetch all history for all branches and tags. + fetch-depth: 0 # Needed for setuptools_scm to work correctly + - uses: actions/setup-python@v5 # https://github.com/actions/setup-python + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + - name: Install dependencies + run: python -m pip install --upgrade pip setuptools setuptools-scm nox + - name: Run tests and post coverage results + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python -m nox --non-interactive --session tests-${{ matrix.python-version }} # Run nox for a single version of Python diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 6a25f275..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -# For documentation on GitHub Actions Workflows, see: -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: CI - -on: [ push, pull_request ] - -jobs: - ci: - strategy: - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] - fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 # https://github.com/actions/checkout - with: - # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. - # Set fetch-depth: 0 to fetch all history for all branches and tags. - fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm nox - - name: Run tests and post coverage results - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python -m nox --non-interactive --session tests-${{ matrix.python-version }} # Run nox for a single version of Python diff --git a/pyproject.toml b/pyproject.toml index 189d5292..3d4298d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,18 @@ warn_return_any = true warn_unreachable = true warn_unused_ignores = false +[tool.pytest.ini_options] +testpaths = [ + "tests", + "tests_isolated", +] +addopts = [ + "--cov=cmd2", + "--cov-append", + "--cov-report=term", + "--cov-report=html", +] + [tool.ruff] # Exclude a variety of commonly ignored directories. exclude = [ diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8e539d0c..00000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[tool:pytest] -testpaths = - tests -addopts = - --cov=cmd2 - --cov-append - --cov-report=term - --cov-report=html From 42f9e6b2848152d096f03f314d0a07b7eeaa79ee Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 23 Oct 2024 14:09:11 -0400 Subject: [PATCH 2/3] Fix build workflow --- .github/workflows/build.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5acc82d3..5bf7be17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,20 +11,20 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 # https://github.com/actions/checkout - with: - # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. - # Set fetch-depth: 0 to fetch all history for all branches and tags. - fetch-depth: 0 # Needed for setuptools_scm to work correctly - - uses: actions/setup-python@v5 # https://github.com/actions/setup-python - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - name: Install dependencies - run: python -m pip install --upgrade pip setuptools setuptools-scm nox - - name: Run tests and post coverage results - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python -m nox --non-interactive --session tests-${{ matrix.python-version }} # Run nox for a single version of Python + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 # https://github.com/actions/checkout + with: + # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. + # Set fetch-depth: 0 to fetch all history for all branches and tags. + fetch-depth: 0 # Needed for setuptools_scm to work correctly + - uses: actions/setup-python@v5 # https://github.com/actions/setup-python + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + - name: Install dependencies + run: python -m pip install --upgrade pip setuptools setuptools-scm nox + - name: Run tests and post coverage results + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python -m nox --non-interactive --session tests-${{ matrix.python-version }} # Run nox for a single version of Python From fc3b47e7b6f12d79aac4abf023cd1b84ecd15f1c Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 23 Oct 2024 14:16:25 -0400 Subject: [PATCH 3/3] Fix build.yml GitHub Action workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bf7be17..5bbc482e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,10 @@ on: [ push, pull_request ] jobs: build: strategy: + fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] - fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout