【发布时间】:2020-08-31 14:00:48
【问题描述】:
尝试将cov = coverage report --show-missing 等快捷方式添加到 setup.cfg 的[aliases] 部分会导致python setup.py cov 失败并显示error: invalid command 'coverage'。 需要哪些额外的选项来支持这一点?
版本信息:
$ python -V
Python 3.7.3
$ pip list | egrep 'setuptools|pip|coverage|pytest'
coverage 5.2.1
pip 20.2.2
pytest 5.4.3
pytest-html 2.1.1
pytest-metadata 1.10.0
setuptools 50.0.0
setup.cfg:
[aliases]
test = coverage run -m pytest --html=pytest-report.html --self-contained-html
cov = coverage report --show-missing
covhtml = coverage html --title "Coverage report - xyz"
[tool:pytest]
testpaths = tests
[coverage:run]
branch = True
source = pyapp
[options]
# ...
install_requires =
Flask==1.1.*
psycopg2==2.8.*
requests==2.*
werkzeug==1.*
click==7.*
setup_requires =
pytest-runner
tests_require =
coverage
pytest
pytest-html
【问题讨论】:
标签: python python-3.x setuptools setup.py