[metadata]
description-file = "README.md"

[build-system]
# This section instructs pip on how to install
# In particular, it should install using Poetry's `poetry.masonry.api` build
# And that it requires certain versions of poetry, virtualenv, and wheel
# See https://www.python.org/dev/peps/pep-0518/ for how this works
# == A note about these default choices ==
# virtualenv 20.0.34 partly breaks pre-commit under conda
# https://github.com/ContinuumIO/anaconda-issues/issues/12094
# Poetry uses pip and setuptools (although they're not included as dependencies)
# We don't need to list wheel here, but setting a min vr can avoid generating inferior wheels
requires = ["poetry>=1.1,<2", "virtualenv==20.0.33", "wheel>=0.36,<1.0"]
build-backend = "poetry.masonry.api"


#########################################################################################
# Poetry metadata
#########################################################################################

# This is all metadata that Poetry uses directly.
# TODO: You will want to modify this section.
# Hopefully the defaults are good, so you only need to change the individual TODOs.
# Note that some of these can be filled in with arguments to `tyrannosaurus new` (e.g. --keywords).

[tool.poetry]

name = "$${pkg}"
# This is the version of your project. Keep it up-to-date and follow semantic versioning.
# It's used in the PyPi, wheels, Docker, and GitHub packages.
# Also make sure to use exactly this version when creating a GitHub release,
# but prefix a "v" to the GitHub release.
# E.g. This might be "1.2.13", and the GitHub release will be "v1.2.13".
# Although semantic versioning allows for build tags (metadata),
# not all tools are compatible with it, so avoid it if you can.
version = "0.1.0"

# TODO: Set the description and keywords here
description = "$${description}"
keywords = $${keywords.list}
authors = $${authors.list}
maintainers = $${authors.list}
# This must be an identifier listed in https://spdx.org/licenses/
license = "$${license.spdx}"
readme = "README.md"
homepage = "https://github.com/$${user}/$${project}"
repository = "https://github.com/$${user}/$${project}"
documentation = "https://$${project}.readthedocs.io"
# TODO: Add topics here
# Note: Poetry adds the license to the classifiers automatically
# Development Status, license, and Python versions are kept consistent
# by `tyrannosaurus sync`, if you choose to use that.
# The language, intended audience, OS, environment, and topics are not.
classifiers = [
    "Development Status :: $${status.pypi}",
    "Natural Language :: English",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
	"Intended Audience :: Developers",
    "Operating System :: OS Independent",
    "Environment :: Console",
    "Topic :: Software Development :: Libraries :: Python Modules"
]
# These get packaged into the wheels
# There are uncommon needs to read the readme, license, and/or changelog
# in your code. For example, to read and display a "what's new" section
# if you detect that the user is running a newer version than they were using before.
# If you don't need this, you can remove these entries.
# (You might also be able to package this pyproject.toml file and read metadata from it.)
#include = [
#    "README.md",
#    "LICENSE.txt",
#    "CHANGELOG.md"
#]

[tool.poetry.urls]
# 'CI', 'Issues', and 'Download' seem to have special meanings
# These all get icons on PyPi
CI = "https://github.com/$${user}/$${project}/actions"
Issues = "https://github.com/$${user}/$${project}/issues"
Download = "https://pypi.org/project/$${pkg}/"


#########################################################################################
# Poetry build & dependencies
#########################################################################################

# TODO: You will want to modify this section.

[tool.poetry.scripts]
# TODO Is your code a script?
# Set the name of the Python module followed by a colon, followed by the name of the function
$${project} = "$${pkg}.cli:cli"

[tool.poetry.dependencies]
# TODO Add and remove dependencies here
# These are dependencies that are included in the main package
python                   = "^3.8"
typer                    = "^0.3"

[tool.poetry.dev-dependencies]
# TODO Remove build dependencies you don't want (like xdoctest, perhaps)
# These are dependencies that Poetry uses only when testing
# They all are included as dependencies in tox.ini
# Where `dev` is from `[tool.poetry.extras]` below

# All of the dependencies in this "paragraph" are needed by the default `tox.ini`
# and GitHub workflows (under `.github/workflows`) that Tyrannosaurus generated.
# If you remove them, builds will always fail unless you also modify the build pipeline.
# Note: We don't use flake8-bandit because it appears to be unmaintained
bandit                   = "^1.7"
black                    = "==21.7b0"
coverage                 = {extras = ["toml"], version = "^5.5"}
flake8                   = "^3.9"
flake8-bugbear           = ">=21"
flake8-docstrings        = "^1.5"
pre-commit               = "^2.13"
pre-commit-hooks         = "^4.0"
pytest                   = "^6.2"
pytest-cov               = "^2.11"
sphinx                   = "^4.0"
sphinx-autoapi           = "^1.5"
sphinx-copybutton        = "^0.4"
sphinx-rtd-theme         = "^0.5"
tomlkit                  = "^0.7"

