https://github.com/astropy/astropy
Raw File
Tip revision: 0a06e9aef297dbc3d9334afad57b79acaa540fd3 authored by P. L. Lim on 05 April 2024, 20:35:05 UTC
Merge pull request #16277 from eerovaher/coord-matching-tests
Tip revision: 0a06e9a
pyproject.toml
[project]
name = "astropy"
dynamic = [
    "version"
]
description = "Astronomy and astrophysics core library"
readme = "README.rst"
authors = [
    { name = "The Astropy Developers", email = "astropy.team@gmail.com" }
]
license = { text = "BSD-3-Clause" }
requires-python = ">=3.10"
classifiers = [
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: BSD License",
    "Operating System :: OS Independent",
    "Programming Language :: C",
    "Programming Language :: Cython",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: Implementation :: CPython",
    "Topic :: Scientific/Engineering :: Astronomy",
    "Topic :: Scientific/Engineering :: Physics",
]
keywords = [
    "astronomy",
    "astrophysics",
    "cosmology",
    "space",
    "science",
    "units",
    "table",
    "wcs",
    "samp",
    "coordinate",
    "fits",
    "modeling",
    "models",
    "fitting",
    "ascii",
]
dependencies = [
    "numpy>=1.23",
    "pyerfa>=2.0.1.1",
    "astropy-iers-data>=0.2024.4.1.0.33.14",
    "PyYAML>=3.13",
    "packaging>=19.0",
]

[project.optional-dependencies]
test = [
    "pytest>=7.0",
    "pytest-doctestplus>=0.12",
    "pytest-astropy-header>=0.2.1",
    "pytest-astropy>=0.10",
    "pytest-xdist",
    "threadpoolctl",
]
test_all = [
    "astropy[test]",  # installs the [test] dependencies
    "objgraph",
    "ipython>=4.2",
    "coverage[toml]",
    "skyfield>=1.20",
    "sgp4>=2.3",
    "array-api-strict",
]
recommended = [
    "scipy>=1.8",
    "matplotlib>=3.3,!=3.4.0,!=3.5.2",
]
typing = [
    "typing_extensions>=4.0.0"
]
all = [
    "astropy[recommended]",  # installs the [recommended] dependencies
    "astropy[typing]",
    "certifi",
    "dask[array]",
    "h5py",
    "pyarrow>=5.0.0",
    "beautifulsoup4",
    "html5lib",
    "bleach",
    "pandas",
    "sortedcontainers",
    "pytz",
    "jplephem",
    "mpmath",
    "asdf-astropy>=0.3",
    "bottleneck",
    "ipython>=4.2",
    "pytest>=7.0",
    "fsspec[http]>=2023.4.0",
    "s3fs>=2023.4.0",
    "pre-commit",
]
docs = [
    "astropy[recommended]",  # installs the [recommended] dependencies
    "sphinx",
    "sphinx-astropy[confv2]>=1.9.1",
    "pytest>=7.0",
    "sphinx-changelog>=1.2.0",
    "sphinx_design",
    "Jinja2>=3.1.3",
    "tomli; python_version < '3.11'",
    "sphinxcontrib-globalsubs >= 0.1.1",
]

[project.urls]
homepage = "https://www.astropy.org/"
documentation = "https://docs.astropy.org"
repository = "https://github.com/astropy/astropy"

[project.scripts]
fits2bitmap = "astropy.visualization.scripts.fits2bitmap:main"
fitscheck = "astropy.io.fits.scripts.fitscheck:main"
fitsdiff = "astropy.io.fits.scripts.fitsdiff:main"
fitsheader = "astropy.io.fits.scripts.fitsheader:main"
fitsinfo = "astropy.io.fits.scripts.fitsinfo:main"
samp_hub = "astropy.samp.hub_script:hub_script"
showtable = "astropy.table.scripts.showtable:main"
volint = "astropy.io.votable.volint:main"
wcslint = "astropy.wcs.wcslint:main"

