session-adapters 0.2.0__tar.gz → 0.3.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.
- session_adapters-0.3.0/.env +1 -0
- session_adapters-0.3.0/.github/dependabot.yml +28 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/.gitignore +1 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/PKG-INFO +1 -2
- {session_adapters-0.2.0 → session_adapters-0.3.0}/Taskfile.yaml +8 -13
- {session_adapters-0.2.0 → session_adapters-0.3.0}/pyproject.toml +0 -1
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/__about__.py +1 -1
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/base.py +5 -9
- {session_adapters-0.2.0 → session_adapters-0.3.0}/.github/workflows/package.yaml +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/LICENSE +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/README.md +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/__init__.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/file_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/http_conts.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/oci_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/src/session_adapters/s3_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/__init__.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/conftest.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/test_base_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/test_file_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/test_oci_adapter.py +0 -0
- {session_adapters-0.2.0 → session_adapters-0.3.0}/tests/test_s3_adapter.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TASK_X_REMOTE_TASKFILES=1
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright 2026 Terradue
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
version: 2
|
|
16
|
+
|
|
17
|
+
updates:
|
|
18
|
+
- package-ecosystem: "pip"
|
|
19
|
+
directory: "/"
|
|
20
|
+
schedule:
|
|
21
|
+
interval: "daily"
|
|
22
|
+
open-pull-requests-limit: 10
|
|
23
|
+
commit-message:
|
|
24
|
+
prefix: "build"
|
|
25
|
+
labels:
|
|
26
|
+
- "dependencies"
|
|
27
|
+
allow:
|
|
28
|
+
- dependency-type: "direct"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: session-adapters
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Requests transport adapters for file://, s3://, and oci:// URLs.
|
|
5
5
|
Project-URL: Documentation, https://github.com/Terradue/session-adapters#README.md
|
|
6
6
|
Project-URL: Issues, https://github.com/Terradue/session-adapters/issues
|
|
@@ -22,7 +22,6 @@ Requires-Dist: boto3
|
|
|
22
22
|
Requires-Dist: loguru
|
|
23
23
|
Requires-Dist: oras
|
|
24
24
|
Requires-Dist: pydantic
|
|
25
|
-
Requires-Dist: python-magic
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
27
26
|
|
|
28
27
|
# session-adapters
|
|
@@ -14,19 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
version: '3'
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
test:
|
|
20
|
-
desc: Run tests
|
|
21
|
-
cmds:
|
|
22
|
-
- hatch run test:test-show-setup
|
|
17
|
+
includes:
|
|
18
|
+
quality: https://raw.githubusercontent.com/Terradue/taskfile-utils/refs/heads/main/quality.yaml
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
desc: Run code quality checks
|
|
26
|
-
cmds:
|
|
27
|
-
- hatch run dev:check
|
|
20
|
+
tasks:
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
desc: Run linters
|
|
22
|
+
default:
|
|
31
23
|
cmds:
|
|
32
|
-
-
|
|
24
|
+
- task: quality:test
|
|
25
|
+
- task: quality:check
|
|
26
|
+
- task: quality:lint
|
|
27
|
+
|
|
@@ -20,7 +20,6 @@ from session_adapters.http_conts import (
|
|
|
20
20
|
)
|
|
21
21
|
from abc import abstractmethod
|
|
22
22
|
from http import HTTPStatus
|
|
23
|
-
from magic import Magic
|
|
24
23
|
from pathlib import Path
|
|
25
24
|
from requests import PreparedRequest, Response
|
|
26
25
|
from typing import Any, Dict, final, Generic, TypeVar, Union
|
|
@@ -36,8 +35,6 @@ __DATE_HEADER_FORMAT__ = "%a, %d %b %Y %H:%M:%S GMT"
|
|
|
36
35
|
|
|
37
36
|
AdapterRequest = TypeVar("AdapterRequest")
|
|
38
37
|
|
|
39
|
-
magic = Magic(mime=True, uncompress=True)
|
|
40
|
-
|
|
41
38
|
# Ensure YAML extensions are known by the stdlib
|
|
42
39
|
mimetypes.add_type(ContentType.YAML.value, ".yaml")
|
|
43
40
|
mimetypes.add_type(ContentType.YAML.value, ".yml")
|
|
@@ -80,13 +77,12 @@ class ExtendedResponse(Response):
|
|
|
80
77
|
self.send_status(HTTPStatus.OK)
|
|
81
78
|
self.send_date_header(HTTPHeader.LAST_MODIFIED, mod_time)
|
|
82
79
|
|
|
83
|
-
|
|
84
|
-
if not mime or ContentType.PLAIN == ContentType(mime):
|
|
85
|
-
guess_mime = mimetypes.guess_type(path)
|
|
86
|
-
if guess_mime:
|
|
87
|
-
mime = guess_mime[0]
|
|
80
|
+
guess_mime = mimetypes.guess_type(path)
|
|
88
81
|
|
|
89
|
-
|
|
82
|
+
for mime in guess_mime:
|
|
83
|
+
if mime:
|
|
84
|
+
self.send_header(HTTPHeader.CONTENT_TYPE, mime)
|
|
85
|
+
break
|
|
90
86
|
|
|
91
87
|
@final
|
|
92
88
|
def send_error(self, http_status: HTTPStatus, error: Any):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|