Skip to content

Instantly share code, notes, and snippets.

@legendof-selda
Last active July 3, 2024 07:14
Show Gist options
  • Save legendof-selda/935139448dd6efd9ac0c93984acb0260 to your computer and use it in GitHub Desktop.
Save legendof-selda/935139448dd6efd9ac0c93984acb0260 to your computer and use it in GitHub Desktop.
Default pyproject.toml file
# Replace 'src' with the right package name.
# Change project.name
# Ensure author name and email matches.
# Change project.urls.Home
# Update python version.
# update packages.
[build-system]
requires = ["poetry-core", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
[project]
name = "src"
authors = [{ name = "unknown", email = "[email protected]" }]
readme = "README.md"
dynamic = ["version", "description"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]
[project.urls]
Home = "https://github.com/unknown/unknown"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.0.1"
version_files = ["src/__init__.py", "pyproject.toml:version"]
style = [
[
"qmark",
"fg:#ff9d00 bold",
],
[
"question",
"bold",
],
[
"answer",
"fg:#ff9d00 bold",
],
[
"pointer",
"fg:#ff9d00 bold",
],
[
"highlighted",
"fg:#ff9d00 bold",
],
[
"selected",
"fg:#cc5454",
],
[
"separator",
"fg:#cc5454",
],
[
"instruction",
"",
],
[
"text",
"",
],
[
"disabled",
"fg:#858585 italic",
],
]
tag_format = "v$version"
changelog_incremental = true
changelog_start_rev = "v0.0.1"
[tool.flake8]
ignore = [
"E203", # whitespace before ':'
"E266", # Too many leading '#' for block comments
"PL123", # Use Path.open instead of open
"U101", # Unused argument that starts with underscore
"W503", # Newline before binary operator
]
max-line-length = 120
max-complexity = 18
inline-quotes = "double"
known-modules = ":[src]"
application-names = "src"
max-expression-complexity = 10
[tool.isort]
profile = "black"
[tool.poetry]
name = "src"
version = "0.0.1"
description = ""
authors = ["Unknown <[email protected]>"]
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
metadata = false
dirty = false
strict = true
style = "semver"
bump = true
latest-tag = true
format = "v{base}.{distance}-{stage}"
format-jinja = """
{%- if distance == 0 -%}
{%- if branch == "develop" -%}
{{ serialize_semver(base, pre=["beta"]) }}
{%- elif branch == "staging" -%}
{{ serialize_semver(base, pre=["alpha"]) }}
{%- elif branch == "master" -%}
{{ serialize_semver(base) }}
{%- else -%}
{{ serialize_semver(base, metadata=[branch_escaped]) }}
{%- endif -%}
{%- else -%}
{%- if branch == "develop" -%}
{{ serialize_semver(bump_version(base), pre=["beta"]) }}
{%- elif branch == "staging" -%}
{{ serialize_semver(bump_version(base), pre=["alpha"]) }}
{%- elif branch == "master" -%}
{{ serialize_semver(bump_version(base)) }}
{%- else -%}
{{ serialize_semver(bump_version(base), metadata=[branch_escaped]) }}
{%- endif -%}
{%- endif -%}
"""
[tool.poetry.dependencies]
python = ">=3.11,<3.12"
loguru = "^0.6.0"
numpy = "^1.23"
openpyxl = "^3.1.1"
pandas = "^1.3.0"
plotly = "^5.15.0"
python-dotenv = "^0.20.0"
ruamel-yaml = "^0.18.5"
tables = "^3.9.2"
tqdm = "^4.66.1"
XlsxWriter = "^3.0.3"
[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
flake8 = "^6.0.0"
flake8-absolute-import = "^1.0.0.1"
flake8-builtins = "^2.1.0"
flake8-expression-complexity = "^0.0.11"
flake8-pyproject = "^1.2.2"
flake8-quotes = "^3.3.2"
flake8-requirements = "^1.7.6"
flake8-unused-arguments = "^0.0.12"
flake8-use-fstring = "^1.4"
flake8-use-pathlib = "^0.3.0"
isort = "^5.12.0"
jedi-language-server = "^0.41.0"
pandas-stubs = "^1.4.3"
pytest = "^7.1.2"
pytest-cov = "^4.0.0"
pytest-html = "^3.1.1"
pytest-xdist = "^2.5.0"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.4.2"
mkdocs-autorefs = "^0.4.1"
mkdocs-gen-files = "^0.4.0"
mkdocs-git-authors-plugin = "^0.7.0"
mkdocs-git-revision-date-localized-plugin = "^1.1.0"
mkdocs-literate-nav = "^0.6.0"
mkdocs-material = "^9.0.15"
mkdocs-section-index = "^0.3.5"
mkdocstrings = { extras = ["python"], version = "^0.20.0" }
python-markdown-math = "^0.8"
[tool.pyright]
venvPath = "./"
venv = ".venv"
exclude = ["**/__pycache__"]
include = ["src"]
reportMissingImports = true
reportMissingTypeStubs = true
pythonVersion = "3.11"
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
[tool.pytest.ini_options]
markers = [
"e2e:E2E tests.",
"unit:Unit tests."
]
addopts = "--cov=<proj> --cov-report=xml --cov-report=html --cov-branch"
filterwarnings = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment