Skip to content

Commit 06adf64

Browse files
Imanimanshafiei540
Iman
authored andcommitted
Local PoC sync via Copybara - 275a4ec9d6f6dc2ede041fa6f0afa6591426f3b6 Fix formatting of docstring in generate_token.py and upda... by Iman Shafiei <[email protected]>
- 083edc6eba06d8c5c9bbae5e720b6dfb1c2269d3 Update permissions and clean up workflow steps for CodeAr... by Iman Shafiei <[email protected]> - ad1ce501dadf4aa0bfb48c14c06aaea9f10a07fe Add GitHub Actions workflow for publishing to AWS CodeArt... by Iman Shafiei <[email protected]> - 22f380c1b7cd594a93d0a355a39d9c92d80ffa27 Refactor internal service initialization and add error ha... by Iman Shafiei <[email protected]> - 6d6a64deb92793a5ecc52a7bb6bc305cc47d80c3 Refactor job runner selection for private and public repo... by Iman Shafiei <[email protected]> - 082fa1a4f29cb050ee4ea53c88c06075cad3f26a Fix runner selection logic for lint job based on reposito... by Iman Shafiei <[email protected]> - 5be4aaa4d335f5892ec6a0e8af923f5b4e875590 Add pull_request trigger to workflows for better CI integ... by Iman Shafiei <[email protected]> - 6522b429410df79b2c6acf02fc842dbc4f8f2427 Fix virtualenv activation command in Copybara sync workflow by Iman Shafiei <[email protected]> - 1822e48ca9b79a2f57a73d16e4554e5c87f99d89 Refactor secret scanning workflow to clone repository man... by Iman Shafiei <[email protected]> - 73a6795b16bcf2f74c0269a1577cdce695e00747 Refactor secret scanning workflow to use Alpine image and... by Iman Shafiei <[email protected]> - 3b0e46719f0810c291cb8e336314d52bd2847879 Add step to install jq in secret scanning workflow by Iman Shafiei <[email protected]> - bd142eae532db672b6e061ed3d97a55f3c886129 Add configuration for Git safe directory in secret scanni... by Iman Shafiei <[email protected]> - ab8515a7030c0fb9aea7eb0b34ef4a168ddfe9d9 Add configuration for Git safe directory in secret scanni... by Iman Shafiei <[email protected]> - 4cc3959122cc10b7d01529813e654e1a9fa1a575 Refactor secret scanning workflow to use TruffleHog Docke... by Iman Shafiei <[email protected]> - feaa54f1ce823560a2f8ce7c611dc99b107b35fb Update secret scanning workflow to install additional dep... by Iman Shafiei <[email protected]> - d770a696c4a6c94f9935ab947bc35d73caa19a3d Update secret scanning workflow to use Docker stable imag... by Iman Shafiei <[email protected]> - 30c5bdc77bba8a0395941f20275ad5abeb71293d Update secret scanning workflow to install additional dep... by Iman Shafiei <[email protected]> - e38fab2d223599461f7deb7a247d6b4ae590d228 Add configuration for Git safe directory in secret scanni... by Iman Shafiei <[email protected]> - c1f13aaeb118143d22d54268c9a363941323a4a9 Add git installation step to secret scanning workflow by Iman Shafiei <[email protected]> - c20fcc1b8adea1cc67ff7bc6691ad7a80c864250 Add container configuration with Ubuntu image to CI workf... by Iman Shafiei <[email protected]> - 2c0b4062c69e6bd71beca6632670b0f77d05611e format with ruff 0.11.0 by Iman Shafiei <[email protected]> - b5efc402a65bdac855632248c4fddf23ca16d4ca Refactor CI test jobs to use a matrix strategy for Python... by Iman Shafiei <[email protected]> - 3485721d1cb2b8d3eb57e9b962125e5cc1abef1a Refactor linting workflow to consolidate Python version h... by Iman Shafiei <[email protected]> - 88fa81508552f3658534fb96850a80b6ded31b92 Add CI workflows for linting and testing with Python vers... by Iman Shafiei <[email protected]> - ba318c0b5667f9585ec50045f3ea5f9254f8f0a9 Update CI workflows to use ed-runner-set for consistency ... by Iman Shafiei <[email protected]> - 5effcd5b81839d7f68783d2a1ce65144cfa8e5b8 Update CI workflows and BulkInsert/BulkSearch services fo... by Iman Shafiei <[email protected]> - ea78f2c91cb69f3b55d8125a7b17b5f157b4bfa7 Add InternalService and bulk operations support to EDSCli... by Iman Shafiei <[email protected]> - bfe7972f2b1df36143c609736e5ff952ff149403 Comment out CodeQL workflow configuration in codeql.yml by Iman Shafiei <[email protected]> - 0e46cd33ede3f3f1a8b8ad059a64069cf1ab6aa4 Beta/add pyjwt dependency and implement GitHub token gene... by Iman Shafiei <[email protected]> - a9174ac2cf3c1455019f98efba2dfb355980ede8 Merge remote-tracking branch 'public-repo/beta/1.x' by Iman Shafiei <[email protected]> - dbdaa9c820ec7245f5964ead6ce985803157e92a Initial commit by edawader <[email protected]> GitOrigin-RevId: 275a4ec9d6f6dc2ede041fa6f0afa6591426f3b6
1 parent 4721d15 commit 06adf64