[build-system]
requires = ["setuptools",
            "setuptools_scm>=6.2",
            "cython>=3.0.0,<3.1.0",
            "numpy>=2.0.0rc1", # see https://github.com/astropy/astropy/issues/16257
            "extension-helpers==1.*"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true
license-files = ["LICENSE.rst", "licenses/*.rst"]

[tool.setuptools.packages.find]
include = ["astropy*"]
exclude = ["astropy._dev*"]
namespaces = true

[tool.setuptools.package-data]
"*" = [
    "data/*",
    "data/*/*",
    "data/*/*/*",
    "data/*/*/*/*",
    "data/*/*/*/*/*",
    "data/*/*/*/*/*/*",
]
"astropy" = ["astropy.cfg", "CITATION"]
"astropy.cosmology" = ["*.ecsv"]
"astropy.tests.figures" = ["*.json"]
"astropy.wcs" = ["include/*/*.h"]
"astropy.wcs.tests" = ["extension/*.c"]
# Delete with deprecated astropy.utils.misc.walk_skip_hidden()
"astropy.utils.tests" = ["data/.hidden_file.txt"]

[tool.setuptools_scm]
write_to = "astropy/_version.py"

[tool.pytest.ini_options]
minversion = "7.0"
testpaths = [
    "astropy",
    "docs",
]
norecursedirs = [
    "docs[\\/]_build",
    "docs[\\/]generated",
    "astropy[\\/]extern",
    "astropy[\\/]_dev",
]
astropy_header = true
doctest_plus = "enabled"
text_file_format = "rst"
remote_data_strict = true
addopts = [
    "--color=yes",
    "--doctest-rst",
    "--strict-config",
    "--strict-markers",
    "-p no:legacypath",
]
log_cli_level = "info"
xfail_strict = true
filterwarnings = [
    "error",
    "ignore:unclosed <socket:ResourceWarning",
    "ignore:unclosed <ssl.SSLSocket:ResourceWarning",
    # Can be removed once Python>=3.11 is the minimum dependency,
    # cf. https://github.com/astropy/astropy/issues/13907
    "ignore:unclosed transport <asyncio.sslproto",
    "ignore:numpy\\.ufunc size changed:RuntimeWarning",
    "ignore:numpy\\.ndarray size changed:RuntimeWarning",
    "ignore:matplotlibrc text\\.usetex:UserWarning:matplotlib",
    # Triggered by ProgressBar > ipykernel.iostream (revisit when we bump oldest deps versions)
    "ignore:the imp module is deprecated:DeprecationWarning",
]
doctest_norecursedirs = [
    "*/setup_package.py",
    "*/tests/command.py",
]
doctest_subpackage_requires = [
    "astropy/cosmology/_io/mapping.py = python<3.12",  # PYTHON_LT_3_12 (PR 14784)
    "astropy/cosmology/_io/row.py = python<3.12",  # PYTHON_LT_3_12 (PR 14784)
    "astropy/cosmology/_io/table.py = python<3.12",  # PYTHON_LT_3_12 (PR 14784)
    "astropy/table/table.py = python<3.12",  # PYTHON_LT_3_12 (PR 14784)
    "astropy/table/mixins/dask.py = dask",
    "docs/io/fits/index.rst = numpy<1.25",  # NUMPY_LT_1_25 (Issue 14545)
    "docs/io/fits/usage/image.rst = numpy<1.25",  # NUMPY_LT_1_25 (Issue 14545)
    "docs/io/fits/usage/unfamiliar.rst = numpy<1.25",  # NUMPY_LT_1_25 (Issue 14545)
]
markers = [
    "mpl_image_compare",
]

[tool.astropy-bot]
    [tool.astropy-bot.autolabel]
        # Comment this out to re-enable but then labeler Action needs to be disabled.
        enabled = false

    [tool.astropy-bot.changelog_checker]
        enabled = false

[tool.cibuildwheel]
# We disable testing for the following wheels:
# - Linux AArch64 (no native hardware, tests take too long)
# - MuslLinux (tests hang non-deterministically)
test-skip = "*-manylinux_aarch64 *-musllinux_x86_64"

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]

[tool.cibuildwheel.linux]
archs = ["auto", "aarch64"]


[tool.docformatter]
    # The ``summaries`` are not (yet) 75 characters because the summary lines can't be
    # automatically wrapped and must be re-written, which should be done at some point.
    recursive = true
    wrap-summaries = 1000
    wrap-descriptions = 75
    black = true
    syntax = "numpy"


[tool.flynt]
exclude= [
    "astropy/extern",
    "astropy/coordinates/angles/angle_lextab.py",
    "astropy/units/format/cds_lextab.py",
    "astropy/units/format/general_lextab.py",
    "astropy/units/format/ogip_lextab.py",
    "astropy/coordinates/angles/angle_parsetab.py",
    "astropy/units/format/cds_parsetab.py",
    "astropy/units/format/general_parsetab.py",
    "astropy/units/format/ogip_parsetab.py",
]


