Skip to content

Commit

Permalink
Declare test dependencies in [test] extra (#251)
Browse files Browse the repository at this point in the history
Also introduce a constraints file to handle Python 2 in CI.
  • Loading branch information
cottsay authored Mar 11, 2022
1 parent cea5839 commit 7de384c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ jobs:
python-version: ${{matrix.python}}
- name: Install dependencies
run: |
if test ${{matrix.python}} = 2.7; then
python -m pip install pyparsing==2.4.7 'PyYAML<6.0'
fi
python -m pip install --upgrade pip setuptools
python -m pip install mock pytest pytest-cov
python setup.py build develop
python -m pip install -U -e .[test] pytest-cov -c constraints.txt
- name: Run tests
run: |
python -m pytest --cov test
2 changes: 2 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyparsing==2.4.7; python_version < '3'
PyYAML<6.0; python_version < '3'
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
'console_scripts': ['rosversion=rospkg.rosversion:main'],
},
'install_requires': install_requires,
'extras_require': {
'test': [
"mock; python_version < '3.3'",
'pytest',
]},
'author': 'Ken Conley',
'author_email': '[email protected]',
'url': 'http://wiki.ros.org/rospkg',
Expand Down

0 comments on commit 7de384c

Please sign in to comment.