Skip to content

Commit 5ab30a6

Browse files
committed
Merge branch 'main' into zarr-v3
2 parents 7903d0a + b104437 commit 5ab30a6

File tree

9 files changed

+60
-26
lines changed

9 files changed

+60
-26
lines changed

.github/workflows/integration-test-review.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,19 @@ jobs:
3232
uses: actions/github-script@v7
3333
with:
3434
script: |
35-
const { number, html_url } = (await github.rest.repos.listPullRequestsAssociatedWithCommit({
36-
commit_sha: context.sha,
37-
owner: "${{ github.event.workflow_run.head_repository.owner.login }}",
38-
repo: "${{ github.event.workflow_run.head_repository.name }}",
39-
})).data[0] ?? {};
35+
const { html_url } = await github.rest.issues.get({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
issue_number: context.issue.number,
39+
});
4040
41-
if (number) {
42-
github.rest.issues.createComment({
43-
issue_number: number,
44-
owner: context.repo.owner,
45-
repo: context.repo.repo,
46-
body: "User [${{ github.triggering_actor }}](${{ github.event.workflow_run.head_repository.owner.html_url }})"
47-
+ " does not have permission to run integration tests. A maintainer must perform a security review of the"
48-
+ ` [code changes in this pull request](${html_url}/files) and re-run the`
49-
+ " [failed integration tests jobs](${{ github.event.workflow_run.html_url }}),"
50-
+ " if the code is deemed safe.",
51-
});
52-
}
41+
github.rest.issues.createComment({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
issue_number: context.issue.number,
45+
body: "User [${{ github.triggering_actor }}](${{ github.event.workflow_run.head_repository.owner.html_url }})"
46+
+ " does not have permission to run integration tests. A maintainer must perform a security review of the"
47+
+ ` [code changes in this pull request](${html_url}/files) and re-run the`
48+
+ " [failed integration tests jobs](${{ github.event.workflow_run.html_url }}),"
49+
+ " if the code is deemed safe.",
50+
});

.github/workflows/integration-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ jobs:
120120
--cov=earthaccess \
121121
--cov-report=term-missing \
122122
--capture=no \
123+
--color=yes \
123124
--tb=native \
124125
--log-cli-level=INFO
125126

.github/workflows/test-mindeps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: uv sync --resolution lowest-direct --extra test
3838

3939
- name: Test
40-
run: uv run pytest tests/unit --verbose --cov=earthaccess --cov=tests --cov-report=term-missing --capture=no --tb=native --log-cli-level=INFO
40+
run: uv run pytest tests/unit --verbose --cov=earthaccess --cov=tests --cov-report=term-missing --capture=no --color=yes --tb=native --log-cli-level=INFO
4141

4242
- name: Upload coverage
4343
# Don't upload coverage when using the `act` tool to run the workflow locally

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: uv run mypy
3030

3131
- name: Test
32-
run: uv run pytest tests/unit --verbose --cov=earthaccess --cov-report=term-missing --capture=no --tb=native --log-cli-level=INFO
32+
run: uv run pytest tests/unit --verbose --cov=earthaccess --cov-report=term-missing --capture=no --color=yes --tb=native --log-cli-level=INFO
3333

3434
- name: Upload coverage
3535
# Don't upload coverage when using the `act` tool to run the workflow locally

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ repos:
2828
- id: trailing-whitespace
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.9.9
31+
rev: v0.11.4
3232
hooks:
3333
- id: ruff
3434
args: ["--fix", "--exit-non-zero-on-fix"]
3535
- id: ruff-format
3636

3737
- repo: https://github.com/astral-sh/uv-pre-commit
38-
rev: "0.6.3"
38+
rev: "0.6.13"
3939
hooks:
4040
# Asserts that the lockfile is valid for pyproject.toml.
4141
# If it fails, update the lockfile by running:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
2020
([#966](https://github.com/nsidc/earthaccess/pull/966))
2121
([@weiji14](https://github.com/weiji14))
2222

23+
### Added
24+
- `get_s3_filesystem` now accepts an `endpoint` argument for specifying a credentials url.
25+
([#602](https://github.com/nsidc/earthaccess/issues/602))
26+
([@rwegener2](https://github.com/rwegener2))
27+
2328

2429
## [v0.14.0] - 2025-02-11
2530

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ files = earthaccess.download(results, "/tmp/my-download-folder")
8080
Visit [our quick start guide](https://earthaccess.readthedocs.io/en/latest/quick-start/) for more details.
8181

8282

83+
## Help!
84+
85+
We're here for you!
86+
**Before you open a new issue/discussion/topic, please search to see if anyone else has
87+
opened a similar one.**
88+
89+
:bug: If you've found a bug or mistake, please use
90+
[GitHub issues](https://github.com/nsidc/earthaccess/issues).
91+
92+
:bulb: If you'd like to request a feature or ask a question, please use
93+
[GitHub discussions](https://github.com/nsidc/earthaccess/discussions).
94+
95+
:left_speech_bubble: If you prefer real-time chat, please visit us in our
96+
[Zulip chat space](https://earthaccess.zulipchat.com)!
97+
We'd love to see you there! :open_hands:
98+
99+
83100
## Compatibility
84101

85102
The _minimum_ supported Python version is **3.11**.

docs/contributing/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ whether you're finding bugs, adding new features, fixing anything broken, or imp
66
When contributing we recommend:
77

88
- reading the contributing guide all the way though once before starting
9-
- searching through issues, discussions, and pull requests to see if your contribution has already been discussed
9+
- [join us on Zulip chat](https://earthaccess.zulipchat.com) for any questions you may have
10+
- searching through issues, discussions, pull requests, and Zulip to see if your contribution has already been discussed
1011
so you don't duplicate work
1112

1213
Then, you can:

earthaccess/api.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def get_s3_filesystem(
425425
daac: Optional[str] = None,
426426
provider: Optional[str] = None,
427427
results: Optional[DataGranule] = None,
428+
endpoint: Optional[str] = None,
428429
) -> s3fs.S3FileSystem:
429430
"""Return an `s3fs.S3FileSystem` for direct access when running within the AWS us-west-2 region.
430431
@@ -434,18 +435,29 @@ def get_s3_filesystem(
434435
If the DAAC is specified, there is no need to use provider.
435436
results: A list of results from search_data().
436437
`earthaccess` will use the metadata from CMR to obtain the S3 Endpoint.
438+
endpoint: URL of a cloud provider credentials endpoint to be used for obtaining
439+
AWS S3 access credentials.
437440
438441
Returns:
439442
An authenticated s3fs session valid for 1 hour.
440443
"""
441444
daac = _normalize_location(daac)
442445
provider = _normalize_location(provider)
443-
if results is not None:
446+
if results:
444447
endpoint = results[0].get_s3_credentials_endpoint()
445-
if endpoint is not None:
448+
if endpoint:
446449
session = earthaccess.__store__.get_s3_filesystem(endpoint=endpoint)
447-
return session
448-
session = earthaccess.__store__.get_s3_filesystem(daac=daac, provider=provider)
450+
else:
451+
raise ValueError("No s3 credentials specified in the given DataGranule")
452+
elif endpoint:
453+
session = earthaccess.__store__.get_s3_filesystem(endpoint=endpoint)
454+
elif daac or provider:
455+
session = earthaccess.__store__.get_s3_filesystem(daac=daac, provider=provider)
456+
else:
457+
raise ValueError(
458+
"Invalid set of input arguments given. Please provide either "
459+
"a valid result, an endpoint, a daac, or a provider."
460+
)
449461
return session
450462

451463

0 commit comments

Comments
 (0)