[project] name = "biotite" requires-python = ">=3.11" description = "A comprehensive library for computational molecular biology" readme = "README.rst" authors = [{name = "The Biotite contributors"}] license = "BSD-3-Clause" license-files = ["LICENSE.rst"] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Bio-Informatics", ] dependencies = [ # Wheels compiled with NumPy 2.0 are backward compatible with NumPy 1.x # https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice "numpy >= 1.25", "biotraj >= 1.0, < 2.0", "requests >= 2.12", "msgpack >= 0.5.6", "networkx >= 2.0", "packaging >= 24.0", ] dynamic = ["version"] [project.optional-dependencies] test = [ "pytest", "pytest-codspeed", ] lint = [ "ruff == 0.9.7", "numpydoc == 1.8.0", ] [project.urls] homepage = "https://www.biotite-python.org" repository = "https://github.com/biotite-dev/biotite" documentation = "https://www.biotite-python.org" [tool.ruff.lint] # pyflakes, pycodestyle isort and varibale naming select = ["F", "E", "W", "I", "TID", "N"] ignore = [ # In docstrings long lines are often intentional # Most other ocassions are caught by the ruff formatter "E501", # Due to constants and class placeholders defined in functions "N806", ] [tool.ruff.lint.per-file-ignores] # Due to `* import` of BCIF encoding "src/biotite/setup_ccd.py" = ["F405", "F403"] # Due to imports after the PATH has been adjusted "doc/conf.py" = ["E402"] # Due to `from .module import *` imports in `__init__.py` modules "__init__.py" = ["F403", "TID252"] # Due to package existence check before other modules are imported "src/biotite/interface/**/__init__.py" = ["E402"] # Due to pymol scripts that are evaluated in other example scripts "doc/examples/**/*_pymol.py" = ["F821"] # Due to 'Table' class used as parametrized argument in test functions "benchmarks/sequence/align/benchmark_kmers.py" = ["N803"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" [tool.ruff.lint.isort] # No separator lines between import sections no-lines-before = [ "future", "standard-library", "third-party", "first-party", "local-folder", ] order-by-type = true known-first-party = ["biotite"] [tool.numpydoc_validation] # The description of each rule is documented at # https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks checks = [ "all", # ... except: "GL08", # Properties do not have a docstring "SS03", # Sometimes the citation comes after the period "SS05", # Too error-prone; classes do not use infinite verbs "SS06", # Sometimes summaries are a bit longer "ES01", # Some functions are simple enough to not need an extended summary "PR06", # The types are quite descriptive (include shape, dtype, etc.) "RT02", # In Biotite all return values have names # Intentionally not all docstrings contain these sections "YD01", "SA01", "EX01", ] exclude = [ '__init__$', # Subpackage descriptions are not Numpydoc formatted '\._[_a-z0-9]+$', # Do not validate private or special methods # Dataclasses: Numpydoc complains about additional constructor parameters, # but the constructor is absent 'sdf.Metadata\.Key', 'header.Header', 'throttle.ThrottleStatus', # Numpydoc does not accept the parameters of inherited constructors "query.DepositGrouping", "query.UniprotGrouping", # Function uses args/kwargs, but docstring describes parameter 'geometry.index_', 'query.FieldQuery', 'query.SimilarityQuery', 'query.IdentityQuery', 'query.StructureQuery', 'query.SuperOrSubstructureQuery', 'query.SuperstructureQuery', 'query.SubstructureQuery', # Numpydoc expects a return value for decorators 'application.requires_state', 'version.requires_version', 'object.validate', # Usage of the return value is not intended 'display.show', 'display.play', ] [tool.pytest.ini_options] testpaths = [ "tests", "benchmarks" ] python_files = [ "test_*.py", "benchmark_*.py", ] python_functions = [ "test_*", "benchmark_*", ] filterwarnings = [ # Appears in loading NetCDF trajectory files "ignore:The 'netCDF4' Python package is not installed.", "ignore:Input structure has no associated 'BondList'", ] [tool.hatch.build.targets.sdist] exclude = [ "tests", "benchmarks", "doc", "environment.yml", # .github, .gitignore, .gitattributes ".git*", ] artifacts = [ "src/biotite/structure/info/components.bcif" ] [tool.hatch.build.targets.wheel] artifacts = [ "src/biotite/structure/info/components.bcif" ] [tool.hatch.version] source = "vcs" [tool.hatch.build.hooks.vcs] version-file = "src/biotite/version.py" [tool.hatch.build.targets.wheel.hooks.cython] dependencies = ["hatch-cython"] [tool.hatch.build.targets.wheel.hooks.cython.options] include_numpy = true compile_py = false define_macros = [ ["NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"], ] [build-system] requires = [ "hatchling", "hatch-vcs == 0.4", "hatch-cython == 0.5", "numpy >= 2.0", "cython >= 3.0", ] build-backend = "hatchling.build"