From 150cf3830c0f65c10a98a5f678959b1757af9bfd Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Sep 03 2020 00:48:09 +0000 Subject: Pytest update and MANIFEST.in prune Allows execute tests with command `python setup.py test`. Signed-off-by: Ondřej Nosek --- diff --git a/.gitignore b/.gitignore index 63b0fcc..d7bd4c8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,9 +18,9 @@ tags htmlcov/ /.eggs/ .env/ -.py26env/ doc/build/ -doc/source/cli.rst +doc/source/_static doc/source/commands/ +doc/source/cli.rst doc/source/man_pages.json diff --git a/MANIFEST.in b/MANIFEST.in index 59d571a..9677c13 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,24 +1,14 @@ -include COPYING -include COPYING-koji -include LGPL -include CHANGELOG.rst -include README.rst -include CONTRIBUTING.md -include bin/rpkg -recursive-include tests * -recursive-include etc * - -include requirements/README.rst -include requirements/*.txt - global-exclude *.pyc global-exclude __pycache__ -include doc/Makefile -recursive-include doc *.rst *.py *.tmpl +exclude .gitignore # RST files under commands directory and other listed files are generated by # script when run make each time. They should not be included source # distribution package. + +prune doc/build prune doc/source/commands/ -exclude doc/source/cli.rst doc/source/man_pages.json +prune doc/source/_static/ +exclude doc/source/cli.rst +exclude doc/source/man_pages.json diff --git a/README.rst b/README.rst index 62595bd..8219fd8 100644 --- a/README.rst +++ b/README.rst @@ -80,8 +80,8 @@ Before make a pull request, ensure local changes pass all test cases. Before run tests, install these packages:: - sudo dnf install python37 git make gcc rpm-build rpm-devel libcurl-devel \ - krb5-devel openssl-devel python3-devel + sudo dnf install python27 python36 python37 git make gcc rpm-build \ + rpm-devel libcurl-devel krb5-devel openssl-devel python3-devel To run tests simply, ``make test``. diff --git a/requirements/test-pypi.txt b/requirements/test-pypi.txt index 00a1904..36e3436 100644 --- a/requirements/test-pypi.txt +++ b/requirements/test-pypi.txt @@ -1,6 +1,8 @@ coverage mock == 1.0.1 flake8 +pytest +pytest-cov # used in MBS tests openidc-client diff --git a/setup.py b/setup.py index d6b9758..3d62330 100755 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ setup( license="GPLv2+", url="https://pagure.io/rpkg", packages=find_packages(), + setup_requires=['setuptools_scm', 'pytest-runner'], install_requires=install_requires, extras_require={ ':python_version=="2.6"': [ @@ -70,7 +71,7 @@ setup( }, tests_require=tests_require, dependency_links=dep_links, - classifiers=( + classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', @@ -86,5 +87,5 @@ setup( 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Libraries :: Python Modules', - ), + ], ) diff --git a/tox.ini b/tox.ini index d6b0cef..9b09e3b 100644 --- a/tox.ini +++ b/tox.ini @@ -17,11 +17,6 @@ deps = -r{toxinidir}/requirements/pypi.txt -r{toxinidir}/requirements/test-pypi.txt - ; Tests run by `tox`, which require pytest is - ; installed in advance. - pytest - pytest-cov - commands = python -m pytest {posargs}