[build-system]
build-backend = 'setuptools.build_meta'
# setuptools-scm is required at build time: its setuptools file-finder
# entry point is what populates the sdist with the full set of
# git-tracked files (docs/, tests/ data, tox.ini, .github/, ...).
# Dropping it silently shrinks the sdist and omits the test harness, so
# it must stay even though the version itself is static (see
# tool.setuptools.dynamic below).
requires = ['setuptools', 'setuptools-scm']

[project]
name = 'progressbar2'
description = 'A Python Progressbar library to provide visual (yet text based) progress to long running operations.'
dynamic = ['version']
authors = [{ name = 'Rick van Hattem (Wolph)', email = 'wolph@wol.ph' }]
license = { text = 'BSD-3-Clause' }
readme = 'README.md'
keywords = [
    'REPL',
    'animated',
    'bar',
    'color',
    'console',
    'duration',
    'efficient',
    'elapsed',
    'eta',
    'feedback',
    'live',
    'meter',
    'monitor',
    'monitoring',
    'multi-threaded',
    'progress',
    'progress-bar',
    'progressbar',
    'progressmeter',
    'python',
    'rate',
    'simple',
    'speed',
    'spinner',
    'stats',
    'terminal',
    'throughput',
    'time',
    'visual',
]
classifiers = [
    'Development Status :: 5 - Production/Stable',
    'Development Status :: 6 - Mature',
    'Environment :: Console',
    'Environment :: MacOS X',
    'Environment :: Other Environment',
    'Environment :: Win32 (MS Windows)',
    'Environment :: X11 Applications',
    'Framework :: IPython',
    'Framework :: Jupyter',
    'Intended Audience :: Developers',
    'Intended Audience :: Education',
    'Intended Audience :: End Users/Desktop',
    'Intended Audience :: Other Audience',
    'Intended Audience :: System Administrators',
    'License :: OSI Approved :: BSD License',
    'Natural Language :: English',
    'Operating System :: MacOS :: MacOS X',
    'Operating System :: MacOS',
    'Operating System :: Microsoft :: MS-DOS',
    'Operating System :: Microsoft :: Windows',
    'Operating System :: Microsoft',
    'Operating System :: POSIX :: BSD :: FreeBSD',
    'Operating System :: POSIX :: BSD',
    'Operating System :: POSIX :: Linux',
    'Operating System :: POSIX :: SunOS/Solaris',
    'Operating System :: POSIX',
    'Operating System :: Unix',
    'Programming Language :: Python :: 3 :: Only',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.10',
    'Programming Language :: Python :: 3.11',
    'Programming Language :: Python :: 3.12',
    'Programming Language :: Python :: 3.13',
    'Programming Language :: Python :: 3.14',
    'Programming Language :: Python :: 3.15',
    'Programming Language :: Python :: Implementation :: IronPython',
    'Programming Language :: Python :: Implementation :: PyPy',
    'Programming Language :: Python :: Implementation',
    'Programming Language :: Python',
    'Programming Language :: Unix Shell',
    'Topic :: Desktop Environment',
    'Topic :: Education :: Computer Aided Instruction (CAI)',
    'Topic :: Education :: Testing',
    'Topic :: Office/Business',
    'Topic :: Other/Nonlisted Topic',
    'Topic :: Software Development :: Build Tools',
    'Topic :: Software Development :: Libraries',
    'Topic :: Software Development :: Libraries :: Python Modules',
    'Topic :: Software Development :: Pre-processors',
    'Topic :: Software Development :: User Interfaces',
    'Topic :: System :: Installation/Setup',
    'Topic :: System :: Logging',
    'Topic :: System :: Monitoring',
    'Topic :: System :: Shells',
    'Topic :: Terminals',
    'Topic :: Utilities',
    'Typing :: Typed',
]

requires-python = '>=3.10'
dependencies = ['python-utils >= 3.8.1']

[project.urls]
bugs = 'https://github.com/wolph/python-progressbar/issues'
documentation = 'https://progressbar-2.readthedocs.io/en/latest/'
repository = 'https://github.com/wolph/python-progressbar/'

[project.scripts]
progressbar = 'progressbar.__main__:main'

