# The Selector library provides a set of tools for selecting a
# subset of the dataset and computing diversity.
#
# Copyright (C) 2023 The QC-Devs Community
#
# This file is part of Selector.
#
# Selector is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# Selector is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see
#
# --
[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "selector"
version = "0.0.1"
description = "Molecule selection with maximum diversity."
readme = "README.md"
#requires-python = ">=3.9,<4.0"
requires-python = ">=3.9"
# "LICENSE" is name of the license file, which must be in root of project folder
license = {file = "LICENSE"}
authors = [
{name = "QC-Devs Community", email = "qcdevs@gmail.com"},
]
keywords = [
"subset selection",
"variable selection",
"chemical diversity",
"compound selection",
"maximum diversity",
"chemical library design",
"compound acquisition",
]
# https://pypi.org/classifiers/
# Add PyPI classifiers here
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: GNU (Version 3)",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
# Required dependencies for install/usage of your package or application
# If you don't have any dependencies, leave this section empty
# Format for dependency strings: https://peps.python.org/pep-0508/
dependencies = [
"bitarray~=2.5.1",
"importlib-resources>=5.6.0",
"numpy>=1.21.2",
"pandas>=1.3.5",
"pytest>=6.2.5",
"scikit-learn>=1.0.1",
"scipy==1.11.1",
"setuptools>=58.0.4",
]
[project.scripts]
# Command line interface entrypoint scripts
# selector = "selector.__main__:main"
[project.urls]
# Use PyPI-standard names here
# Homepage
# Documentation
# Changelog
# Issue Tracker
# Source
# Discord server
homepage = "https://github.com/theochem/Selector"
documentation = "https://selector.qcdevs.org/"
repository = "https://github.com/theochem/Selector"
# Development dependencies
# pip install -e .[lint,test,exe]
# pip install -e .[dev]
[project.optional-dependencies]
lint = [
# ruff linter checks for issues and potential bugs
"ruff",
# checks for unused code
# "vulture",
# # required for codespell to parse pyproject.toml
# "tomli",
# # validation of pyproject.toml
# "validate-pyproject[all]",
# automatic sorting of imports
"isort",
# # automatic code formatting to follow a consistent style
# "black",
]
test = [
# Handles most of the testing work, including execution
# Docs: https://docs.pytest.org/en/stable/contents.html
"pytest==7.4.0",
# required by pytest
"hypothesis",
# "Coverage" is how much of the code is actually run (it's "coverage")
# Generates coverage reports from test suite runs
"pytest-cov>=3.0.0",
"tomli",
"scikit-learn>=1.0.1",
# Better parsing of doctests
"xdoctest",
# Colors for doctest output
"Pygments",
]
exe = [
"setuptools",
"wheel",
"build",
"tomli",
"pyinstaller",
"staticx;platform_system=='Linux'",
]
dev = [
# https://hynek.me/articles/python-recursive-optional-dependencies/
"selector[lint,test,exe]",
# # Code quality tools
# "mypy",
# # Improved exception traceback output
# # https://github.com/qix-/better-exceptions
# "better_exceptions",
# # Analyzing dependencies
# # install graphviz to generate graphs
# "graphviz",
# "pipdeptree",
]
[tool.setuptools]
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
platforms = ["Linux", "Windows", "MacOS"]
include-package-data = true
# This just means it's safe to zip up the bdist
zip-safe = true
# Non-code data that should be included in the package source code
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.package-data]
selector = ["*.xml"]
# Python modules and packages that are included in the
# distribution package (and therefore become importable)
[tool.setuptools.packages.find]
exclude = ["tests", "tests_*", "examples"]
# PDM example
#[tool.pdm.scripts]
#isort = "isort selector"
#black = "black selector"
#format = {composite = ["isort", "black"]}
#check_isort = "isort --check selector tests"
#check_black = "black --check selector tests"
#vulture = "vulture --min-confidence 100 selector tests"
#ruff = "ruff check selector tests"
#fix = "ruff check --fix selector tests"
#codespell = "codespell --toml ./pyproject.toml"
#lint = {composite = ["vulture", "codespell", "ruff", "check_isort", "check_black"]}
#[tool.codespell]
## codespell supports pyproject.toml since version 2.2.2
## NOTE: the "tomli" package must be installed for this to work
## https://github.com/codespell-project/codespell#using-a-config-file
## NOTE: ignore words for codespell must be lowercase
#check-filenames = ""
#ignore-words-list = "word,another,something"
#skip = "htmlcov,.doctrees,*.pyc,*.class,*.ico,*.out,*.PNG,*.inv,*.png,*.jpg,*.dot"
[tool.black]
line-length = 100
# If you need to exclude directories from being reformatted by black
# force-exclude = '''
# (
# somedirname
# | dirname
# | filename\.py
# )
# '''
[tool.isort]
profile = "black"
known_first_party = ["selector"]
# If you need to exclude files from having their imports sorted
#extend_skip_glob = [
# "selector/somefile.py",
# "selector/somedir/*",
#]
# https://beta.ruff.rs/docs
[tool.ruff]
line-length = 100
show-source = true
# Rules: https://beta.ruff.rs/docs/rules
# If you violate a rule, lookup the rule on the Rules page in ruff docs.
# Many rules have links you can click with a explanation of the rule and how to fix it.
# If there isn't a link, go to the project the rule was source from (e.g. flake8-bugbear)
# and review it's docs for the corresponding rule.
# If you're still confused, ask a fellow developer for assistance.
# You can also run "ruff rule " to explain a rule on the command line, without a browser or internet access.
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # Warning
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EXE", # flake8-executable,
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RET", # flake8-return
"TID", # flake8-tidy-imports
"ARG", # flake8-unused-arguments
"PGH", # pygrep-hooks
"PLC", # Pylint Convention
"PLE", # Pylint Errors
"PLW", # Pylint Warnings
"RUF", # Ruff-specific rules
# ** Things to potentially enable in the future **
# DTZ requires all usage of datetime module to have timezone-aware
# objects (so have a tz argument or be explicitly UTC).
# "DTZ", # flake8-datetimez
# "PTH", # flake8-use-pathlib
# "SIM", # flake8-simplify
]
# Files to exclude from linting
extend-exclude = [
"*.pyc",
"__pycache__",
"*.egg-info",
".eggs",
# check point files of jupyter notebooks
"*.ipynb_checkpoints",
".tox",
".git",
"build",
"dist",
"docs",
"examples",
"htmlcov",
"notebooks",
".cache",
"_version.py",
]
# Linting error codes to ignore
ignore = [
"F403", # unable to detect undefined names from star imports
"F405", # undefined locals from star imports
"W605", # invalid escape sequence
"A003", # shadowing python builtins
"RET505", # unnecessary 'else' after 'return' statement
"RET504", # Unnecessary variable assignment before return statement
"RET507", # Unnecessary {branch} after continue statement
"PT011", # pytest-raises-too-broad
"PT012", # pytest.raises() block should contain a single simple statement
"PLW0603", # Using the global statement to update is discouraged
"PLW2901", # for loop variable overwritten by assignment target
"G004", # Logging statement uses f-string
"PIE790", # no-unnecessary-pass
"PIE810", # multiple-starts-ends-with
"PGH003", # Use specific rule codes when ignoring type issues
"PLC1901", # compare-to-empty-string
]
# Linting error codes to ignore on a per-file basis
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401", "E501"]
"selector/somefile.py" = ["E402", "E501"]
"selector/somedir/*" = ["E501"]
# Configuration for mypy
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
[tool.mypy]
python_version = "3.9"
follow_imports = "skip"
ignore_missing_imports = true
files = "selector" # directory mypy should analyze
# Directories to exclude from mypy's analysis
exclude = [
"selector/somedir",
"selector/somefile\\.py",
"dirname",
]
# Configuration for pytest
# https://docs.pytest.org/en/latest/reference/customize.html#pyproject-toml
[tool.pytest.ini_options]
addopts = [
# Allow test files to have the same name in different directories.
"--import-mode=importlib",
"--cache-clear",
"--showlocals",
"-v",
"-r a",
"--cov-report=term-missing",
"--cov=selector",
]
# directory containing the tests
testpaths = [
"selector/tests",
"selector/methods/tests",
]
norecursedirs = [
".vscode",
"__pycache__",
"build",
]
# Warnings that should be ignored
filterwarnings = [
"ignore::DeprecationWarning"
]
# custom markers that can be used using pytest.mark
markers = [
"slow: lower-importance tests that take an excessive amount of time",
]
# Configuration for coverage.py
[tool.coverage.run]
# files or directories to exclude from coverage calculations
omit = [
'selector/somedir/*',
'selector/somefile.py',
]
# Configuration for vulture
[tool.vulture]
# Files or directories to exclude from vulture
# The syntax is a little funky
exclude = [
"somedir",
"*somefile.py",
]
# configuration for bandit
[tool.bandit]
exclude_dirs = [
"selector/tests",
"selector/methods",
]
skips = [
"B101", # Ignore assert statements
"B311", # Ignore pseudo-random generators
"B404", # Ignore subprocess import
"B603", # Ignore subprocess call
"B607", # Ignore subprocess call
]