[tool.coverage]

    [tool.coverage.run]
        omit = [
            "astropy/__init__*",
            "astropy/**/conftest.py",
            "astropy/**/setup*",
            "astropy/**/tests/*",
            "astropy/extern/*",
            "astropy/utils/compat/*",
            "astropy/version*",
            "astropy/wcs/docstrings*",
            "*/astropy/__init__*",
            "*/astropy/**/conftest.py",
            "*/astropy/**/setup*",
            "*/astropy/**/tests/*",
            "*/astropy/extern/*",
            "*/astropy/utils/compat/*",
            "*/astropy/version*",
            "*/astropy/wcs/docstrings*",
        ]

    [tool.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 defensive assertion code:
            "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_",
            # typing.TYPE_CHECKING is False at runtime
            "if TYPE_CHECKING:",
            # Ignore typing overloads
            "@overload",
        ]

[tool.ruff]
lint.select = ["ALL"]
exclude=[
    "astropy/extern/*",
    "*_parsetab.py",
    "*_lextab.py"
]
lint.ignore = [  # NOTE: non-permanent exclusions should be added to `.ruff.toml` instead.

    # flake8-builtins (A) : shadowing a Python built-in.
    # New ones should be avoided and is up to maintainers to enforce.
    "A00",

    # flake8-annotations (ANN)
    "ANN101",  # No annotation for `self`.
    "ANN102",  # No annotation for `cls`.

    # flake8-bugbear (B)
    "B008",  # FunctionCallArgumentDefault

    # flake8-commas (COM)
    "COM812",  # TrailingCommaMissing
    "COM819",  # TrailingCommaProhibited

    # pydocstyle (D)
    # Missing Docstrings
    "D102",  # Missing docstring in public method. Don't check b/c docstring inheritance.
    "D105",  # Missing docstring in magic method. Don't check b/c class docstring.
    # Whitespace Issues
    "D200",  # FitsOnOneLine
    # Docstring Content Issues
    "D410",  # BlankLineAfterSection. Using D412 instead.
    "D400",  # EndsInPeriod.  NOTE: might want to revisit this.

    # pycodestyle (E, W)
    "E711",  # NoneComparison  (see unfixable)
    "E741",  # AmbiguousVariableName. Physics variables are often poor code variables

    # flake8-fixme (FIX)
    "FIX002",  # Line contains TODO | notes for improvements are OK iff the code works

    # ISC001 shouldn't be used with ruff format
    # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
    "ISC001",

    # pep8-naming (N)
    "N803",  # invalid-argument-name. Physics variables are often poor code variables
    "N806",  # non-lowercase-variable-in-function. Physics variables are often poor code variables

    # pandas-vet (PD)
    "PD",

    # flake8-self (SLF)
    "SLF001", # private member access

    # flake8-todos (TD)
    "TD002",  # Missing author in TODO

    # Ruff-specific rules (RUF)
    "RUF005",  # unpack-instead-of-concatenating-to-collection-literal -- it's not clearly faster.
]

[tool.ruff.lint.extend-per-file-ignores]
"setup.py" = ["INP001"]  # Part of configuration, not a package.
".github/workflows/*.py" = ["INP001"]
"astropy/modeling/models/__init__.py" = ["F405"]
"astropy/utils/decorators.py" = [
    "D214", "D215",  # keep Examples section indented.
    "D411",  # sphinx treats spaced example sections as real sections
]
"test_*.py" = [
    "ANN201",  # Public function without return type annotation
    "B018",  # UselessExpression
    "D",  # pydocstyle
    "S101",  # Use of assert detected
]
".pyinstaller/*.py" = ["INP001"]  # Not a package.
"conftest.py" = ["INP001"]  # Part of configuration, not a package.
"docs/*.py" = [
    "INP001",  # implicit-namespace-package. The examples are not a package.
]
"examples/*.py" = [
    "E402",   # Imports are done as needed.
    "INP001", # implicit-namespace-package. The examples are not a package.
    "T203"    # pprint found
]