10 files changed

+212
-88
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ on:
66
- main
77
- beta/*
88
pull_request:
9-
branches:
10-
- main
11-
- beta/*
9+
workflow_dispatch:
1210
schedule:
1311
- cron: '31 17 * * 5'
1412

1513
jobs:
1614
analyze:
15+
if: ${{ !github.event.repository.private }} # Only run on public repos
16+
1717
name: Analyze (${{ matrix.language }})
1818
runs-on: 'ubuntu-latest'
1919
permissions:

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint, Format and Type Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta/*
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
lint:
13+
runs-on: ${{ github.repository_visibility == 'private' && 'ed-runner-set' || 'ubuntu-latest' }}
14+
strategy:
15+
matrix:
16+
python-version: ["3.10", "3.11", "3.12", "3.13"]
17+
container:
18+
image: python:${{ matrix.python-version }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install system dependencies
24+
run: |
25+
apt-get update
26+
apt-get install -y gdal-bin libgdal-dev
27+
28+
- name: Install Poetry
29+
run: pip install poetry
30+
31+
- name: Install test dependencies
32+
run: poetry install --only tests
33+
34+
- name: Run Linting
35+
run: poetry run tox -e lint
36+
37+
- name: Run Formatting Check
38+
run: poetry run tox -e format

.github/workflows/publish_pypi_on_tag.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ on:
77

88
jobs:
99
pypi-publish:
10+
if: ${{ !github.event.repository.private }} # Only run on public repos
11+
1012
name: Upload release to PyPI
1113
runs-on: ubuntu-latest
14+
container:
15+
image: ubuntu:latest
1216
environment:
1317
name: pypi
1418
url: https://pypi.org/p/earthdaily
@@ -19,7 +23,7 @@ jobs:
1923
- uses: actions/checkout@v4
2024
- uses: actions/setup-python@v5
2125
with:
22-
python-version: "3.12"
26+
python-version: "3.13"
2327

2428
- name: Install Poetry
2529
run: pip install poetry
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to CodeArtifact
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish-to-codeartifact:
10+
name: Upload to AWS CodeArtifact
11+
runs-on: [ed-runner-set]
12+
container:
13+
image: python:3.13-slim
14+
15+
environment:
16+
name: codeartifact
17+
18+
permissions:
19+
id-token: write
20+
contents: read
21+
22+
steps:
23+
- name: Install system dependencies
24+
run: |
25+
apt-get update
26+
apt-get install -y curl unzip gnupg awscli build-essential
27+
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Install Poetry
32+
run: pip install poetry
33+
34+
- name: Clean old dist
35+
run: rm -rf dist/
36+
37+
- name: Build package with Poetry
38+
run: poetry build
39+
40+
- name: Login to CodeArtifact
41+
run: |
42+
aws codeartifact login \
43+
--tool twine \
44+
--repository pypi \
45+
--domain ${{ secrets.CODE_ARTIFACT_DOMAIN }} \
46+
--domain-owner ${{ secrets.CODE_ARTIFACT_ACCOUNT_ID }} \
47+
--region us-east-1
48+
49+
- name: Publish to CodeArtifact with Poetry
50+
run: poetry publish -r codeartifact --no-interaction

.github/workflows/secret-scanning.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
name: "Secret Scanning"
1+
name: Secret Scanning
22

33
on:
44
push:
55
branches:
66
- main
77
- beta/*
88
pull_request:
9-
branches:
10-
- main
11-
- beta/*
129
workflow_dispatch:
1310

1411
jobs:
15-
secret-scan:
16-
name: Scan for Secrets
17-
runs-on: ubuntu-latest
18-
permissions:
19-
contents: read
20-
security-events: write
12+
security-secrets:
13+
name: TruffleHog Secret Scan
14+
runs-on: ${{ github.repository_visibility == 'private' && 'ed-runner-set' || 'ubuntu-latest' }}
15+
container:
16+
image: alpine:latest
2117
steps:
22-
- name: Checkout code
23-
uses: actions/checkout@v4
18+
- name: Install Git and dependencies
19+
run: |
20+
apk add --no-cache git curl jq
21+
22+
- name: Clone the repository manually
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
run: |
26+
git clone https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git repo
27+
cd repo
28+
29+
# install TruffleHog
30+
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin
2431
25-
- name: Run TruffleHog OSS
26-
uses: trufflesecurity/trufflehog@v3.88.17
32+
# run TruffleHog scan
33+
trufflehog filesystem "." --results=verified,unknown --fail --json | jq

.github/workflows/test.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: earthdaily-python-client CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta/*
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
name: Unit Tests (Python ${{ matrix.python-version }})
14+
runs-on: ${{ github.repository_visibility == 'private' && 'ed-runner-set' || 'ubuntu-latest' }}
15+
strategy:
16+
matrix:
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
18+
include:
19+
- python-version: "3.10"
20+
tox_env: py310
21+
- python-version: "3.11"
22+
tox_env: py311
23+
- python-version: "3.12"
24+
tox_env: py312
25+
- python-version: "3.13"
26+
tox_env: py313
27+
container:
28+
image: python:${{ matrix.python-version }}
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Install GDAL and dependencies
34+
run: |
35+
apt-get update
36+
apt-get install -y gdal-bin libgdal-dev
37+
38+
- name: Install Poetry
39+
run: pip install poetry
40+
41+
- name: Install test dependencies
42+
run: poetry install --only tests
43+
44+
- name: Run tests with tox
45+
run: poetry run tox -e ${{ matrix.tox_env }}

earthdaily/_eds_client.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
from earthdaily.legacy import EarthDataStore
55
from earthdaily.platform import PlatformService
66

7+
try:
8+
from earthdaily.internal import InternalService
9+
10+
_HAS_INTERNAL = True
11+
except ImportError:
12+
_HAS_INTERNAL = False
13+
714

815
class EDSClient:
916
"""
@@ -78,3 +85,23 @@ def legacy(self):
7885
if not hasattr(self, "_legacy_service"):
7986
self._legacy_service = EarthDataStore(self.api_requester)
8087
return self._legacy_service
88+
89+
@property
90+
def internal(self):
91+
"""
92+
Lazily initializes and returns the InternalService for interacting with internal API endpoints.
93+
94+
Returns:
95+
-------
96+
InternalService:
97+
The service that interacts with internal API operations.
98+
Raises:
99+
-------
100+
NotImplementedError:
101+
If the internal module is not available in this build of EDSClient.
102+
"""
103+
if not _HAS_INTERNAL:
104+
raise NotImplementedError("The 'internal' module is not available in this build of EDSClient.")
105+
if not hasattr(self, "_internal_service"):
106+
self._internal_service = InternalService(self.api_requester)
107+
return self._internal_service

poetry.lock

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ sphinx-copybutton = "^0.5.2"
5656
sphinx-automodapi = "^0.18.0"
5757
sphinx-multiversion = "^0.2.4"
5858

59+
60+
[tool.poetry.group.dev.dependencies]
61+
pyjwt = "^2.10.1"
62+
5963
[build-system]
6064
requires = ["poetry-core"]
6165
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)