[build-system]
requires = [
  "setuptools>=62.1",
  "setuptools_scm[toml]>=8.0.1",
  "wheel",
  "extension-helpers>=1.3.0,<2",
  "numpy>=2.0.0rc1",
]
build-backend = "setuptools.build_meta"

[project]
name = "sunpy"
description = "SunPy core package: Python for Solar Physics"
requires-python = ">=3.12"
readme = { file = "README.rst", content-type = "text/x-rst" }
license-files = ["LICENSE.rst", "licenses/*.rst"]
license = "BSD-3-Clause"
authors = [
  { name = "The SunPy Community", email = "sunpy@googlegroups.com" },
]
dependencies = [
  "astropy>=6.1.0",
  "fsspec>=2023.6.0",
  "numpy>=1.26.0",
  "numpy>=2.3.0;python_version=='3.14'",
  "packaging>=23.2",
  "parfive[ftp]>=2.1.0",
  "pyerfa>=2.0.1.1",
  "requests>=2.32.1",
]
dynamic = ["version"]
keywords = ["solar physics", "solar", "science", "sun", "wcs", "coordinates"]
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Intended Audience :: Science/Research",
  "Natural Language :: English",
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Programming Language :: Python :: 3.14",
  "Topic :: Scientific/Engineering :: Physics",
]

[project.optional-dependencies]
# The list of available extras is also in the installation docs,
# if you add or remove one please edit it there as well.
asdf = [
  "asdf-astropy>=0.5.0",
  "asdf>=3.0.0",
]
dask = ["dask[array]>=2023.6.0"]
image = [
  "scipy>=1.12.0",
]
jpeg2000 = [
  "glymur>=0.13.0",
  # While a direct dependency of glymur, we import it to save JPEG2000 files.
  # and we had issues with specific versions lxml.
  "lxml>=5.0.1",
]
map = [
  "contourpy>=1.1.0",
  "matplotlib>=3.8.0",
  "mpl-animators>=1.2.0",
  "reproject>=0.13.0",
  "scipy>=1.12.0",
]
opencv = ["opencv-python>=4.8.0.74,!=4.13.0.*"]
net = [
  "beautifulsoup4>=4.13.1",
  "drms>=0.7.1",
  "python-dateutil>=2.9.0",
  "tqdm>=4.66.0",
  "zeep>=4.3.0",
]
scikit-image = ["scikit-image>=0.21.0"]
spice = ["spiceypy>=6.0.0"]
timeseries = [
  "cdflib>=1.3.2",
  "h5netcdf>=1.2.0",
  # While a not direct dependency
  # We need to raise this to ensure the goes netcdf files open.
  "h5py>=3.10.0",
  "matplotlib>=3.8.0",
  "pandas>=2.2.0",
]
visualization = [
  "matplotlib>=3.8.0",
  "mpl-animators>=1.2.0",
]
core = ["sunpy[image,map,net,timeseries,visualization]"]
all = ["sunpy[core,asdf,jpeg2000,opencv,spice,scikit-image]"]
# We only use this extra for tests, but it is provided separate for
# users who want to opt-in to s3 support. It should not be included in
# [all] or conda deps.
# We also can't easily test this in oldestdeps because of
# co-versioning of aiobotocore & boto3 / botocore
s3 = [
  "fsspec[s3]>=2023.6.0",
  "aiobotocore>=2.6.0",
  "boto3>=1.31.17",
]
jupyter = [
  "itables>=2.2.4",
  "ipywidgets>=8.1.0",
]
# These dependencies are required to run the tests
tests-only = [
  "hvpy>=1.1.0",
  "jplephem>=2.19",
  "psutil>=6.0.0",
  "pytest-astropy>=0.11.0",
  "pytest-mpl>=0.18.0",
  "pytest>=7.4.0",
]
asdf-tests = [
  "sunpy[asdf]",
  # We can only install this plugin when we have the asdf extra installed
  "pytest-asdf-plugin>=0.1.1",
]
# This extra allows you to run all tests
tests = [
  "sunpy[all,s3,tests-only,asdf-tests,jupyter]",
]
docs = [
  "sunpy[all]",
  "sphinx>=7.1.0",
  "sphinx-automodapi>=0.16.0",
  "packaging>=23.2",
  "hvpy>=1.1.0",
  "ruamel.yaml>=0.18.0",
  "sphinx-changelog>=1.5.0",
  "sphinx-copybutton>=0.5.0",
  "sphinx-design>=0.5.0",
  "sphinx-gallery>=0.14.0",
  "sphinxext-opengraph>=0.9.0",
  "sunpy-sphinx-theme>=2.0.3",
  "sphinxcontrib-bibtex",
  "joblib", # for sphinx-gallery parallel
  "sphinx-autodoc-typehints",
]
docs-gallery = [
  "sunpy[docs]",
  "astroquery>=0.4.6",
  "jplephem>=2.19",
  "pillow",
  "exifread",
]
dev = ["sunpy[docs,tests]"]

