asanypath 2.0.0__tar.gz → 2.0.1__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.
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/workflows/publish.yml +14 -6
- {asanypath-2.0.0 → asanypath-2.0.1}/PKG-INFO +1 -1
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/_version.py +2 -2
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/s3.py +8 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_s3.py +32 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.copilot/skills/async-python-lib/SKILL.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.copilot/skills/gitguro/SKILL.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/CODEOWNERS +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/dependabot.yml +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.github/workflows/unittests.yml +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.gitignore +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/.pre-commit-config.yaml +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/CODE_OF_CONDUCT.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/CONTRIBUTING.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/LICENSE +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/README.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/SECURITY.md +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/asanypath.png +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/compose.yml +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/hatch_build.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/pyproject.toml +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/scripts/bench.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/__init__.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/__init__.pyi +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/_credstore.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/_transfer.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/artifactory.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/asanypath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/asanypath.pyi +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/azure.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/batcher.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/cli.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/cloud.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/common.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/exceptions.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/ftp.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/gcs.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/http.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/local.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/options.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/ssh.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/sync.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath/unsupported.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/src/asanypath_native.pyi +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/__init__.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/conftest.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_artifactory.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_asanypath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_azure.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_batcher.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_cli.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_cloudpathmixin.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_commonpathmixin.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_credstore.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_ftp.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_gcs.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_http.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_http_auth.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_local.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_ssh.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_sync.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_syncpath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/tests/test_unsupported_path.py +0 -0
- {asanypath-2.0.0 → asanypath-2.0.1}/uv.lock +0 -0
|
@@ -3,6 +3,12 @@ name: Publish Python and native Package to pypi
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
release_tag:
|
|
9
|
+
description: Existing v<major>.<minor>.<patch> tag to build and publish
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
6
12
|
|
|
7
13
|
permissions:
|
|
8
14
|
contents: read
|
|
@@ -11,17 +17,19 @@ jobs:
|
|
|
11
17
|
release-version:
|
|
12
18
|
runs-on: ubuntu-latest
|
|
13
19
|
outputs:
|
|
20
|
+
tag: ${{ steps.version.outputs.tag }}
|
|
14
21
|
value: ${{ steps.version.outputs.value }}
|
|
15
22
|
steps:
|
|
16
23
|
- name: Validate release tag
|
|
17
24
|
id: version
|
|
18
25
|
env:
|
|
19
|
-
TAG: ${{ github.event.release.tag_name }}
|
|
26
|
+
TAG: ${{ inputs.release_tag || github.event.release.tag_name }}
|
|
20
27
|
run: |
|
|
21
28
|
case "$TAG" in
|
|
22
29
|
v[0-9]*.[0-9]*.[0-9]*) ;;
|
|
23
30
|
*) echo "Release tag must be v<major>.<minor>.<patch>." >&2; exit 1 ;;
|
|
24
31
|
esac
|
|
32
|
+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
25
33
|
echo "value=${TAG#v}" >> "$GITHUB_OUTPUT"
|
|
26
34
|
|
|
27
35
|
build-native:
|
|
@@ -33,7 +41,7 @@ jobs:
|
|
|
33
41
|
- os: ubuntu-latest
|
|
34
42
|
target: x86_64
|
|
35
43
|
manylinux: auto
|
|
36
|
-
- os: macos-
|
|
44
|
+
- os: macos-15-intel
|
|
37
45
|
target: x86_64
|
|
38
46
|
manylinux: off
|
|
39
47
|
- os: macos-14
|
|
@@ -47,7 +55,7 @@ jobs:
|
|
|
47
55
|
- name: Checkout release
|
|
48
56
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
49
57
|
with:
|
|
50
|
-
ref: ${{
|
|
58
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
51
59
|
fetch-depth: 0
|
|
52
60
|
persist-credentials: false
|
|
53
61
|
|
|
@@ -81,7 +89,7 @@ jobs:
|
|
|
81
89
|
- name: Checkout release
|
|
82
90
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
83
91
|
with:
|
|
84
|
-
ref: ${{
|
|
92
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
85
93
|
fetch-depth: 0
|
|
86
94
|
persist-credentials: false
|
|
87
95
|
|
|
@@ -115,7 +123,7 @@ jobs:
|
|
|
115
123
|
- name: Checkout release
|
|
116
124
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
117
125
|
with:
|
|
118
|
-
ref: ${{
|
|
126
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
119
127
|
fetch-depth: 0
|
|
120
128
|
persist-credentials: false
|
|
121
129
|
|
|
@@ -131,7 +139,7 @@ jobs:
|
|
|
131
139
|
env:
|
|
132
140
|
VERSION: ${{ needs.release-version.outputs.value }}
|
|
133
141
|
run: |
|
|
134
|
-
unzip -p dist/*.whl '*/METADATA' | grep -Fx "Requires-Dist: asanypath-native~=${VERSION}.0"
|
|
142
|
+
unzip -p dist/*.whl '*/METADATA' | grep -Fx "Requires-Dist: asanypath-native~=${VERSION%.*}.0"
|
|
135
143
|
|
|
136
144
|
- name: Upload Python distributions
|
|
137
145
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (2, 0,
|
|
21
|
+
__version__ = version = '2.0.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 0, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -34,6 +34,13 @@ from asanypath_native import (
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
def _default_s3_endpoint(region: str) -> str:
|
|
38
|
+
if region == "us-east-1":
|
|
39
|
+
return "https://s3.amazonaws.com"
|
|
40
|
+
suffix = "amazonaws.com.cn" if region.startswith("cn-") else "amazonaws.com"
|
|
41
|
+
return f"https://s3.{region}.{suffix}"
|
|
42
|
+
|
|
43
|
+
|
|
37
44
|
class S3Path(CloudPathMixin):
|
|
38
45
|
protocol: str = "s3"
|
|
39
46
|
_supports_range_read: bool = True
|
|
@@ -128,6 +135,7 @@ class S3Path(CloudPathMixin):
|
|
|
128
135
|
"aws_session_token": getenv("AWS_SESSION_TOKEN"),
|
|
129
136
|
}
|
|
130
137
|
cfg.update({k: v for k, v in env.items() if v is not None})
|
|
138
|
+
cfg["endpoint_url"] = cfg["endpoint_url"] or _default_s3_endpoint(cfg["aws_region"])
|
|
131
139
|
|
|
132
140
|
return SimpleNamespace(**cfg)
|
|
133
141
|
|
|
@@ -445,6 +445,38 @@ def test_credentials_from_env():
|
|
|
445
445
|
assert p._region == "ap-southeast-1"
|
|
446
446
|
|
|
447
447
|
|
|
448
|
+
@pytest.mark.parametrize(
|
|
449
|
+
"region,endpoint_override,expected",
|
|
450
|
+
[
|
|
451
|
+
("us-east-1", None, "https://s3.amazonaws.com"),
|
|
452
|
+
("eu-west-1", None, "https://s3.eu-west-1.amazonaws.com"),
|
|
453
|
+
("cn-north-1", None, "https://s3.cn-north-1.amazonaws.com.cn"),
|
|
454
|
+
("eu-west-1", "https://s3.example.test", "https://s3.example.test"),
|
|
455
|
+
],
|
|
456
|
+
ids=["us-east-1", "regional", "china", "custom-endpoint"],
|
|
457
|
+
)
|
|
458
|
+
def test_endpoint_from_region_and_env(region, endpoint_override, expected):
|
|
459
|
+
env = {
|
|
460
|
+
"AWS_REGION": region,
|
|
461
|
+
"AWS_PROFILE": "default",
|
|
462
|
+
"AWS_SHARED_CREDENTIALS_FILE": "/dev/null",
|
|
463
|
+
"AWS_CONFIG_FILE": "/dev/null",
|
|
464
|
+
}
|
|
465
|
+
if endpoint_override is not None:
|
|
466
|
+
env["AWS_ENDPOINT_URL"] = endpoint_override
|
|
467
|
+
|
|
468
|
+
with (
|
|
469
|
+
patch("asanypath.s3.getenv", side_effect=lambda k, d=None: env.get(k, d)),
|
|
470
|
+
patch("asanypath.s3.ConfigParser.read", return_value=[]),
|
|
471
|
+
):
|
|
472
|
+
S3Path._env_config = None
|
|
473
|
+
try:
|
|
474
|
+
p = S3Path("s3://bucket/key")
|
|
475
|
+
assert p._endpoint_url == expected
|
|
476
|
+
finally:
|
|
477
|
+
S3Path._env_config = None
|
|
478
|
+
|
|
479
|
+
|
|
448
480
|
def test_env_credentials_override_profile(tmp_path):
|
|
449
481
|
"""Env vars must take precedence over the shared-credentials profile."""
|
|
450
482
|
creds = tmp_path / "credentials"
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|