# These are used directly in the default build pipeline
# ... but they're generally optional, and the build won't fail if you remove them
# For example, `mypy` is called in `tox.ini`, but if it's removed then the line
# will fail without causing the build to fail.
mypy                     = "^0.910"

# These are useful but are not used directly in the default build pipeline
# that Tyrannosaurus set up for your project
hypothesis               = "^6"
tyrannosaurus            = ">=$${tyranno.version}, <1.0"
xdoctest                 = ">=0.15, <1.0"

[tool.poetry.extras]
# These are referenced in the tox.ini with `extras = dev`
# These are auto-filled from dev-deps when you run tyrannosaurus sync
# List additional extras sets like this:
# optimization = ["numpy", "scikit-learn"]
# You MUST also list any extras that you want for testing here
# These will be installed by tox to be used for testing
# (The dev dependencies will be installed already however)
# Of course, you can remove the ` --extras "all"` line from tox.ini
# to avoid this
all = []


#########################################################################################
# Tyrannosaurus
#########################################################################################

# == NOTE ==
# These ONLY configure the behavior of `tyrannosaurus sync` (and tyrannosaurus build).
# These commands are not run inside the build pipeline; they're only run if you run them
# specifically. You would only modify them to change this behavior.
# You can safely remove this whole section if you don't want to use these commands at all.


[tool.tyrannosaurus.options]
# This tells Tyrannosaurus to sort lines for things like dependencies
# For example, it will sort dependencies in `[tool.poetry.dependencies]` alphabetically
sort     = false
# This tells Tyrannosaurus to align the columns in TOML files surrounding = signs
# For example, see how `[tool.tyrannosaurus.targets]` is sorted in this file
align    = true

[tool.tyrannosaurus.sources]
# These tell Tyrannosaurus where to get information to copy
# If a value is not listed here, it won't be copied
# Everything is either:
# 1. A literal value, surrounded with single quotes (e.g. 'py38')
# 2. A literal list, comma-separated (e.g. '[py38,py39]')
# 3. A reference to a pyproject setting (e.g. tool.poetry.version)
# 4. A value or list containing a special variable (e.g. 'Project J, copyright $${today.year}')

# --- VERSIONS ---
# These control different aspects of Python versions
# pycompatversions says what Python versions are compatible
# tool.poetry.dependencies is almost definitely the best source for this
# pytoxversions dictates what's actually used to test
# tool.poetry.dependencies will choose all of the compatible major versions
# You can alternatively specify exact versions, like '[3.8]' or '[3.8.5,3.9.1]'
# (Don't forget the single quote marks in that example.)
# pymetaversion is only used when building; e.g. in readthedocs, Docker, and GitHub workflows
# (Note that this last one is not a list -- use single quotes but not brackets.)
pycompatversions   = "tool.poetry.dependencies"
pytoxversions      = "tool.poetry.dependencies"
pymetaversion      = "'3.9'"

# --- DEVELOPMENT PARAMS ---
# virtual machine info used in Dockerfile and GitHub workflows
metavm             = "'ubuntu-latest'"
# Development dependencies
devdeps            = "tool.poetry.dev-dependencies"
# Pick the latest versions compatible with the version ranges:
#precommitvr        = "tool.poetry.dev-dependencies"
#precommitconfigvr  = "tool.poetry.dev-dependencies"

# --- PROJECT INFO ---
# These are used in dunders like __copyright__, docs/conf.py, and PyPi classifiers (like Development Status)
# $${today} is the date you run it at, and $${now} is the datetime
status             = "'Development'"
date               = "'$${today}'"
copyright          = "'Copyright $${today.year}'"
version            = "tool.poetry.version"
release            = "tool.poetry.version"
long_description   = "tool.poetry.description"
# These describe the license for your documentation text
# By default no license is mentioned;
# uncomment these to display the license in the docs
#doc_license        = "'CC BY 4.0'"
#doc_license_url    = "'https://creativecommons.org/licenses/by/4.0'"
# or you can add this (and skip the license URL):
#doc_license        = "'all rights reserved'"

# --- AUTHOR INFO ---
# TODO Fill in authors, contributors, and maintainers
# Use this syntax: "Person Name <id:value,[id:value, [...]]>"
# Specifying github usernames is recommended
# ORCID IDs can also be referenced
#authors = [
#    "<<Author Name>> <github:<<username>>,orcid:<<id>>>"
#]
authors = [ ]
contributors = [ ]
# Turn this into a literal list if it is different than the authors
maintainers = "tool.tyrannosaurus.sources.authors"

