Changeset - 9293b6b67ca7
[Not reviewed]
1 3 0
Branko Majic (branko) - 2 months ago 2024-02-23 19:26:52
branko@majic.rs
GC-45: Update development-related requirements:

- Dropped ability to run setup.py test command (deprecation).
- Updated documentation for tox invocations.
- Updated all test and development-related requirements.
- Dropped use of deprecated project pytest-runner.
- Updated tox configuration (deprecations).
- Unfortunately, tox seems to mess with the COLUMNS environment
variable that breaks functional tests which depend on specific
formatting of help (breaklines included). Make sure the tests run
with column width of 80.
4 files changed with 19 insertions and 26 deletions:
0 comments (0 inline, 0 general)
docs/development.rst
Show inline comments
 
@@ -67,19 +67,14 @@ Testing
 
Project includes both unit tests (within ``tests/`` directory) , and
 
functional tests (within ``functional_tests/`` directory).
 

	
 
Tests can be run in a number of different ways, depending on what you
 
want to test and how.
 

	
 
To run the unit tests via setup script, run the following command from
 
repository root::
 

	
 
  python setup.py test
 

	
 
To run the unit tests directly, run the following command from
 
repository root::
 
To run the unit tests, run the following command from repository
 
root::
 

	
 
  pytest
 

	
 
Tests can be also run with coverage checks. By default coverage is
 
configured to report to standard output. Report will only list files
 
which lack coverage. For each file a percentage will be shown, as well
 
@@ -122,22 +117,22 @@ Tests can also be run using `tox <https://tox.readthedocs.io/>`_:
 
   When running tests via ``tox``, functional tests and coverage
 
   checks are included as well.
 

	
 
::
 

	
 
  # Run full suite of tests on all supported Python versions.
 
  tox
 
  tox run
 

	
 
  # List available tox environments.
 
  tox -l
 
  tox list
 

	
 
  # Run tests against specific Python version.
 
  tox -e py38
 
  tox run -e py38
 

	
 
  # Run documentation and linting tests only.
 
  tox -e doc,lint
 
  tox run -e doc,lint
 

	
 

	
 
Running tests on all supproted Python versions
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
With a range of different Python versions supported, it might be
 
@@ -177,13 +172,13 @@ perform the following steps:
 
   at time of this writing why such an error would be triggered, but
 
   it could have something to do with the ``vboxsf`` filesystem used
 
   for sharing the ``/vagrant`` directory.
 

	
 
::
 

	
 
     tox --workdir /tmp/
 
     tox run --workdir /tmp/
 

	
 

	
 
Building documentation
 
----------------------
 

	
 
Documentation is written in `reStructuredText
setup.cfg
Show inline comments
 
deleted file
setup.py
Show inline comments
 
@@ -33,31 +33,27 @@ install_requirements = [
 

	
 
doc_requirements = [
 
    'sphinx>=7.1,<7.2',
 
]
 

	
 
test_lint_requirements = [
 
    'flake8>=3.8,<3.9',
 
    'flake8>=7.0,<7.1',
 
]
 

	
 
test_requirements = [
 
    'freezegun>=1.0,<1.1',
 
    'pytest>=6.1,<6.2',
 
    'pytest-cov>=2.10,<2.11',
 
    'tox>=3.20,<3.21',
 
    'pexpect>=4.8,<4.9',
 
    'freezegun>=1.3,<1.4',
 
    'pytest>=8.0,<8.1',
 
    'pytest-cov>=4.1,<4.2',
 
    'tox>=4.13,<4.14',
 
    'pexpect>=4.9,<4.10',
 
]
 

	
 
release_requirements = [
 
    'twine',
 
]
 

	
 
setup_requirements = [
 
    'pytest-runner>=5.2,<5.3',
 
]
 

	
 
development_requirements = doc_requirements + test_requirements + test_lint_requirements + release_requirements
 

	
 
extras_requirements = {
 
    'devel': development_requirements,
 
    'doc': doc_requirements,
 
    'test': test_requirements,
 
@@ -77,13 +73,12 @@ setup(
 
    long_description=README,
 
    url='http://projects.majic.rs/gimmecert',
 
    author='Branko Majic',
 
    author_email='branko@majic.rs',
 
    python_requires=python_requirements,
 
    install_requires=install_requirements,
 
    setup_requires=setup_requirements,
 
    tests_require=test_requirements,
 
    extras_require=extras_requirements,
 
    entry_points={
 
        'console_scripts': ['gimmecert=gimmecert.cli:main'],
 
    },
 
    classifiers=[
tox.ini
Show inline comments
 
[tox]
 
envlist = {py38,py39},lint,doc
 

	
 
[testenv]
 
whitelist_externals =
 
allowlist_externals =
 
  make
 

	
 
basepython =
 
  doc: python3
 
  lint: python3
 
  py38: python3.8
 
  py39: python3.9
 

	
 
deps =
 
  .[test]
 

	
 
setenv =
 
  # Force column width for functional tests since they depend on
 
  # predictable output format.
 
  COLUMNS=80
 

	
 
commands =
 
  # Must specify cov-report explicitly, otherwise coverage starts
 
  # going through the tests as well.
 
  pytest --cov --cov-report=term-missing:skip-covered --basetemp={envtmpdir} tests/ functional_tests/
 

	
 
[testenv:lint]
0 comments (0 inline, 0 general)