tiny-retriever 0.2.1__tar.gz → 0.4.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.
- tiny_retriever-0.4.0/.github/workflows/docs.yml +66 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/workflows/release.yml +18 -19
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/workflows/test.yml +1 -1
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.pre-commit-config.yaml +23 -5
- tiny_retriever-0.4.0/CHANGELOG.md +130 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/CODE_OF_CONDUCT.md +4 -4
- tiny_retriever-0.4.0/CONTRIBUTING.md +175 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/PKG-INFO +70 -25
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/README.md +54 -13
- tiny_retriever-0.4.0/docs/examples/hydrodata.ipynb +296 -0
- tiny_retriever-0.4.0/docs/examples/index.md +21 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/environment.yml +1 -1
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/mkdocs.yml +9 -7
- tiny_retriever-0.4.0/pyproject.toml +353 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/src/tiny_retriever/__init__.py +10 -6
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/src/tiny_retriever/exceptions.py +15 -2
- tiny_retriever-0.4.0/src/tiny_retriever/py.typed +0 -0
- tiny_retriever-0.4.0/src/tiny_retriever/tiny_retriever.py +1312 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/src/tiny_retriever/tiny_retriever.pyi +91 -18
- tiny_retriever-0.4.0/tests/conftest.py +69 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/tests/test_exceptions.py +59 -3
- tiny_retriever-0.4.0/tests/test_filename.py +167 -0
- tiny_retriever-0.4.0/tests/test_retriever.py +1055 -0
- tiny_retriever-0.4.0/tests/test_sockets.py +434 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/tests/test_threading.py +67 -22
- tiny_retriever-0.2.1/CHANGELOG.md +0 -67
- tiny_retriever-0.2.1/CONTRIBUTING.md +0 -239
- tiny_retriever-0.2.1/docs/examples/hydrodata.ipynb +0 -322
- tiny_retriever-0.2.1/docs/examples/index.md +0 -18
- tiny_retriever-0.2.1/pyproject.toml +0 -315
- tiny_retriever-0.2.1/src/tiny_retriever/tiny_retriever.py +0 -640
- tiny_retriever-0.2.1/tests/test_filename.py +0 -119
- tiny_retriever-0.2.1/tests/test_retriever.py +0 -409
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.codecov.yml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.gitattributes +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/ISSUE_TEMPLATE/bugreport.yml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/ISSUE_TEMPLATE/newfeature.yml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.github/dependabot.yml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.gitignore +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/.readthedocs.yaml +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/AUTHORS.md +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/LICENSE +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/assets/logo.png +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/assets/logo.svg +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/docs_hooks.py +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/examples/images/dem.png +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/javascripts/mathjax.js +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/overrides/main.html +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/reference.md +0 -0
- {tiny_retriever-0.2.1 → tiny_retriever-0.4.0}/docs/stylesheets/extra.css +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- v*
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: docs-deploy
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
docs:
|
|
20
|
+
name: Deploy Documentation
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0
|
|
27
|
+
|
|
28
|
+
- uses: prefix-dev/setup-pixi@v0.9.4
|
|
29
|
+
with:
|
|
30
|
+
pixi-version: v0.66.0
|
|
31
|
+
environments: docs
|
|
32
|
+
activate-environment: docs
|
|
33
|
+
|
|
34
|
+
- name: Configure Git
|
|
35
|
+
run: |-
|
|
36
|
+
git config user.name "github-actions[bot]"
|
|
37
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
38
|
+
|
|
39
|
+
- name: Fetch gh-pages branch
|
|
40
|
+
run: git fetch origin gh-pages:gh-pages || true
|
|
41
|
+
|
|
42
|
+
- name: Deploy latest docs (main branch)
|
|
43
|
+
if: github.ref == 'refs/heads/main'
|
|
44
|
+
run: |-
|
|
45
|
+
pixi r docs-deploy
|
|
46
|
+
mike set-default --push latest
|
|
47
|
+
|
|
48
|
+
- name: Deploy release docs (tagged version)
|
|
49
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
50
|
+
run: |-
|
|
51
|
+
VERSION=$(git describe --tags --abbrev=0)
|
|
52
|
+
# Find the previous stable version before deploying
|
|
53
|
+
PREV=$(mike list --json 2>/dev/null | python3 -c "
|
|
54
|
+
import json, sys
|
|
55
|
+
versions = json.load(sys.stdin)
|
|
56
|
+
prev = [v['version'] for v in versions if 'stable' in v.get('aliases', [])]
|
|
57
|
+
print(prev[0] if prev else '')
|
|
58
|
+
" || true)
|
|
59
|
+
# Deploy new version with stable alias
|
|
60
|
+
pixi r docs-release
|
|
61
|
+
mike retitle --push "$VERSION" "$VERSION (stable)"
|
|
62
|
+
# Remove (stable) label from previous version
|
|
63
|
+
if [ -n "$PREV" ] && [ "$PREV" != "$VERSION" ]; then
|
|
64
|
+
mike retitle --push "$PREV" "$PREV"
|
|
65
|
+
fi
|
|
66
|
+
mike set-default --push latest
|
|
@@ -17,25 +17,24 @@ jobs:
|
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@v6
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- name: Github Release
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Generate release notes with git-cliff
|
|
24
|
+
uses: orhun/git-cliff-action@v4
|
|
25
|
+
with:
|
|
26
|
+
config: pyproject.toml
|
|
27
|
+
args: --latest --strip all
|
|
28
|
+
env:
|
|
29
|
+
OUTPUT: release-notes.md
|
|
30
|
+
GITHUB_REPO: ${{ github.repository }}
|
|
31
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
+
|
|
33
|
+
- name: Create GitHub Release
|
|
35
34
|
uses: softprops/action-gh-release@v2
|
|
36
35
|
if: startsWith(github.ref, 'refs/tags/')
|
|
37
36
|
with:
|
|
38
|
-
body_path:
|
|
37
|
+
body_path: release-notes.md
|
|
39
38
|
env:
|
|
40
39
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
40
|
|
|
@@ -48,7 +47,7 @@ jobs:
|
|
|
48
47
|
with:
|
|
49
48
|
fetch-depth: 0
|
|
50
49
|
|
|
51
|
-
- uses: hynek/build-and-inspect-python-package@
|
|
50
|
+
- uses: hynek/build-and-inspect-python-package@67230f7b8410ae0052b39c1efc89d89fff43ff10 # v3.0.2
|
|
52
51
|
with:
|
|
53
52
|
attest-build-provenance-github: true
|
|
54
53
|
|
|
@@ -59,13 +58,13 @@ jobs:
|
|
|
59
58
|
|
|
60
59
|
steps:
|
|
61
60
|
- name: Download packages built by build-and-inspect-python-package
|
|
62
|
-
uses: actions/download-artifact@
|
|
61
|
+
uses: actions/download-artifact@v8
|
|
63
62
|
with:
|
|
64
63
|
name: Packages
|
|
65
64
|
path: dist
|
|
66
65
|
|
|
67
66
|
- name: Generate artifact attestation for sdist and wheel
|
|
68
|
-
uses: actions/attest-build-provenance@
|
|
67
|
+
uses: actions/attest-build-provenance@v4
|
|
69
68
|
with:
|
|
70
69
|
subject-path: dist
|
|
71
70
|
|
|
@@ -7,7 +7,9 @@ repos:
|
|
|
7
7
|
- id: mixed-line-ending
|
|
8
8
|
args: [--fix=lf]
|
|
9
9
|
- id: check-ast
|
|
10
|
+
exclude: ^docs/examples/notebooks/.*\.py$
|
|
10
11
|
- id: check-builtin-literals
|
|
12
|
+
exclude: ^docs/examples/notebooks/.*\.py$
|
|
11
13
|
- id: check-case-conflict
|
|
12
14
|
- id: check-docstring-first
|
|
13
15
|
- id: check-shebang-scripts-are-executable
|
|
@@ -16,13 +18,16 @@ repos:
|
|
|
16
18
|
- id: check-toml
|
|
17
19
|
- id: check-xml
|
|
18
20
|
- id: check-yaml
|
|
21
|
+
exclude: mkdocs.yml
|
|
19
22
|
- id: debug-statements
|
|
23
|
+
exclude: ^docs/examples/notebooks/.*\.py$
|
|
20
24
|
- id: destroyed-symlinks
|
|
21
25
|
- id: detect-private-key
|
|
22
26
|
- id: end-of-file-fixer
|
|
23
27
|
exclude: ^LICENSE|\.(html|csv|txt|svg|py)$
|
|
24
28
|
- id: pretty-format-json
|
|
25
29
|
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
|
|
30
|
+
exclude: \.ipynb$
|
|
26
31
|
- id: trailing-whitespace
|
|
27
32
|
args: [--markdown-linebreak-ext=md]
|
|
28
33
|
exclude: \.(html|svg)$
|
|
@@ -32,9 +37,17 @@ repos:
|
|
|
32
37
|
hooks:
|
|
33
38
|
- id: ssort
|
|
34
39
|
name: Sort top level statements with ssort
|
|
40
|
+
exclude: ^docs/examples/notebooks/.*\.py$
|
|
41
|
+
|
|
42
|
+
- repo: https://github.com/mwouts/jupytext
|
|
43
|
+
rev: v1.19.1
|
|
44
|
+
hooks:
|
|
45
|
+
- id: jupytext
|
|
46
|
+
entry: jupytext --sync
|
|
47
|
+
files: ^docs/examples/notebooks/
|
|
35
48
|
|
|
36
49
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
37
|
-
rev: v0.15.
|
|
50
|
+
rev: v0.15.8
|
|
38
51
|
hooks:
|
|
39
52
|
- id: ruff
|
|
40
53
|
name: Linting with Ruff
|
|
@@ -52,7 +65,7 @@ repos:
|
|
|
52
65
|
args: [--max-line-length, '100']
|
|
53
66
|
|
|
54
67
|
- repo: https://github.com/codespell-project/codespell
|
|
55
|
-
rev: v2.4.
|
|
68
|
+
rev: v2.4.2
|
|
56
69
|
hooks:
|
|
57
70
|
- id: codespell
|
|
58
71
|
name: Check common misspellings in text files with codespell.
|
|
@@ -60,7 +73,7 @@ repos:
|
|
|
60
73
|
- tomli
|
|
61
74
|
|
|
62
75
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
63
|
-
rev: v2.
|
|
76
|
+
rev: v2.20.0
|
|
64
77
|
hooks:
|
|
65
78
|
- id: pyproject-fmt
|
|
66
79
|
name: Apply a consistent format to pyproject.toml
|
|
@@ -72,7 +85,7 @@ repos:
|
|
|
72
85
|
args: [--autofix, --indent, '2']
|
|
73
86
|
|
|
74
87
|
- repo: https://github.com/rhysd/actionlint
|
|
75
|
-
rev: v1.7.
|
|
88
|
+
rev: v1.7.12
|
|
76
89
|
hooks:
|
|
77
90
|
- id: actionlint
|
|
78
91
|
files: .github/workflows/
|
|
@@ -83,6 +96,11 @@ repos:
|
|
|
83
96
|
hooks:
|
|
84
97
|
- id: mdformat
|
|
85
98
|
additional_dependencies:
|
|
86
|
-
- mdformat-
|
|
99
|
+
- mdformat-mkdocs
|
|
100
|
+
- mdformat-ruff
|
|
101
|
+
- ruff
|
|
102
|
+
- mdformat-config
|
|
87
103
|
- mdformat-toc
|
|
104
|
+
# - mdformat-admon
|
|
88
105
|
args: [--wrap, '88']
|
|
106
|
+
exclude: ^docs/reference/
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. The format is based
|
|
4
|
+
on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.4.0] - 2026-12-01
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Widen the default retry window and read it from the environment
|
|
12
|
+
- Give ServiceError the HTTP status and the start of the error body
|
|
13
|
+
- Retry 429 responses and honor Retry-After
|
|
14
|
+
- Add fetch_response to return status and headers for any HTTP status
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Run fetch, download, and check_downloads through one retry loop
|
|
19
|
+
- Sort the local test server methods
|
|
20
|
+
- Drop a no-op wait from the loop thread stop
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Reject unusable retry settings and attempt counts below one
|
|
25
|
+
- Default to three attempts and tell the caller a transient failure is worth retrying
|
|
26
|
+
later
|
|
27
|
+
- Download to a .part file so a failed request keeps the existing file
|
|
28
|
+
- Retry dropped connections and cut-off bodies, and fail fast on TLS and local file
|
|
29
|
+
errors
|
|
30
|
+
- Report a timeout after one attempt and say how long it waited
|
|
31
|
+
- Start the request timeout once a per-host slot is free
|
|
32
|
+
- Raise ServiceError when check_downloads cannot get a remote size
|
|
33
|
+
- Ask for uncompressed bodies when downloading and checking sizes
|
|
34
|
+
- Log the failures that raise_status=False turns into None
|
|
35
|
+
- Cancel the requests when the caller is interrupted
|
|
36
|
+
- Cancel the rest of a batch when one request fails
|
|
37
|
+
- Reject one request_kwargs dict for several URLs
|
|
38
|
+
- Add unique_filename params to the URL's own query
|
|
39
|
+
- Decode JSON responses whatever their mimetype
|
|
40
|
+
- Decode text without a declared charset as UTF-8 before latin1
|
|
41
|
+
- Accept yarl.URL in fetch as its annotation says
|
|
42
|
+
- Reject request_kwargs keys that fetch sets, and accept a generator of dicts
|
|
43
|
+
- Accept (key, value) pairs as unique_filename params and reject unusable values
|
|
44
|
+
- Reject a directory as a download target before any request
|
|
45
|
+
- Let a download that keeps receiving data run past its timeout
|
|
46
|
+
- Validate MAX_CONCURRENT_CALLS like the other settings and document it as per call
|
|
47
|
+
- Make the Windows selector loop directly instead of setting the deprecated global
|
|
48
|
+
policy
|
|
49
|
+
- Type JSON results as any JSON value and drop a stale stub header
|
|
50
|
+
- Let ServiceError survive pickling and expose its url
|
|
51
|
+
- Report a malformed URL as a ServiceError that raise_status=False logs
|
|
52
|
+
- Treat limit_per_host=0 as no per-host limit, as aiohttp does
|
|
53
|
+
- Do not call a certificate fingerprint mismatch temporary
|
|
54
|
+
- Keep the HTTP status when the error body fails to arrive
|
|
55
|
+
- Send each download and size-check attempt once
|
|
56
|
+
- Stream each download attempt to its own temporary file and keep the target mode
|
|
57
|
+
- Open the temporary file without creating it, so a cancelled open leaves nothing
|
|
58
|
+
- Raise errors of local file operations as they are, timeouts included
|
|
59
|
+
- Let cancelled work clean up after Ctrl-C and before the loop closes
|
|
60
|
+
- Do not retry a 5xx whose error body timed out
|
|
61
|
+
- Drop special mode bits when replacing a file and fit long names in the temporary file
|
|
62
|
+
- Warn and use the default for an unusable environment setting
|
|
63
|
+
- Keep unique_filename fields apart and ignore query key order
|
|
64
|
+
- Do not retry a POST request that got a 5xx response
|
|
65
|
+
- Stop a huge environment integer from failing the import
|
|
66
|
+
- Name files from the encoded URL so an escaped slash keeps its own name
|
|
67
|
+
- Give a bare host and its root path one file name
|
|
68
|
+
- Retry a download's final replace while Windows holds the target
|
|
69
|
+
|
|
70
|
+
## [0.3.0] - 2026-03-30
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
|
|
74
|
+
- Add retry with exponential backoff for transient errors
|
|
75
|
+
|
|
76
|
+
## [0.2.1] - 2026-02-09
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
|
|
80
|
+
- Add a new function to check for corrupted download files.
|
|
81
|
+
|
|
82
|
+
## [0.2.0] - 2026-01-30
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- Rewrite all tests using aioresponses.
|
|
87
|
+
- Add support for toggling ssl verification.
|
|
88
|
+
|
|
89
|
+
## [0.1.3] - 2025-02-20
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- Change the timeout from session to request level.
|
|
94
|
+
|
|
95
|
+
## [0.1.2] - 2025-02-18
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
|
|
99
|
+
- Make \_AsyncLoopThread a singleton
|
|
100
|
+
- More robust handling of thread starting/stopping to avoid issues with other threadsafe
|
|
101
|
+
libraries.
|
|
102
|
+
|
|
103
|
+
## [0.1.1] - 2025-02-12
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
|
|
107
|
+
- Check if the input query parameters that are apssed to aiohttp are valid
|
|
108
|
+
|
|
109
|
+
## [0.1.0] - 2025-02-12
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
- Add support for passing a single url/kwargs instead of a list.
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
|
|
117
|
+
- If the input is a single url/kwargs return a response instead of list.
|
|
118
|
+
|
|
119
|
+
### New Contributors
|
|
120
|
+
|
|
121
|
+
- @ made their first contribution
|
|
122
|
+
- @cheginit made their first contribution
|
|
123
|
+
|
|
124
|
+
[0.1.1]: https://github.com/cheginit/tiny-retriever/compare/v0.1.0...v0.1.1
|
|
125
|
+
[0.1.2]: https://github.com/cheginit/tiny-retriever/compare/v0.1.1...v0.1.2
|
|
126
|
+
[0.1.3]: https://github.com/cheginit/tiny-retriever/compare/v0.1.2...v0.1.3
|
|
127
|
+
[0.2.0]: https://github.com/cheginit/tiny-retriever/compare/v0.1.3...v0.2.0
|
|
128
|
+
[0.2.1]: https://github.com/cheginit/tiny-retriever/compare/v0.2.0...v0.2.1
|
|
129
|
+
[0.3.0]: https://github.com/cheginit/tiny-retriever/compare/v0.2.1...v0.3.0
|
|
130
|
+
[0.4.0]: https://github.com/cheginit/tiny-retriever/compare/v0.3.0...v0.4.0
|
|
@@ -20,19 +20,19 @@ include:
|
|
|
20
20
|
- Being respectful of differing opinions, viewpoints, and experiences
|
|
21
21
|
- Giving and gracefully accepting constructive feedback
|
|
22
22
|
- Accepting responsibility and apologizing to those affected by our mistakes, and
|
|
23
|
-
|
|
23
|
+
learning from the experience
|
|
24
24
|
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
25
25
|
|
|
26
26
|
Examples of unacceptable behavior include:
|
|
27
27
|
|
|
28
28
|
- The use of sexualized language or imagery, and sexual attention or advances of any
|
|
29
|
-
|
|
29
|
+
kind
|
|
30
30
|
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
31
31
|
- Public or private harassment
|
|
32
32
|
- Publishing others' private information, such as a physical or email address, without
|
|
33
|
-
|
|
33
|
+
their explicit permission
|
|
34
34
|
- Other conduct which could reasonably be considered inappropriate in a professional
|
|
35
|
-
|
|
35
|
+
setting
|
|
36
36
|
|
|
37
37
|
## Enforcement Responsibilities
|
|
38
38
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Contributing to TinyRetriever
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing!
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. Install [pixi](https://pixi.sh) and [gh](https://github.com/cli/cli#installation).
|
|
8
|
+
|
|
9
|
+
1. Fork and clone the repository:
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
git clone git@github.com:your_name_here/tiny-retriever.git
|
|
13
|
+
cd tiny-retriever
|
|
14
|
+
git remote add upstream git@github.com:cheginit/tiny-retriever.git
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
1. Set up the development environments:
|
|
18
|
+
|
|
19
|
+
```console
|
|
20
|
+
pixi install -e dev
|
|
21
|
+
pixi install -e typecheck
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
1. Install pre-commit hooks:
|
|
25
|
+
|
|
26
|
+
```console
|
|
27
|
+
pixi r pcupdate # optionally bump hooks to latest versions first
|
|
28
|
+
pixi r lint # installs hooks and runs them across the repo
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commit Messages
|
|
32
|
+
|
|
33
|
+
This project uses
|
|
34
|
+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). All commit
|
|
35
|
+
messages **must** follow this format:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
<type>[optional scope]: <description>
|
|
39
|
+
|
|
40
|
+
[optional body]
|
|
41
|
+
|
|
42
|
+
[optional footer(s)]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Types
|
|
46
|
+
|
|
47
|
+
| Type | When to use | Changelog section |
|
|
48
|
+
| ---------- | -------------------------------------- | ----------------- |
|
|
49
|
+
| `feat` | A new feature | Added |
|
|
50
|
+
| `fix` | A bug fix | Fixed |
|
|
51
|
+
| `perf` | A performance improvement | Changed |
|
|
52
|
+
| `refactor` | Code restructuring, no behavior change | Changed |
|
|
53
|
+
| `revert` | Reverting a previous commit | Fixed |
|
|
54
|
+
| `docs` | Documentation only | *(skipped)* |
|
|
55
|
+
| `test` | Adding or updating tests | *(skipped)* |
|
|
56
|
+
| `chore` | Maintenance, dependencies, tooling | *(skipped)* |
|
|
57
|
+
| `ci` | CI/CD changes | *(skipped)* |
|
|
58
|
+
| `build` | Build system or external dependencies | *(skipped)* |
|
|
59
|
+
|
|
60
|
+
### Breaking Changes
|
|
61
|
+
|
|
62
|
+
Append `!` after the type, or add `BREAKING CHANGE:` in the footer:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
feat!: drop support for Python 3.10
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
feat: new API
|
|
70
|
+
|
|
71
|
+
BREAKING CHANGE: `old_function` has been removed.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Examples
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
feat: add retry with exponential backoff for transient errors
|
|
78
|
+
fix: handle missing Content-Length in download validation
|
|
79
|
+
chore: bump ruff to v0.15.8
|
|
80
|
+
docs: add example notebook for hydrology data
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Running Tests
|
|
84
|
+
|
|
85
|
+
```console
|
|
86
|
+
pixi r -e test310 test # test against Python 3.10
|
|
87
|
+
pixi r -e test314 test # test against Python 3.14
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Linting
|
|
91
|
+
|
|
92
|
+
```console
|
|
93
|
+
pixi r lint
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Type Checking
|
|
97
|
+
|
|
98
|
+
```console
|
|
99
|
+
pixi r typecheck
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
103
|
+
|
|
104
|
+
```console
|
|
105
|
+
pixi r -e docs docs-serve # live preview at http://localhost:8000
|
|
106
|
+
pixi r -e docs docs-build # build static site
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Managing the Changelog
|
|
110
|
+
|
|
111
|
+
The changelog is maintained by [git-cliff](https://git-cliff.org) and generated
|
|
112
|
+
automatically from conventional commit messages. You do not need to edit `CHANGELOG.md`
|
|
113
|
+
manually.
|
|
114
|
+
|
|
115
|
+
```console
|
|
116
|
+
pixi r -e dev changelog # preview unreleased changes
|
|
117
|
+
pixi r -e dev changelog-update # write them to CHANGELOG.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Submitting Changes
|
|
121
|
+
|
|
122
|
+
1. Create a feature branch from `main`:
|
|
123
|
+
|
|
124
|
+
```console
|
|
125
|
+
git checkout -b bugfix-or-feature/name-of-your-change
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
1. Make your changes with tests. If you are making breaking changes, update the
|
|
129
|
+
documentation and `README.md` as well.
|
|
130
|
+
|
|
131
|
+
1. Fetch the latest upstream and resolve any merge conflicts:
|
|
132
|
+
|
|
133
|
+
```console
|
|
134
|
+
git fetch upstream
|
|
135
|
+
git merge upstream/main
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
1. Ensure all checks pass:
|
|
139
|
+
|
|
140
|
+
```console
|
|
141
|
+
pixi r lint
|
|
142
|
+
pixi r typecheck
|
|
143
|
+
pixi r -e test314 test
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
1. Commit using conventional commits and push:
|
|
147
|
+
|
|
148
|
+
```console
|
|
149
|
+
git add .
|
|
150
|
+
git commit -m "feat: a detailed description of your changes"
|
|
151
|
+
git push origin bugfix-or-feature/name-of-your-change
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
1. Submit a pull request through the GitHub website.
|
|
155
|
+
|
|
156
|
+
## Reporting Bugs
|
|
157
|
+
|
|
158
|
+
Before submitting a bug report, search existing
|
|
159
|
+
[issues](https://github.com/cheginit/tiny-retriever/issues) to avoid duplicates. When
|
|
160
|
+
filing a new issue:
|
|
161
|
+
|
|
162
|
+
- Provide a clear and descriptive title.
|
|
163
|
+
- Describe the expected behavior vs. the actual behavior.
|
|
164
|
+
- Include a minimal reproducible example.
|
|
165
|
+
- Include your Python version, OS, and relevant package versions.
|
|
166
|
+
|
|
167
|
+
> Security-related issues must be reported by email to <cheginit@gmail.com>, not through
|
|
168
|
+
> the public issue tracker.
|
|
169
|
+
|
|
170
|
+
## Suggesting Enhancements
|
|
171
|
+
|
|
172
|
+
Enhancement suggestions are tracked as
|
|
173
|
+
[GitHub issues](https://github.com/cheginit/tiny-retriever/issues). Please check for
|
|
174
|
+
existing suggestions before opening a new one, and explain why the enhancement would be
|
|
175
|
+
useful to the broader user base.
|