# --- CODING STYLE ---
linelength         = "tool.black.line-length"
importorderstyle   = "'google'"
docstringstyle     = "'google'"


# --- CODING STYLE IN PEP8 ---
[tool.tyrannosaurus.sources.flake8skip]
# These affect flake8 commands as directed in tox.ini
# 'all' is copied to tox.ini [flake8.ignore]; these are always ignored
# Any other keys refer to the directory that flake8 is called on
# Ex, `$${pkg} = "'D100'"` adds D100 in `poetry run flake8 $${pkg} --ignore=D100`
# (Note 1: flake8's --ignore overrides the [flake8.ignore], so Tyrannosaurus appends the "all" values.)
# (Note 2: Keys referring to directory names that tox.ini doesn't call flake8 on are ignored.)
# (Note 3: [tool.pycodestyle] and [tool.pydocstyle] don't need these values because flake8 handles it.)
# You probably want some choices in 'all'
# Then add some more to 'test' if you're less concerned with your test file conventions
# 212 and 213 contradict; 203 and 204 contradict; D302 is not relevant in Py3;
# D107 isn't needed sometimes; and the rest just seem too picky
all    = "'W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"
#$${pkg}  = ""
#doc  = ""
test = "'D100,D101,D102,D103,D104,S101,W503,E203,E225,E301,E302,E501,D107,D200,D205,D400,D403,D409,D410,D411,D212,W391,W293'"


[tool.tyrannosuarus.paths]
# These specify where to put certain files
# If they're left blank, the defaults will be used
# The syntax is the same as for tool.tyrannosaurus.sources
#recipe             = "'recipes/$${project}/meta.yaml'"
#environment        = "'environment.yml'"

[tool.tyrannosaurus.targets]
# This section tells Tyrannosaurus what to sync to.
# These are file and directory names, without filename extensions.
# Removing a line is the same as setting it to false
# They will only be synced if they exist; never created
# To get a recipe and anaconda env, run 'tyrannosaurus recipe' and 'tyrannosaurus env'
# Choices are only true or false
pyproject    = true
init         = true
tox          = true
precommit    = true
docs         = true
recipes      = true
license      = true
authors      = true
github       = true
travis       = true
dockerfile   = true
readme       = true
changelog    = true
citation     = true
codemeta     = true
environment  = false


#########################################################################################
# Testing
#########################################################################################

# This will be used in a future version of pytest:
#[tool.pytest]

[tool.pytest.ini_options]
# Really useful -- output logg statements
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(name)s: %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"


#########################################################################################
# Commits & changelog generation
#########################################################################################

# Commitizen (https://github.com/commitizen-tools/commitizen/)
# is a great tool to generate changelogs from commit messages
# It doesn't directly map to keep-a-changelog change types (e.g. Added)
[tool.commitizen]
name = "cz_conventional_commits"
# I recommend NOT including version and tag_format
# See the docs ("guide" section) how to integrate `cz bump`

# not used by default, but you could run it
# in tox.ini or .github/workflows/publish.yml (with a commit)
[tool.towncrier]
# Alternatively, you could replace CHANGELOG.md
# In my experience, commit logs make mediocre changelogs
filename = "NEWS.md"

#########################################################################################
# Style checking
#########################################################################################

# You probably don't need to modify any of this.
# A few you might want to change are:
# [tool.black.line-length] and [tool.isort.line_length]
# (Note that isort is not used by default, and that tyrannosaurus sync will handle them.)
# [mypy.check_untyped_defs] (this is fairly aggressive)
# [tool.towncrier] (if you want to set up towncrier)

[tool.coverage.paths]
source = ["$${pkg}"]

[tool.coverage.run]
source = ["$${pkg}"]

[tool.coverage.report]
show_missing = true

[tool.black]
line-length = 100
# As of December 2020, black doesn't accept py39
target-version = ["py38"]

[tool.isort]
line_length = 100

[mypy]
check_untyped_defs = true
strict_optional = true


# ------- THE FOLLOWING ARE NOT USED BY THEIR RESPECTIVE TOOLS  --------
# --- There are open discussions about supporting pyproject for each ---
# https://github.com/python/mypy/issues/5205
# https://github.com/PyCQA/bandit/issues/606
# https://github.com/PyCQA/pycodestyle/issues/813
# https://github.com/PyCQA/pydocstyle/issues/447

[tool.bandit]

[tool.pycodestyle]
max-line-length = 100
statistics = true

[tool.pydocstyle]