[project.optional-dependencies]
# Optional native iterator accelerator. When installed it is detected and used
# automatically (the iterator path drops to ~5 ns/iter); otherwise progressbar2
# falls back to the pure-Python gate. See the Performance section in README.
fast = [
    'speedups>=2.1.0',
]
docs = [
    'sphinx>=1.8.5',
    'sphinx-autodoc-typehints>=1.6.0',
]
tests = [
    'dill>=0.3.6',
    'freezegun>=0.3.11',
    'pytest-cov>=2.6.1',
    'pytest>=4.6.9',
    'pywin32; sys_platform == "win32"',
]
# Only installed by .github/workflows/docs.yml -- never by the default
# test run (tests/console is excluded from pytest.ini's python_files, and
# `tests[]` above -- what `dev` pulls in -- deliberately omits this group).
docs-tests = [
    # freezegun and pytest-cov are not used by tests/console itself, but
    # the shared tests/conftest.py imports freezegun at module scope and
    # the workflow passes --no-cov, so both must be importable.
    'freezegun>=0.3.11',
    'playwright>=1.48.0',
    'pytest-cov>=2.6.1',
    'pytest>=4.6.9',
]

[dependency-groups]
dev = ['progressbar2[docs,tests]']

[tool.codespell]
skip = '*/htmlcov,./docs/_build,*.asc,./docs/_static/vendor/xterm.js'
ignore-words-list = 'datas,numbert'

[tool.coverage.run]
branch = true
source = ['progressbar', 'tests']
omit = [
    '*/mock/*',
    '*/nose/*',
    '.tox/*',
    '*/os_specific/*',
]

[tool.coverage.paths]
source = ['progressbar']

[tool.coverage.report]
fail_under = 100
exclude_lines = [
    'pragma: no cover',
    '@abc.abstractmethod',
    'def __repr__',
    'if self.debug:',
    'if settings.DEBUG',
    'raise AssertionError',
    'raise NotImplementedError',
    'if 0:',
    'if __name__ == .__main__.:',
    'if types.TYPE_CHECKING:',
    'if typing.TYPE_CHECKING:',
    '@typing.overload',
    'if os.name == .nt.:',
    'typing.Protocol',
]


[tool.mypy]
packages = ['progressbar', 'tests']
exclude = [
    '^docs$',
    '^tests/original_examples.py$',
    '^examples.py$',
]


[tool.pyright]
include = ['progressbar']
exclude = ['examples', '.tox']
ignore = ['docs']
strict = [
    'progressbar/algorithms.py',
    'progressbar/env.py',
#    'progressbar/shortcuts.py',
    'progressbar/multi.py',
    'progressbar/__init__.py',
    'progressbar/terminal/__init__.py',
    'progressbar/terminal/stream.py',
    'progressbar/terminal/os_specific/__init__.py',
#    'progressbar/terminal/os_specific/posix.py',
#    'progressbar/terminal/os_specific/windows.py',
    'progressbar/terminal/base.py',
    'progressbar/terminal/colors.py',
#    'progressbar/widgets.py',
#    'progressbar/utils.py',
    'progressbar/__about__.py',
#    'progressbar/bar.py',
    'progressbar/__main__.py',
    'progressbar/base.py',
]

reportIncompatibleMethodOverride = false
reportUnnecessaryIsInstance = false
reportUnnecessaryCast = false
reportUnnecessaryComparison = false
reportUnnecessaryContains = false


[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = { attr = 'progressbar.__about__.__version__' }

[tool.setuptools.packages.find]
# Only the installable package goes into the wheel. The previous
# exclude list ('docs*', 'tests*') still let auto-discovery sweep the
# repo-level benchmarks/, scripts/ and tools/ directories into
# site-packages. The sdist is unaffected: its contents come from the
# setuptools-scm file finder (see build-system).
include = ['progressbar*']

# Keeps stray *data* files out of the wheel. Note this cannot exclude
# stray *modules*: setuptools' build_py copies every `*.py` inside an
# included package, and there is no declarative way to drop individual
# ones. So an editor or sync-tool leftover such as
# `progressbar/bar.sync-conflict-....py` still gets packaged, because the
# wheel builder walks the filesystem rather than the git index (only the
# sdist is git-aware, via setuptools-scm).
# `scripts/build_docs_wheels.py` therefore refuses to publish a wheel that
# contains such files, which turns a silent leak into a build failure.
[tool.setuptools.exclude-package-data]
'*' = [
    '*.sync-conflict-*',
    '*.orig',
    '*.rej',
    '*.bak',
]