nextcloud-s3-backup 1.0.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.
- nextcloud_s3_backup-1.0.0/.all-contributorsrc +27 -0
- nextcloud_s3_backup-1.0.0/.editorconfig +21 -0
- nextcloud_s3_backup-1.0.0/.github/ISSUE_TEMPLATE/1-bug_report.md +14 -0
- nextcloud_s3_backup-1.0.0/.github/ISSUE_TEMPLATE/2-feature-request.md +14 -0
- nextcloud_s3_backup-1.0.0/.github/workflows/ci.yml +93 -0
- nextcloud_s3_backup-1.0.0/.gitignore +140 -0
- nextcloud_s3_backup-1.0.0/.pre-commit-config.yaml +34 -0
- nextcloud_s3_backup-1.0.0/.python-version +1 -0
- nextcloud_s3_backup-1.0.0/CHANGELOG.md +66 -0
- nextcloud_s3_backup-1.0.0/CONTRIBUTING.md +122 -0
- nextcloud_s3_backup-1.0.0/LICENSE +202 -0
- nextcloud_s3_backup-1.0.0/PKG-INFO +373 -0
- nextcloud_s3_backup-1.0.0/README.md +348 -0
- nextcloud_s3_backup-1.0.0/commitlint.config.cjs +8 -0
- nextcloud_s3_backup-1.0.0/pyproject.toml +147 -0
- nextcloud_s3_backup-1.0.0/renovate.json +3 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/__init__.py +1 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/api/__init__.py +0 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/api/backup.py +430 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/api/config.py +54 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/api/db.py +138 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/cli.py +400 -0
- nextcloud_s3_backup-1.0.0/src/nc_s3_backup/py.typed +0 -0
- nextcloud_s3_backup-1.0.0/tests/__init__.py +0 -0
- nextcloud_s3_backup-1.0.0/tests/config.yaml +18 -0
- nextcloud_s3_backup-1.0.0/tests/conftest.py +0 -0
- nextcloud_s3_backup-1.0.0/tests/test_api_db.py +27 -0
- nextcloud_s3_backup-1.0.0/tests/test_backup.py +616 -0
- nextcloud_s3_backup-1.0.0/tests/test_cli.py +76 -0
- nextcloud_s3_backup-1.0.0/tests/test_purge.py +335 -0
- nextcloud_s3_backup-1.0.0/uv.lock +542 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "nextcloud-s3-backup",
|
|
3
|
+
"projectOwner": "petrus-v",
|
|
4
|
+
"repoType": "github",
|
|
5
|
+
"repoHost": "https://github.com",
|
|
6
|
+
"files": [
|
|
7
|
+
"README.md"
|
|
8
|
+
],
|
|
9
|
+
"imageSize": 80,
|
|
10
|
+
"commit": true,
|
|
11
|
+
"commitConvention": "angular",
|
|
12
|
+
"contributors": [
|
|
13
|
+
{
|
|
14
|
+
"login": "petrus-v",
|
|
15
|
+
"name": "Pierre Verkest",
|
|
16
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/4328507?v=4",
|
|
17
|
+
"profile": "http://pierre.verkest.fr/",
|
|
18
|
+
"contributions": [
|
|
19
|
+
"code",
|
|
20
|
+
"ideas",
|
|
21
|
+
"doc"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"contributorsPerLine": 7,
|
|
26
|
+
"skipCi": true
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
charset = utf-8
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
|
|
13
|
+
[*.bat]
|
|
14
|
+
indent_style = tab
|
|
15
|
+
end_of_line = crlf
|
|
16
|
+
|
|
17
|
+
[LICENSE]
|
|
18
|
+
insert_final_newline = false
|
|
19
|
+
|
|
20
|
+
[Makefile]
|
|
21
|
+
indent_style = tab
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Describe the bug**
|
|
8
|
+
A clear and concise description of what the bug is.
|
|
9
|
+
|
|
10
|
+
**To Reproduce**
|
|
11
|
+
Steps to reproduce the behavior:
|
|
12
|
+
|
|
13
|
+
**Additional context**
|
|
14
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
labels: enhancement
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Is your feature request related to a problem? Please describe.**
|
|
8
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
9
|
+
|
|
10
|
+
**Describe the solution you'd like**
|
|
11
|
+
A clear and concise description of what you want to happen.
|
|
12
|
+
|
|
13
|
+
**Additional context**
|
|
14
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.head_ref || github.run_id }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
lint:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
- uses: astral-sh/setup-uv@v10.4.0
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.13"
|
|
26
|
+
- run: uvx pre-commit run --all-files --show-diff-on-failure
|
|
27
|
+
|
|
28
|
+
# Make sure commit messages follow the conventional commits convention:
|
|
29
|
+
# https://www.conventionalcommits.org
|
|
30
|
+
commitlint:
|
|
31
|
+
name: Lint Commit Messages
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v7
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
- uses: wagoid/commitlint-github-action@v6
|
|
38
|
+
|
|
39
|
+
test:
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
python-version:
|
|
44
|
+
- "3.13"
|
|
45
|
+
- "3.14"
|
|
46
|
+
- "3.15"
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v7
|
|
50
|
+
- name: Set up uv and Python ${{ matrix.python-version }}
|
|
51
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
enable-cache: true
|
|
55
|
+
- name: Install Dependencies
|
|
56
|
+
run: uv sync --frozen --group dev
|
|
57
|
+
- name: Test with Pytest
|
|
58
|
+
run: uv run --no-sync pytest --cov-report=xml
|
|
59
|
+
- name: Upload coverage to Codecov
|
|
60
|
+
uses: codecov/codecov-action@v7
|
|
61
|
+
with:
|
|
62
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
63
|
+
|
|
64
|
+
release:
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
environment: release
|
|
67
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
68
|
+
needs:
|
|
69
|
+
- test
|
|
70
|
+
- lint
|
|
71
|
+
- commitlint
|
|
72
|
+
permissions:
|
|
73
|
+
contents: write
|
|
74
|
+
id-token: write
|
|
75
|
+
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v7
|
|
78
|
+
|
|
79
|
+
- name: Set up uv
|
|
80
|
+
uses: astral-sh/setup-uv@v10.4.0
|
|
81
|
+
with:
|
|
82
|
+
python-version: "3.13"
|
|
83
|
+
|
|
84
|
+
- name: Build distributions
|
|
85
|
+
run: uv build
|
|
86
|
+
|
|
87
|
+
- name: Publish to PyPI (Trusted Publishing)
|
|
88
|
+
run: uv publish
|
|
89
|
+
|
|
90
|
+
- name: Create GitHub Release
|
|
91
|
+
env:
|
|
92
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
93
|
+
run: gh release create "${GITHUB_REF_NAME}" dist/* --generate-notes
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Created by .ignore support plugin (hsz.mobi)
|
|
2
|
+
### Python template
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
100
|
+
__pypackages__/
|
|
101
|
+
|
|
102
|
+
# Celery stuff
|
|
103
|
+
celerybeat-schedule
|
|
104
|
+
celerybeat.pid
|
|
105
|
+
|
|
106
|
+
# SageMath parsed files
|
|
107
|
+
*.sage.py
|
|
108
|
+
|
|
109
|
+
# Environments
|
|
110
|
+
.env
|
|
111
|
+
.venv
|
|
112
|
+
env/
|
|
113
|
+
venv/
|
|
114
|
+
ENV/
|
|
115
|
+
env.bak/
|
|
116
|
+
venv.bak/
|
|
117
|
+
|
|
118
|
+
# Spyder {{package_name}} settings
|
|
119
|
+
.spyderproject
|
|
120
|
+
.spyproject
|
|
121
|
+
|
|
122
|
+
# Rope {{package_name}} settings
|
|
123
|
+
.ropeproject
|
|
124
|
+
|
|
125
|
+
# mkdocs documentation
|
|
126
|
+
/site
|
|
127
|
+
|
|
128
|
+
# mypy
|
|
129
|
+
.mypy_cache/
|
|
130
|
+
.dmypy.json
|
|
131
|
+
dmypy.json
|
|
132
|
+
|
|
133
|
+
# Pyre type checker
|
|
134
|
+
.pyre/
|
|
135
|
+
|
|
136
|
+
# pytype static type analyzer
|
|
137
|
+
.pytype/
|
|
138
|
+
|
|
139
|
+
# Cython debug symbols
|
|
140
|
+
cython_debug/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
exclude: "CHANGELOG.md"
|
|
4
|
+
default_stages: [pre-commit]
|
|
5
|
+
|
|
6
|
+
ci:
|
|
7
|
+
autofix_commit_msg: "chore(pre-commit.ci): auto fixes"
|
|
8
|
+
autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate"
|
|
9
|
+
|
|
10
|
+
repos:
|
|
11
|
+
- repo: https://github.com/commitizen-tools/commitizen
|
|
12
|
+
rev: v4.20.1
|
|
13
|
+
hooks:
|
|
14
|
+
- id: commitizen
|
|
15
|
+
stages: [commit-msg]
|
|
16
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
17
|
+
rev: v6.0.0
|
|
18
|
+
hooks:
|
|
19
|
+
- id: check-case-conflict
|
|
20
|
+
- id: check-json
|
|
21
|
+
- id: check-toml
|
|
22
|
+
- id: check-yaml
|
|
23
|
+
- id: detect-private-key
|
|
24
|
+
- id: end-of-file-fixer
|
|
25
|
+
- id: trailing-whitespace
|
|
26
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
27
|
+
rev: v0.17.6
|
|
28
|
+
hooks:
|
|
29
|
+
- id: ruff-check
|
|
30
|
+
- id: ruff-format
|
|
31
|
+
- repo: https://github.com/codespell-project/codespell
|
|
32
|
+
rev: v2.4.3
|
|
33
|
+
hooks:
|
|
34
|
+
- id: codespell
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.0.0 (2026-11-30)
|
|
4
|
+
|
|
5
|
+
### Build
|
|
6
|
+
|
|
7
|
+
* Migrate from poetry to uv and target python 3.13+
|
|
8
|
+
* Add bump-my-version and git-cliff changelog configuration
|
|
9
|
+
|
|
10
|
+
### CI
|
|
11
|
+
|
|
12
|
+
* Update GitHub Actions and pre-commit for uv and Python 3.13-3.15
|
|
13
|
+
* Upgrade GitHub Actions and python-semantic-release to v10.7.0
|
|
14
|
+
* Release on version tags via PyPI Trusted Publishing
|
|
15
|
+
* Use proper astral gh action version
|
|
16
|
+
* Remove useless workflow used for issue/label management
|
|
17
|
+
* Fix commitlint ESM config and drop macOS test runner
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
* Document release process with bump-my-version and uv
|
|
22
|
+
* Update badges, installation instructions, and Read the Docs for uv
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* Use hashlib.file_digest for streaming SHA1 and Path.hardlink_to
|
|
27
|
+
|
|
28
|
+
### Miscellaneous
|
|
29
|
+
|
|
30
|
+
* Simplify pre-commit hooks and enable ruff UP/C4/T10/S rules
|
|
31
|
+
* Apply ruff lint/format fixes and fix README typo
|
|
32
|
+
* Remove useless config file
|
|
33
|
+
* Remove unused Sphinx docs and Read the Docs configuration
|
|
34
|
+
|
|
35
|
+
### Refactor
|
|
36
|
+
|
|
37
|
+
* Replace s3path with cloudpathlib[s3]
|
|
38
|
+
* Replace deprecated argparse.FileType with Path
|
|
39
|
+
## v0.3.0 (2024-05-21)
|
|
40
|
+
|
|
41
|
+
* document extra configuration file parameters
|
|
42
|
+
* add **allowed_ignored_errors** config parameter to define the
|
|
43
|
+
number of errors allowed to ignores while backup-ing and do not
|
|
44
|
+
interrupt on the first error.
|
|
45
|
+
* add retry mechanism while retrieving S3 ETAG file information
|
|
46
|
+
|
|
47
|
+
## v0.2.1 (2023-04-26)
|
|
48
|
+
|
|
49
|
+
* improving perf while backup file without sha1
|
|
50
|
+
|
|
51
|
+
for existing etag we ensure an hardlink sha1 with
|
|
52
|
+
the same inode is present, this search was perform
|
|
53
|
+
using `find -inum` this is done using python.
|
|
54
|
+
|
|
55
|
+
## v0.2.0 (2023-04-26)
|
|
56
|
+
|
|
57
|
+
* add **nextcloud-s3-backup-purge** command to free space under repo
|
|
58
|
+
directory `.data/`
|
|
59
|
+
|
|
60
|
+
## v0.1.0 (2023-04-05)
|
|
61
|
+
|
|
62
|
+
* Bump pre-commit hooks versions
|
|
63
|
+
* Use mean to compute stats and add median
|
|
64
|
+
* Assume we could get inconsistency data between etag and sha1 ./data
|
|
65
|
+
directory to manage wrongly synchronised directory without proper
|
|
66
|
+
hard links.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome, and they are greatly appreciated! Every little helps, and credit will always be given.
|
|
4
|
+
|
|
5
|
+
You can contribute in many ways:
|
|
6
|
+
|
|
7
|
+
## Types of Contributions
|
|
8
|
+
|
|
9
|
+
### Report Bugs
|
|
10
|
+
|
|
11
|
+
Report bugs to [our issue page][gh-issues]. If you are reporting a bug, please include:
|
|
12
|
+
|
|
13
|
+
- Your operating system name and version.
|
|
14
|
+
- Any details about your local setup that might be helpful in troubleshooting.
|
|
15
|
+
- Detailed steps to reproduce the bug.
|
|
16
|
+
|
|
17
|
+
### Fix Bugs
|
|
18
|
+
|
|
19
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
|
|
20
|
+
|
|
21
|
+
### Implement Features
|
|
22
|
+
|
|
23
|
+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
|
|
24
|
+
|
|
25
|
+
### Write Documentation
|
|
26
|
+
|
|
27
|
+
Nextcloud S3 Backup could always use more documentation, whether as part of the official Nextcloud S3 Backup docs, in docstrings, or even on the web in blog posts, articles, and such.
|
|
28
|
+
|
|
29
|
+
### Submit Feedback
|
|
30
|
+
|
|
31
|
+
The best way to send feedback [our issue page][gh-issues] on GitHub. If you are proposing a feature:
|
|
32
|
+
|
|
33
|
+
- Explain in detail how it would work.
|
|
34
|
+
- Keep the scope as narrow as possible, to make it easier to implement.
|
|
35
|
+
- Remember that this is a volunteer-driven project, and that contributions are welcome 😊
|
|
36
|
+
|
|
37
|
+
## Get Started!
|
|
38
|
+
|
|
39
|
+
Ready to contribute? Here's how to set yourself up for local development.
|
|
40
|
+
|
|
41
|
+
1. Fork the repo on GitHub.
|
|
42
|
+
|
|
43
|
+
2. Clone your fork locally:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
$ git clone git@github.com:your_name_here/nextcloud-s3-backup.git
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
3. Install the project dependencies with [uv](https://docs.astral.sh/uv/):
|
|
50
|
+
|
|
51
|
+
```shell
|
|
52
|
+
$ uv sync --group dev
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
4. Create a branch for local development:
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
$ git checkout -b name-of-your-bugfix-or-feature
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Now you can make your changes locally.
|
|
62
|
+
|
|
63
|
+
5. When you're done making changes, check that your changes pass our tests:
|
|
64
|
+
|
|
65
|
+
```shell
|
|
66
|
+
$ uv run pytest
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
6. Linting is done through [pre-commit](https://pre-commit.com). You can run all hooks as a one-off with `uvx`:
|
|
70
|
+
|
|
71
|
+
```shell
|
|
72
|
+
$ uvx pre-commit run --all-files
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or better, install the hooks once and have them run automatically each time you commit:
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
$ uvx pre-commit install --hook-type pre-commit --hook-type commit-msg
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
7. Commit your changes and push your branch to GitHub:
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
$ git add .
|
|
85
|
+
$ git commit -m "feat(something): your detailed description of your changes"
|
|
86
|
+
$ git push origin name-of-your-bugfix-or-feature
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Note: the commit message should follow [the conventional commits](https://www.conventionalcommits.org). We run [`commitlint` on CI](https://github.com/marketplace/actions/commit-linter) to validate it, and if you've installed pre-commit hooks at the previous step, the message will be checked at commit time.
|
|
90
|
+
|
|
91
|
+
8. Submit a pull request through the GitHub website or using the GitHub CLI (if you have it installed):
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
$ gh pr create --fill
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Pull Request Guidelines
|
|
98
|
+
|
|
99
|
+
We like to have the pull request open as soon as possible, that's a great place to discuss any piece of work, even unfinished. You can use draft pull request if it's still a work in progress. Here are a few guidelines to follow:
|
|
100
|
+
|
|
101
|
+
1. Include tests for feature or bug fixes.
|
|
102
|
+
2. Update the documentation for significant features.
|
|
103
|
+
3. Ensure tests are passing on CI.
|
|
104
|
+
|
|
105
|
+
## Tips
|
|
106
|
+
|
|
107
|
+
To run a subset of tests:
|
|
108
|
+
|
|
109
|
+
```shell
|
|
110
|
+
$ pytest tests
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Making a new release
|
|
114
|
+
|
|
115
|
+
Releases are created locally with `bump-my-version` (which also updates `uv.lock` and `CHANGELOG.md` via `git-cliff`) and published to PyPI via GitHub Actions (Trusted Publishing) when a `v*` tag is pushed:
|
|
116
|
+
|
|
117
|
+
```shell
|
|
118
|
+
$ uvx bump-my-version bump minor
|
|
119
|
+
$ git push origin main --follow-tags
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
[gh-issues]: https://github.com/petrus-v/nextcloud-s3-backup/issues
|