[project.urls]
Homepage = "https://sunpy.org"
"Source Code" = "https://github.com/sunpy/sunpy"
Download = "https://pypi.org/project/sunpy"
Documentation = "https://docs.sunpy.org"
Changelog = "https://docs.sunpy.org/en/stable/whatsnew/changelog.html"
"Issue Tracker" = "https://github.com/sunpy/sunpy/issues"

[tool.setuptools]
zip-safe = false
include-package-data = true
platforms = ["any"]
provides = ["sunpy"]

[tool.setuptools.packages.find]
include = ["sunpy*"]
exclude = ["sunpy._dev*"]

[tool.setuptools.exclude-package-data]
"*" = ["*.c", "*.h"]

[tool.setuptools_scm]
version_file = "sunpy/_version.py"

[project.entry-points."asdf.resource_mappings"]
sunpy = "sunpy.io.special.asdf.entry_points:get_resource_mappings"

[project.entry-points."asdf.extensions"]
sunpy = "sunpy.io.special.asdf.entry_points:get_extensions"

[tool.distutils.bdist_wheel]
py-limited-api = "cp312"

[tool.extension-helpers]
use_extension_helpers = "true"

[tool.gilesbot]
  [ tool.gilesbot.milestones ]
  enabled = true
  missing_message_long = "This pull request does not have a milestone assigned to it. Only maintainers can change this, so you don't need to worry about it. :smile:"

  [tool.gilesbot.circleci_artifacts]
  enabled = true

  [tool.gilesbot.circleci_artifacts.figure_report]
  url = ".tmp/py312-figure/figure_test_images/fig_comparison.html"
  message = "Click details to see the figure test comparisons, for py312-figure."
  report_on_fail = true

  [tool.gilesbot.circleci_artifacts.figure_report_devdeps]
  url = ".tmp/py312-figure-devdeps/figure_test_images/fig_comparison.html"
  message = "Click details to see the figure test comparisons for py312-figure-devdeps."
  report_on_fail = 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/sunpy/sunpy/blob/main/changelog/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/sunpy/sunpy/blob/main/changelog/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/sunpy/sunpy/blob/main/changelog/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."

# TODO: This should be in towncrier.toml but Giles currently only works looks in
# pyproject.toml we should move this back when it's fixed.
[tool.towncrier]
  package = "sunpy"
  filename = "CHANGELOG.rst"
  directory = "changelog/"
  issue_format = "`#{issue} <https://github.com/sunpy/sunpy/pull/{issue}>`__"
  title_format = "{version} ({project_date})"

  [[tool.towncrier.type]]
  directory = "breaking"
  name = "Breaking Changes"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "deprecation"
  name = "Deprecations"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "removal"
  name = "Removals"
  showcontent = true

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

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

  [[tool.towncrier.type]]
  directory = "doc"
  name = "Documentation"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "trivial"
  name = "Internal Changes"
  showcontent = true
