Skip to content

Commit

Permalink
Declare test dependencies in [test] extra (#62)
Browse files Browse the repository at this point in the history
Adding a test dependency on 'pytest' will cause colcon to use pytest
when running the package's tests, which yields a better experience than
the existing fallback to unittest.
  • Loading branch information
cottsay authored Feb 28, 2024
1 parent f855c37 commit d66a06a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip dependencies
run: |
python -m pip install --upgrade --upgrade-strategy eager -r requirements.txt
python -m pip install --upgrade --upgrade-strategy eager .[test]
python -m pip freeze
- name: Run tests
Expand Down
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

14 changes: 12 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,20 @@ install_requires =
sphinx-rtd-theme
myst-parser
packages = find:
tests_require =
zip_safe = false

[options.extras_require]
test =
flake8
flake8-blind-except
flake8-builtins
flake8-class-newline
flake8-comprehensions
flake8-deprecated
flake8-docstrings
flake8-import-order
zip_safe = false
flake8-quotes
pytest

# [options.packages.find]
# exclude =
Expand Down

0 comments on commit d66a06a

Please sign in to comment.