Skip to content

Commit 5a00d6d

Browse files
authored
Move pytest config to pyproject.toml from setup.cfg (#1345)
* Move pytest config to pyproject.toml from setup.cfg * Fix build workflow * Fix build.yml GitHub Action workflow
1 parent ab8d431 commit 5a00d6d

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

.github/workflows/ci.yml renamed to .github/workflows/build.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
# For documentation on GitHub Actions Workflows, see:
22
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3-
name: CI
3+
name: "build"
44

55
on: [ push, pull_request ]
66

77
jobs:
8-
ci:
8+
build:
99
strategy:
10+
fail-fast: false
1011
matrix:
1112
os: [ ubuntu-latest, macos-latest, windows-latest ]
1213
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
13-
fail-fast: false
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- uses: actions/checkout@v4 # https://github.com/actions/checkout
1717
with:
1818
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
1919
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2020
fetch-depth: 0 # Needed for setuptools_scm to work correctly
21-
- name: Set up Python
22-
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
21+
- uses: actions/setup-python@v5 # https://github.com/actions/setup-python
2322
with:
2423
python-version: ${{ matrix.python-version }}
2524
allow-prereleases: true
26-
- name: Install python prerequisites
27-
run: pip install -U --user pip setuptools setuptools-scm nox
25+
- name: Install dependencies
26+
run: python -m pip install --upgrade pip setuptools setuptools-scm nox
2827
- name: Run tests and post coverage results
2928
env:
3029
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ warn_return_any = true
4848
warn_unreachable = true
4949
warn_unused_ignores = false
5050

51+
[tool.pytest.ini_options]
52+
testpaths = [
53+
"tests",
54+
"tests_isolated",
55+
]
56+
addopts = [
57+
"--cov=cmd2",
58+
"--cov-append",
59+
"--cov-report=term",
60+
"--cov-report=html",
61+
]
62+
5163
[tool.ruff]
5264
# Exclude a variety of commonly ignored directories.
5365
exclude = [

setup.cfg

-8
This file was deleted.

0 commit comments

Comments
 (0)