resticbackups3 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- resticbackups3-0.1.0/.gitignore +228 -0
- resticbackups3-0.1.0/CHANGELOG.md +7 -0
- resticbackups3-0.1.0/LICENSE +21 -0
- resticbackups3-0.1.0/PKG-INFO +87 -0
- resticbackups3-0.1.0/README.md +66 -0
- resticbackups3-0.1.0/pyproject.toml +74 -0
- resticbackups3-0.1.0/src/resticbackups3/__init__.py +10 -0
- resticbackups3-0.1.0/src/resticbackups3/__main__.py +5 -0
- resticbackups3-0.1.0/src/resticbackups3/cli.py +224 -0
- resticbackups3-0.1.0/src/resticbackups3/config.py +550 -0
- resticbackups3-0.1.0/src/resticbackups3/creds.py +265 -0
- resticbackups3-0.1.0/src/resticbackups3/errors.py +7 -0
- resticbackups3-0.1.0/src/resticbackups3/paths.py +108 -0
- resticbackups3-0.1.0/src/resticbackups3/profile.py +111 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/__init__.py +0 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/conftest.py +73 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/test_cli.py +361 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/test_config.py +260 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/test_creds.py +228 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/test_profile.py +115 -0
- resticbackups3-0.1.0/src/resticbackups3/tests/test_utils.py +45 -0
- resticbackups3-0.1.0/src/resticbackups3/ui.py +69 -0
- resticbackups3-0.1.0/src/resticbackups3/utils.py +27 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs/Zensical documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
201
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
203
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# Private notes, validation logs and the deny list
|
|
223
|
+
notes/
|
|
224
|
+
# Machine-specific instructions
|
|
225
|
+
*.local.md
|
|
226
|
+
|
|
227
|
+
# Local planning docs, never committed
|
|
228
|
+
plan/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sripal K Jain
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: resticbackups3
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: restic + S3-compatible storage (Cloudflare R2 first): init once, then back up from cron
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Classifier: Environment :: Console
|
|
8
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Topic :: System :: Archiving :: Backup
|
|
14
|
+
Requires-Python: >=3.12
|
|
15
|
+
Requires-Dist: rich>=15
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pytest-xdist>=3.8; extra == 'dev'
|
|
18
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
19
|
+
Requires-Dist: tzdata; extra == 'dev'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# resticbackups3 (`rbs3`)
|
|
23
|
+
|
|
24
|
+
A command-line tool that turns [restic](https://restic.net/) and S3-compatible storage
|
|
25
|
+
(Cloudflare R2 first) into "init once, then back up from cron":
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
rbs3 init <profile>
|
|
29
|
+
rbs3 backup <profile> --mail
|
|
30
|
+
rbs3 cronjob <profile> "0 4 * * *" --mail --silent
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Status: early development.** `rbs3 init` saves a profile; backups come next.
|
|
34
|
+
|
|
35
|
+
## Create a profile
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
rbs3 init <profile> --env-file creds.env --config settings.toml
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Credentials can come from an env file (`--env-file`), this shell's environment (`--env-var`),
|
|
42
|
+
flags (`--restic-password=…`) or prompts. They combine, with flags first, then the env file,
|
|
43
|
+
then the environment, and anything still missing is asked for. Prefer the env file or the prompts:
|
|
44
|
+
secrets given as flags end up in shell history.
|
|
45
|
+
|
|
46
|
+
| Key | Required |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `RESTIC_REPOSITORY` | yes, `s3:https://<account>.r2.cloudflarestorage.com/<bucket>[/<prefix>]` |
|
|
49
|
+
| `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `RESTIC_PASSWORD` | yes |
|
|
50
|
+
| `AWS_DEFAULT_REGION` | no, default `auto` |
|
|
51
|
+
| `SMTP_SERVER` | no; empty means no email reports |
|
|
52
|
+
| `SMTP_PORT`, `SMTP_SECURITY` (`starttls`/`ssl`) | defaults 587 / starttls |
|
|
53
|
+
| `SMTP_USER`, `SMTP_PASSWORD`, `MAIL_TO` | when `SMTP_SERVER` is set |
|
|
54
|
+
| `MAIL_FROM` | no, default `SMTP_USER` |
|
|
55
|
+
|
|
56
|
+
Without `--config`, the settings are asked for one by one. The profile is saved as
|
|
57
|
+
`/etc/resticbackups3/<profile>/.env` (root only, 0600) and `config.toml` (0644). After that you
|
|
58
|
+
may delete your own copies, but keep `RESTIC_PASSWORD` in a password manager: without it no
|
|
59
|
+
backup can be restored.
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
Needs Linux, Python 3.12 or newer, and restic 0.16 or newer.
|
|
64
|
+
|
|
65
|
+
| Tool | Install | Update |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| pipx | `pipx install resticbackups3` | `pipx upgrade resticbackups3` |
|
|
68
|
+
| uv | `uv tool install resticbackups3` | `uv tool upgrade resticbackups3` |
|
|
69
|
+
| pip (in a venv) | `pip install resticbackups3` | `pip install --upgrade resticbackups3` |
|
|
70
|
+
|
|
71
|
+
Run `rbs3` as your normal user; it asks for sudo itself when it needs it.
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
python -m venv .venv && . .venv/bin/activate
|
|
77
|
+
pip install -e ".[dev]" ruff mypy
|
|
78
|
+
git config core.hooksPath .githooks # blocks commits containing strings from notes/deny-list.txt
|
|
79
|
+
ruff check . && ruff format --check . && mypy && pytest -n auto
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Pull request titles follow [Conventional Commits](https://www.conventionalcommits.org/); a merged
|
|
83
|
+
`feat:` or `fix:` publishes a release.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# resticbackups3 (`rbs3`)
|
|
2
|
+
|
|
3
|
+
A command-line tool that turns [restic](https://restic.net/) and S3-compatible storage
|
|
4
|
+
(Cloudflare R2 first) into "init once, then back up from cron":
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
rbs3 init <profile>
|
|
8
|
+
rbs3 backup <profile> --mail
|
|
9
|
+
rbs3 cronjob <profile> "0 4 * * *" --mail --silent
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Status: early development.** `rbs3 init` saves a profile; backups come next.
|
|
13
|
+
|
|
14
|
+
## Create a profile
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
rbs3 init <profile> --env-file creds.env --config settings.toml
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Credentials can come from an env file (`--env-file`), this shell's environment (`--env-var`),
|
|
21
|
+
flags (`--restic-password=…`) or prompts. They combine, with flags first, then the env file,
|
|
22
|
+
then the environment, and anything still missing is asked for. Prefer the env file or the prompts:
|
|
23
|
+
secrets given as flags end up in shell history.
|
|
24
|
+
|
|
25
|
+
| Key | Required |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `RESTIC_REPOSITORY` | yes, `s3:https://<account>.r2.cloudflarestorage.com/<bucket>[/<prefix>]` |
|
|
28
|
+
| `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `RESTIC_PASSWORD` | yes |
|
|
29
|
+
| `AWS_DEFAULT_REGION` | no, default `auto` |
|
|
30
|
+
| `SMTP_SERVER` | no; empty means no email reports |
|
|
31
|
+
| `SMTP_PORT`, `SMTP_SECURITY` (`starttls`/`ssl`) | defaults 587 / starttls |
|
|
32
|
+
| `SMTP_USER`, `SMTP_PASSWORD`, `MAIL_TO` | when `SMTP_SERVER` is set |
|
|
33
|
+
| `MAIL_FROM` | no, default `SMTP_USER` |
|
|
34
|
+
|
|
35
|
+
Without `--config`, the settings are asked for one by one. The profile is saved as
|
|
36
|
+
`/etc/resticbackups3/<profile>/.env` (root only, 0600) and `config.toml` (0644). After that you
|
|
37
|
+
may delete your own copies, but keep `RESTIC_PASSWORD` in a password manager: without it no
|
|
38
|
+
backup can be restored.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
Needs Linux, Python 3.12 or newer, and restic 0.16 or newer.
|
|
43
|
+
|
|
44
|
+
| Tool | Install | Update |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| pipx | `pipx install resticbackups3` | `pipx upgrade resticbackups3` |
|
|
47
|
+
| uv | `uv tool install resticbackups3` | `uv tool upgrade resticbackups3` |
|
|
48
|
+
| pip (in a venv) | `pip install resticbackups3` | `pip install --upgrade resticbackups3` |
|
|
49
|
+
|
|
50
|
+
Run `rbs3` as your normal user; it asks for sudo itself when it needs it.
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
python -m venv .venv && . .venv/bin/activate
|
|
56
|
+
pip install -e ".[dev]" ruff mypy
|
|
57
|
+
git config core.hooksPath .githooks # blocks commits containing strings from notes/deny-list.txt
|
|
58
|
+
ruff check . && ruff format --check . && mypy && pytest -n auto
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Pull request titles follow [Conventional Commits](https://www.conventionalcommits.org/); a merged
|
|
62
|
+
`feat:` or `fix:` publishes a release.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "resticbackups3"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "restic + S3-compatible storage (Cloudflare R2 first): init once, then back up from cron"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.12"
|
|
13
|
+
dependencies = [
|
|
14
|
+
"rich>=15", # prompts, tables, progress, check lists; plain output without a TTY
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Operating System :: POSIX :: Linux",
|
|
22
|
+
"Environment :: Console",
|
|
23
|
+
"Topic :: System :: Archiving :: Backup",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
dev = [
|
|
28
|
+
"pytest>=8",
|
|
29
|
+
"pytest-xdist>=3.8",
|
|
30
|
+
"tzdata", # timezone tests where the system has no tz database (Termux)
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
resticbackups3 = "resticbackups3.cli:main"
|
|
35
|
+
rbs3 = "resticbackups3.cli:main"
|
|
36
|
+
|
|
37
|
+
[tool.hatch.build.targets.sdist]
|
|
38
|
+
include = ["src/resticbackups3", "README.md", "LICENSE", "CHANGELOG.md"]
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/resticbackups3"]
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
testpaths = ["src/resticbackups3/tests"]
|
|
45
|
+
addopts = "-p no:cacheprovider"
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
target-version = "py312"
|
|
49
|
+
line-length = 100
|
|
50
|
+
src = ["src"]
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint]
|
|
53
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
54
|
+
|
|
55
|
+
[tool.mypy]
|
|
56
|
+
python_version = "3.12"
|
|
57
|
+
strict = true
|
|
58
|
+
files = ["src/resticbackups3"]
|
|
59
|
+
exclude = ["src/resticbackups3/tests/"]
|
|
60
|
+
|
|
61
|
+
[tool.semantic_release]
|
|
62
|
+
commit_parser = "conventional"
|
|
63
|
+
tag_format = "v{version}"
|
|
64
|
+
version_toml = ["pyproject.toml:project.version"]
|
|
65
|
+
allow_zero_version = true
|
|
66
|
+
major_on_zero = false
|
|
67
|
+
build_command = "python -m pip install build && python -m build"
|
|
68
|
+
|
|
69
|
+
[tool.semantic_release.branches.main]
|
|
70
|
+
match = "main"
|
|
71
|
+
prerelease = false
|
|
72
|
+
|
|
73
|
+
[tool.semantic_release.changelog.default_templates]
|
|
74
|
+
changelog_file = "CHANGELOG.md"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""restic + S3-compatible storage: init once, then back up from cron."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
__version__ = version("resticbackups3")
|
|
9
|
+
except PackageNotFoundError: # running from a source tree without an install
|
|
10
|
+
__version__ = "0.0.0+unknown"
|