[tool:pytest]
minversion = 6.0
norecursedirs = build docs/_build
testpaths = "pyvo" "docs"
astropy_header = true
doctest_plus = enabled
text_file_format = rst
addopts = --doctest-rst --doctest-continue-on-failure
remote_data_strict = true
filterwarnings =
    error
    ignore:numpy.ndarray size changed:RuntimeWarning
    ignore:unclosed <socket:ResourceWarning
    ignore:unclosed <ssl.SSLSocket:ResourceWarning
# This can be removed once the minimum astropy is 5.0.1?
    ignore:distutils Version classes are deprecated:DeprecationWarning
# Numpy 2.0 deprecations triggered by upstream libraries.
# Exact warning messages differ, thus using a super generic filter.
    ignore:numpy.core:DeprecationWarning
# We need to ignore this module level warning to not cause issues at collection time.
# Remove it once warning is removed from code (in 1.7).
    ignore:pyvo.discover:pyvo.utils.prototype.PrototypeWarning

[flake8]
max-line-length = 110
max-doc-length = 110
exclude = __init__.py, conf.py, setup.py, version.py, conftest.py
# W503 line break before operator
# E124 closing bracket does not match visual indentation
# E127 continuation line over-indented for visual indent
# E226 missing whitespace around arithmetic operator
ignore = W503,E124,E127,E226,E128,E131


[pycodestyle]
max-line-length = 110
max-doc-length = 110

[metadata]
name = pyvo
description = Astropy affiliated package for accessing Virtual Observatory data and services
long_description = file: README.rst
author = the PyVO Developers
license = BSD-3-Clause
license_file = LICENSE.rst
edit_on_github = False
github_project = astropy/pyvo
project_urls =
    Source = https://github.com/astropy/pyvo
    Documentation = https:/pyvo.readthedocs.io
classifiers =
    Intended Audience :: Science/Research
    Operating System :: OS Independent
    Programming Language :: Python
    Programming Language :: Python :: 3
    Topic :: Database
    Topic :: Scientific/Engineering :: Astronomy
    Topic :: Software Development :: Libraries


[options]
packages = find:
zip_safe = False
setup_requires = setuptools_scm
install_requires =
    astropy>=4.2
    requests
python_requires = >=3.9

[options.extras_require]
all =
    pillow
    defusedxml
test =
    pytest-doctestplus>=0.13
    pytest-astropy
    requests-mock
docs =
    sphinx-astropy

[options.package_data]
pyvo.auth.tests = data/tap/*.xml
pyvo.io.uws.tests = data/*.xml
pyvo.io.vosi.tests = data/*.xml, data/tables/*.xml, data/capabilities/*.xml
pyvo.registry.tests = data/*.xml, data/*.desise
pyvo.mivot.tests = data/*.xml, data/input/*.xml, data/output/*.xml, data/reference/*json, data/reference/*xml
pyvo.dal.tests = data/*.xml, data/*/*

[coverage:run]
source = pyvo
omit =
    pyvo/_astropy_init*
    pyvo/conftest.py
    pyvo/*setup_package*
    pyvo/tests/*
    pyvo/*/tests/*
    pyvo/extern/*
    pyvo/version*
    */pyvo/_astropy_init*
    */pyvo/conftest.py
    */pyvo/*setup_package*
    */pyvo/tests/*
    */pyvo/*/tests/*
    */pyvo/extern/*
    */pyvo/version*

[coverage:report]
exclude_lines =
  # Have to re-enable the standard pragma
  pragma: no cover
  # Don't complain about packages we have installed
  except ImportError
  # Don't complain if tests don't hit assertions
  raise AssertionError
  raise NotImplementedError
  # Don't complain about script hooks
  def main\(.*\):
  # Ignore branches that don't pertain to this version of Python
  pragma: py{ignore_python_version}
  # Don't complain about IPython completion helper
  def _ipython_key_completions_