[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
mypy-init-return = true

[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true

[tool.ruff.lint.flake8-type-checking]
exempt-modules = []

[tool.ruff.lint.isort]
known-first-party = ["astropy", "extension_helpers"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.repo-review]
ignore = [
    "MY",    # ignore MyPy setting checks
    "PC111", # ignore using `blacken-docs` in pre-commit
    "PC140", # ignore using `mypy` in pre-commit
    "PC180", # ignore using `prettier` in pre-commit
    "PC901", # ignore using custom update message (we have many of the default ones in our history already)
    "PP308", # ignore requiring `-ra` flag for pytest, astropy's test suite is too large for this to be useful
]

[tool.towncrier]
    package = "astropy"
    filename = "CHANGES.rst"
    directory = "docs/changes"
    underlines = "=-^"
    template = "docs/changes/template.rst"
    title_format = "Version {version} ({project_date})"

    [[tool.towncrier.type]]
        directory = "feature"
        name = "New Features"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "api"
        name = "API Changes"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "bugfix"
        name = "Bug Fixes"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "other"
        name = "Other Changes and Additions"
        showcontent = true

    [[tool.towncrier.section]]
        name = ""
        path = ""

    [[tool.towncrier.section]]
        name = "astropy.config"
        path = "config"

    [[tool.towncrier.section]]
        name = "astropy.constants"
        path = "constants"

    [[tool.towncrier.section]]
        name = "astropy.convolution"
        path = "convolution"

    [[tool.towncrier.section]]
        name = "astropy.coordinates"
        path = "coordinates"

    [[tool.towncrier.section]]
        name = "astropy.cosmology"
        path = "cosmology"

    [[tool.towncrier.section]]
        name = "astropy.extern"
        path = "extern"

    [[tool.towncrier.section]]
        name = "astropy.io.ascii"
        path = "io.ascii"

    [[tool.towncrier.section]]
        name = "astropy.io.fits"
        path = "io.fits"

    [[tool.towncrier.section]]
        name = "astropy.io.misc"
        path = "io.misc"

    [[tool.towncrier.section]]
        name = "astropy.io.registry"
        path = "io.registry"

    [[tool.towncrier.section]]
        name = "astropy.io.votable"
        path = "io.votable"

    [[tool.towncrier.section]]
        name = "astropy.modeling"
        path = "modeling"

    [[tool.towncrier.section]]
        name = "astropy.nddata"
        path = "nddata"

    [[tool.towncrier.section]]
        name = "astropy.samp"
        path = "samp"

    [[tool.towncrier.section]]
        name = "astropy.stats"
        path = "stats"

    [[tool.towncrier.section]]
        name = "astropy.table"
        path = "table"

    [[tool.towncrier.section]]
        name = "astropy.tests"
        path = "tests"

    [[tool.towncrier.section]]
        name = "astropy.time"
        path = "time"

    [[tool.towncrier.section]]
        name = "astropy.timeseries"
        path = "timeseries"

    [[tool.towncrier.section]]
        name = "astropy.uncertainty"
        path = "uncertainty"

    [[tool.towncrier.section]]
        name = "astropy.units"
        path = "units"

    [[tool.towncrier.section]]
        name = "astropy.utils"
        path = "utils"

    [[tool.towncrier.section]]
        name = "astropy.visualization"
        path = "visualization"

    [[tool.towncrier.section]]
        name = "astropy.wcs"
        path = "wcs"

[tool.gilesbot]
    [tool.gilesbot.circleci_artifacts]
        enabled = true

    [tool.gilesbot.pull_requests]
        enabled = true

    [tool.gilesbot.towncrier_changelog]
        enabled = true
        verify_pr_number = true
        changelog_skip_label = "no-changelog-entry-needed"
        help_url = "https://github.com/astropy/astropy/blob/main/docs/changes/README.rst"
        changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/astropy/astropy/blob/main/docs/changes/README.rst)."
        type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/astropy/astropy/blob/main/docs/changes/README.rst)"
        number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file."

    [tool.gilesbot.circleci_artifacts.py310-test-image-mpl334]
        url = ".tmp/py310-test-image-mpl334/results/fig_comparison.html"
        message = "Click details to see the figure test comparisons, for py310-test-image-mpl334."
        report_on_fail = true

    [tool.gilesbot.circleci_artifacts.py310-test-image-mpldev]
        url = ".tmp/py310-test-image-mpldev/results/fig_comparison.html"
        message = "Click details to see the figure test comparisons for py310-test-image-mpldev."
        report_on_fail = true

[tool.codespell]
skip = "*.cff,*.dat,*.fits,*.hdr,*.xml,*egg*,*extern/*,.git,.tox,_build,fitshdr.htest_groups.py,venv,_*.c,wcs.h,lin.h,tab.h,spc.h,cython*"
# The following list of words for codespell to ignore may contain some
# misspellings that should be revisited and fixed in the future.
ignore-words-list = """
    aas,
    afile,
    ans,
    clen,
    cna,
    compiletime,
    coo,
    datas,
    ded,
    dfine,
    dne,
    doesnt,
    dout,
    dum,
    falsy,
    fo,
    fot,
    hart,
    hel,
    hendler,
    inflight,
    inout,
    lightyear,
    lod,
    lond,
    mapp,
    milimeter,
    moreso,
    nax,
    nd,
    ndefined,
    ned,
    nin,
    numer,
    ond,
    ot,
    precess,
    precessed,
    precesses,
    precessing,
    pres,
    rade,
    rotat,
    siz,
    som,
    splitted,
    stil,
    struc,
    te,
    thex,
    timere,
    tread,
    trun,
    ue,
    valu,
    watn,
    watstr,
    wirth"""
back to top