[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "PANORAMA"

authors = [
    { name = "Jérôme Arnoux", email = "arnoux.jeromepj@gmail.com" },
    { name = "Jean Mainguy", email = "jmainguy@genoscope.cns.fr" },
]
#maintainers
keywords = ["Pangenomics", "Comparative genomics", "Bioinformatics", "Prokaryote"]
description = "Comparative pangenomic analysis toolbox"
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENCE" }
classifiers = ["Development Status :: Open alpha",
    "Environment :: Console",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)",
    "Natural Language :: English",
    "Operating System :: POSIX :: Linux",
    "Programming Language :: Python :: 3",
    "Topic :: Scientific/Engineering :: Bio-Informatics"]
dynamic = ["version"]
dependencies = [
    "ppanggolin>=2.1.0",
    "pyhmmer>=0.12.0",
    "lxml>=6.0.2",
    "selenium>=4.36.0",
]


[project.optional-dependencies]
doc = [
    "sphinx>=8.1.3",
    "readthedocs-sphinx-search>=0.3.2",
    "sphinx-autobuild>=2024.10.3",
    "myst-parser>=4.0.1",
    "docutils>=0.21.2",  # Version 0.22.2 is not compatible with myst parser 4.0.1
    "sphinxcontrib.mermaid>=1.0.0",
    "sphinxcontrib-jquery>=4.1",
    "sphinx_design>=0.6.1",
    "pydata-sphinx-theme>=0.16.1",
    "sphinx-autodoc-typehints>=3.0.1",
    "sphinx-copybutton>=0.5.2"
]
dev = [
    "matplotlib>=3.10.6",
    "squarify>=0.4.4",
    "seaborn>=0.13.2",
    "vitables==3.0.0",  # need this version because ppanggolin is compatible with numpy<2.0.0
    "viztracer>=1.0.4",
    "ruff>=0.13.3"
]
#
test = [
    "pytest>=8.4.2",
    "natsort>=8.4.0",
    "pytest-cov>=7.0.0",
]
[project.urls]
Homepage = "https://labgem.genoscope.cns.fr"
Repository = "https://github.com/labgem/PANORAMA"
#Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"
#Documentation = "https://readthedocs.org"
#
#
[project.scripts]
panorama = "panorama.main:main"

#[project.gui-scripts]  useful for windows https://packaging.python.org/en/latest/specifications/entry-points/
#spam-gui = "spam:main_gui"
#
#[project.entry-points."spam.magical"] useful for windows
#tomatoes = "spam:main_tomatoes"

[tool.setuptools]
packages = ["panorama"]
[tool.setuptools.dynamic]
version = { file = "VERSION" }

[tool.pytest.ini_options]
markers = [
    "requires_test_data: marks tests that require test dataset path to be provided",
]
log_cli = true
log_cli_level = "WARNING"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"

[tool.ruff]
line-length = 120
indent-width = 4

# Assume Python 3.9
target-version = "py310"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = [
    "E", # pycodestyle errors
    "W", # pycodestyle warnings
    "F", # pyflakes
    "I", # isort
    "B", # flake8-bugbear
]
ignore = [
    "E203",
    "W291"
]
exclude = [
    "docs/",
    ".github/"
]

# Allow fix for all enabled rules (when `--fix`) is provided.
#fixable = ["ALL"]
#unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
