| 1 |
[build-system] |
| 2 |
requires = [ "hatchling (>=1.27.0,<2.0.0)" ] |
| 3 |
build-backend = "hatchling.build" |
| 4 |
|
| 5 |
[tool.hatch.build.targets.wheel] |
| 6 |
packages = [ "src/CedarBackup3" ] |
| 7 |
|
| 8 |
[tool.hatch.build.targets.sdist] |
| 9 |
only-include = [ "Changelog", "README.md", "docs", "manpages", "samples", "src", "tests" ] |
| 10 |
exclude = [ "docs/_build" ] |
| 11 |
|
| 12 |
[project] |
| 13 |
name = "cedar-backup3" |
| 14 |
requires-python = ">=3.12,<4" |
| 15 |
description = "Implements local and remote backups to CD/DVD and Amazon S3" |
| 16 |
keywords = [ 'local', 'remote', 'backup', 'scp' ] |
| 17 |
authors = [ { name="Kenneth J. Pronovici", email="[email protected]" } ] |
| 18 |
license = "GPL-2.0-only" |
| 19 |
license-files = [ "LICENSE", "NOTICE" ] |
| 20 |
readme = "PyPI.md" |
| 21 |
version = "3.12.1" |
| 22 |
classifiers = [ |
| 23 |
"Programming Language :: Python :: 3", |
| 24 |
"Programming Language :: Python :: 3.12", |
| 25 |
"Programming Language :: Python :: 3.13", |
| 26 |
"Programming Language :: Python :: 3.14", |
| 27 |
"Programming Language :: Python :: 3.15", |
| 28 |
"Development Status :: 5 - Production/Stable", |
| 29 |
"Operating System :: OS Independent", |
| 30 |
"Environment :: Console", |
| 31 |
"Intended Audience :: System Administrators", |
| 32 |
"Natural Language :: English", |
| 33 |
"Topic :: Software Development :: Libraries", |
| 34 |
"Topic :: System :: Archiving :: Backup", |
| 35 |
"Topic :: Utilities", |
| 36 |
] |
| 37 |
dependencies = [ |
| 38 |
"chardet (>=5.2.0,<6.0.0)", # Debian trixie has 5.2.0 |
| 39 |
] |
| 40 |
|
| 41 |
[project.urls] |
| 42 |
Homepage = "https://pypi.org/project/cedar-backup3/" |
| 43 |
Repository = "https://github.com/pronovic/cedar-backup3" |
| 44 |
Changelog = "https://github.com/pronovic/cedar-backup3/releases" |
| 45 |
Documentation = "https://cedar-backup3.readthedocs.io/en/stable/" |
| 46 |
Issues = "https://github.com/pronovic/cedar-backup3/issues" |
| 47 |
|
| 48 |
[project.optional-dependencies] |
| 49 |
docs = [ |
| 50 |
"sphinx (>=8.1.3,<9.0.0)", # Debian trixie has 8.1.3 |
| 51 |
"sphinx-autoapi (>=3.3.3,<4.0.0)", # Debian trixie has 3.3.3 |
| 52 |
] |
| 53 |
|
| 54 |
[dependency-groups] |
| 55 |
dev = [ |
| 56 |
"ruff (>=0.16.9,<1.0.0)", |
| 57 |
"coverage (>=7.16.1,<8.0.0)", |
| 58 |
"prek (>=0.5.3,<1.0.0)", |
| 59 |
"colorama (>=0.4.6,<1.0.0)", |
| 60 |
] |
| 61 |
|
| 62 |
[project.scripts] |
| 63 |
cback3 = 'CedarBackup3.scripts:cback3' |
| 64 |
cback3-amazons3-sync = 'CedarBackup3.scripts:amazons3' |
| 65 |
cback3-span = 'CedarBackup3.scripts:span' |
| 66 |
|
| 67 |
[tool.hatch.version] |
| 68 |
source = "uv-dynamic-versioning" |
| 69 |
|
| 70 |
[tool.uv] |
| 71 |
required-version = ">=0.8.18,<1.0.0" |
| 72 |
cache-keys = [{ file = "pyproject.toml" }, { git = { commit = true, tags = true }}] |
| 73 |
|
| 74 |
# Published version is managed using Git tags |
| 75 |
# We get either the tag (like "0.24.1") or a snapshot-type version (like "0.24.1+3.e8319c4") |
| 76 |
[tool.uv-dynamic-versioning] |
| 77 |
fallback-version = "0.0.0" |
| 78 |
pattern = '^[vV](?P<base>\d+\.\d+\.\d+)' # this extracts the version from our vX.Y.Z tag format |
| 79 |
format-jinja = "{% if distance == 0 and not dirty %}{{ base }}{% else %}{{ base }}+{{ distance }}.{{ commit }}{% endif %}" |
| 80 |
|
| 81 |
[tool.coverage.paths] |
| 82 |
source = [ "src" ] |
| 83 |
|
| 84 |
[tool.coverage.run] |
| 85 |
branch = true |
| 86 |
source = [ "src/CedarBackup3" ] |
| 87 |
|
| 88 |
[tool.coverage.report] |
| 89 |
show_missing = false |
| 90 |
precision = 1 |
| 91 |
|
| 92 |
[tool.ruff] |
| 93 |
src = ["src"] |
| 94 |
extend-exclude = [ "docs", "notes" ] |
| 95 |
line-length = 132 |
| 96 |
preview = true |
| 97 |
|
| 98 |
[tool.ruff.format] |
| 99 |
quote-style = "double" |
| 100 |
line-ending = "lf" |
| 101 |
docstring-code-format = false |
| 102 |
|
| 103 |
[tool.ruff.lint.flake8-tidy-imports] |
| 104 |
ban-relative-imports = "all" |
| 105 |
|
| 106 |
# Note: requires TID251 to be selected below |
| 107 |
[tool.ruff.lint.flake8-tidy-imports.banned-api] |
| 108 |
"pytest".msg = "use unittest, not pytest" |
| 109 |
|
| 110 |
[tool.ruff.lint] |
| 111 |
select = [ |
| 112 |
# Start with all Ruff linter rules, and exclude some specific rules and categories (see below) |
| 113 |
"ALL" |
| 114 |
] |
| 115 |
|
| 116 |
ignore = [ |
| 117 |
# Ruff-recommended exclusions, not needed because we're using the Ruff formatter |
| 118 |
"COM812", # missing-trailing-comma |
| 119 |
"COM819", # prohibited-trailing-comma |
| 120 |
"D206", # docstring-tab-indentation |
| 121 |
"D300", # triple-single-quotes |
| 122 |
"E111", # indentation-with-invalid-multiple |
| 123 |
"E114", # indentation-with-invalid-multiple-comment |
| 124 |
"E117", # over-indented |
| 125 |
"E501", # line-too-long |
| 126 |
"Q000", # bad-quotes-inline-string |
| 127 |
"Q001", # bad-quotes-multiline-string |
| 128 |
"Q002", # bad-quotes-docstring |
| 129 |
"Q003", # avoidable-escaped-quote |
| 130 |
"W191", # tab-indentation |
| 131 |
|
| 132 |
# Exclusions of entire rule categories, standardized across all of my repos |
| 133 |
"C90", # mccabe cyclomatic complexity |
| 134 |
"CPY", # flake8-copyright |
| 135 |
"D", # pydocstyle |
| 136 |
"DJ", # flake8-django |
| 137 |
"DOC", # pydoclint |
| 138 |
"EXE", # flake8-executable |
| 139 |
"FIX", # flake8-fixme |
| 140 |
"TD", # flake8-todo |
| 141 |
|
| 142 |
# Exclusions of specific rules, standardized across all of my repos |
| 143 |
"ANN401", # allow dynamically typed expressions using `typing.Any` |
| 144 |
"EM101", # allow raw string messages in exceptions; having to pull out a variable makes code harder to read |
| 145 |
"EM102", # allow f-string messages in exceptions; having to pull out a variable makes code harder to read |
| 146 |
"FURB140", # don't automatically convert generator expressions to use `itertools.starmap()` |
| 147 |
"PGH004", # allow `# noqa` with no error code; sometimes this is needed to prevent unwanted magical auto-fixes |
| 148 |
"PLR2004", # allow magic numbers; using a constant doesn't necessarily make a magic number any more legible |
| 149 |
"PT011", # allow `pytest.raises` for any exception type; this is often a false-positive that has little benefit |
| 150 |
"PT018", # allow `assert` with multiple conditions; ruff suggestions often make the code less legible |
| 151 |
"PT019", # allow unused PyTest fixtures; this check has a lot of false positives for `@unittest.mock.patch()` |
| 152 |
"S101", # allow use of `assert`; we sometimes use assert as a type hint for MyPy, and do not run with -O |
| 153 |
"S404", # allow use of `subprocess`; it's a common way to run shell commands, and this check is overly paranoid |
| 154 |
"SIM102", # allow nested `if` clauses; ruff suggestions often make the code less legible |
| 155 |
"SIM117", # allow nested `with` clauses; ruff suggestions often make the code less legible |
| 156 |
"TRY003", # allow long messages in exceptions; this is often a false-positive that has little benefit |
| 157 |
|
| 158 |
# Exclusions of rule categories and specific rules, customized for this repository |
| 159 |
# Cedar Backup was first developed starting in 2002, long before many of these standards existed |
| 160 |
"ANN", # don't require type annotations |
| 161 |
"B904", # don't warn about raising from parent exception |
| 162 |
"BLE001", # don't warn about catching blind exceptions |
| 163 |
"DTZ", # ignore old-style datetime usage, such as of "naive" datetime objects |
| 164 |
"E722", # don't warn about using bare except |
| 165 |
"ERA", # eradicate does not understand the source tree's commenting style |
| 166 |
"FBT", # allow positional boolean flags |
| 167 |
"FURB101", # allow old-style open() and read() operations |
| 168 |
"FURB103", # allow old-style open() and write() operations |
| 169 |
"FURB113", # don't suggest use of list.extend() rather than repeated list.append() |
| 170 |
"FURB189", # don't suggest subclassing collections.UserList instead of list |
| 171 |
"N", # allow non-standard variable, function, & argument names, etc. |
| 172 |
"PERF", # performance micro-optimizations are not worth much in this code |
| 173 |
"PLR0911", # don't enforce rules about too many return statments |
| 174 |
"PLR0912", # don't enforce rules about too many branches |
| 175 |
"PLR0913", # don't enforce rules about too many arguments |
| 176 |
"PLR0914", # don't enforce rules about too many variables |
| 177 |
"PLR0915", # don't enforce rules about too many statements |
| 178 |
"PLR0916", # don't enforce rules about too many boolean expressions |
| 179 |
"PLR0917", # don't enforce rules about too many arguments |
| 180 |
"PLR1702", # don't enforce rules about too many nested blocks |
| 181 |
"PLR5501", # don't warn about elif instead of else/if |
| 182 |
"PLR6201", # don't suggest using a set vs. a list when testing for membership |
| 183 |
"PLR6301", # don't make recommendations about static methods |
| 184 |
"PLW0717", # don't warn about try blocks with too many statements |
| 185 |
"PLW1514", # ignore open() without encoding; existing cross-platform behavior works but is fragile |
| 186 |
"PLW1641", # ignore __eq__ without __hash__; these objects work ok as-is and changing them is risky |
| 187 |
"PLW3201", # ignore leftover __cmp__ methods from the original Python 2 implementation |
| 188 |
"PT", # this codebase uses Unittest, so don't apply Pytest standards |
| 189 |
"PTH", # allow old-style os operations rather than pathlib.Path |
| 190 |
"RUF201", # don't rewrite rule codes in pyproject.toml; codes are more legible when config mixes codes and categories |
| 191 |
"RET505", # allow unnecessary else after return statement |
| 192 |
"RET506", # allow unnecessary else after raise statement |
| 193 |
"RUF022", # don't apply sorting standards for __all__ |
| 194 |
"RUF055", # ignore uses of the re module that can be replaced with builtin str methods |
| 195 |
"S110", # don't warn about logging for try/except/pass blocks |
| 196 |
"SIM105", # don't suggest use of contextlib.suppress(BaseException) |
| 197 |
"SIM108", # don't suggest ternary operator instead of if/else block |
| 198 |
"SIM115", # don't warn about using a context manager, since the code isn't designed for it |
| 199 |
"TRY", # ignore all tryceratops warnings about exception anti-patterns |
| 200 |
"UP031", # allow old-style format specifiers instead of f-strings |
| 201 |
] |
| 202 |
|
| 203 |
[tool.ruff.lint.per-file-ignores] |
| 204 |
"tests/*" = [ |
| 205 |
# Exclusions that apply to unit tests only, standardized across all of my repos |
| 206 |
"ANN", # don't require type annotations in tests |
| 207 |
"FBT", # allow use of boolean positional arguments |
| 208 |
"PLC1901", # allow comparison to empty string |
| 209 |
"PLC2701", # allow imports of private names |
| 210 |
"PLR", # don't warn about too many arguments, methods, etc. |
| 211 |
"SLF001", # allow access to private members |
| 212 |
|
| 213 |
# Exclusions of rule categories and specific rules, customized for this repository |
| 214 |
"PLC0415", # allow import statements that are not at the top of the file |
| 215 |
"PLC2801", # allow direct use of dunder methods like __str__ |
| 216 |
"S108", # don't warn about insecure temporary files |
| 217 |
"SIM201", # don't suggest x != y instead of not x == y |
| 218 |
"SIM202", # don't suggest x == y instead of not x != y |
| 219 |
] |
| 220 |
"src/CedarBackup3/tools/**/*" = [ |
| 221 |
# Exclusions that apply to Cedar Backup tools only |
| 222 |
"T201", # allow the print statement |
| 223 |
] |