From b31cbfb42baa49ffecafe6f276877d5aa5ef3ff9 Mon Sep 17 00:00:00 2001 From: Naoki Numaguchi Date: Wed, 14 May 2025 10:01:03 +0900 Subject: [PATCH 1/5] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20add=20gha=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/python-ci.yml diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 0000000..1e9c530 --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,31 @@ +name: Python CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Set up uv + uses: astral-sh/setup-uv@v1 + + - name: Install dependencies + run: uv pip install .[dev] + + - name: Run ruff format check + run: ruff format --check . + + - name: Run pytest + run: pytest From 819e63f280589b968a080a4ea618c9a785af677d Mon Sep 17 00:00:00 2001 From: Naoki Numaguchi Date: Wed, 14 May 2025 23:52:59 +0900 Subject: [PATCH 2/5] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20add=20venv=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-ci.yml | 5 ++++- pyproject.toml | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 1e9c530..5d002f5 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -16,11 +16,14 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.13" - name: Set up uv uses: astral-sh/setup-uv@v1 + - name: Create virtual environment + run: uv venv -p 3.13 + - name: Install dependencies run: uv pip install .[dev] diff --git a/pyproject.toml b/pyproject.toml index 2fb37e8..0dde85a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ ] requires-python = ">=3.11" readme = "README.md" -license = {text = "MIT"} +license = "MIT" [project.optional-dependencies] dev = [ @@ -43,3 +43,7 @@ pythonpath = [ markers = [ "integration: mark test as integration test (requires network and .env)", ] + +[tool.setuptools] +packages = ["esa_client"] +py_modules = ["main"] From 9d4f7d6bff3adac466b54f6c1ee291796c970100 Mon Sep 17 00:00:00 2001 From: Naoki Numaguchi Date: Thu, 15 May 2025 06:37:51 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20update=20ci=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-ci.yml | 20 ++++++++++---------- pyproject.toml | 7 ++----- uv.lock | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 5d002f5..90ccbd7 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -18,17 +18,17 @@ jobs: with: python-version: "3.13" - - name: Set up uv - uses: astral-sh/setup-uv@v1 - - - name: Create virtual environment - run: uv venv -p 3.13 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: "0.7.3" + cache: true - name: Install dependencies - run: uv pip install .[dev] - - - name: Run ruff format check - run: ruff format --check . + run: uv sync --frozen --all-extras --dev - name: Run pytest - run: pytest + run: uv run pytest -v + + - name: Run ruff format check + run: uv run ruff format --check . \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0dde85a..3363830 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ ] requires-python = ">=3.11" readme = "README.md" -license = "MIT" +license = {text = "MIT"} [project.optional-dependencies] dev = [ @@ -34,6 +34,7 @@ dev-dependencies = [ "pytest", "ruff", "python-dotenv", + "uv>=0.7.3", ] [tool.pytest.ini_options] @@ -43,7 +44,3 @@ pythonpath = [ markers = [ "integration: mark test as integration test (requires network and .env)", ] - -[tool.setuptools] -packages = ["esa_client"] -py_modules = ["main"] diff --git a/uv.lock b/uv.lock index 27f2167..e4ff4c6 100644 --- a/uv.lock +++ b/uv.lock @@ -227,6 +227,7 @@ dev = [ { name = "pytest" }, { name = "python-dotenv" }, { name = "ruff" }, + { name = "uv" }, ] [package.metadata] @@ -245,6 +246,7 @@ dev = [ { name = "pytest" }, { name = "python-dotenv" }, { name = "ruff" }, + { name = "uv", specifier = ">=0.7.3" }, ] [[package]] @@ -563,6 +565,31 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680 }, ] +[[package]] +name = "uv" +version = "0.7.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/77/9e/4ea6d224f868badecd48b8fed17f83adb0ff62f75bc21785d91dee75c744/uv-0.7.3.tar.gz", hash = "sha256:863ceb63aefc7c2db9918313a1cb3c8bf3fc3d59b656b617db9e4abad90373f3", size = 3242256 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/8b/09a9d9da09d90ec6829dc4b3e9b7ff99222b7f05bc5d292bc30b04b92209/uv-0.7.3-py3-none-linux_armv6l.whl", hash = "sha256:f37c8a6b172776fb5305afe0699907aff44a778669de7a8fbe5a9c09c1a88a97", size = 16673361 }, + { url = "https://files.pythonhosted.org/packages/ba/de/794ea8c9729784c7626f05a98fe91b8367587f57f023cb95adcd8f8a9215/uv-0.7.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3e6e1fd5755d4ef4c6e1ce55bd2c6d9dec278a8bef5752703d702ce03704fe29", size = 16755964 }, + { url = "https://files.pythonhosted.org/packages/df/1b/50922bfbe1631d022e0c6434ade17158b9b4e0bb7fccc77c928e32dd9021/uv-0.7.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:db8a5d5995b160158405379deadf0ffccf849a5e7ce048900b73517daf109e2c", size = 15577471 }, + { url = "https://files.pythonhosted.org/packages/69/39/cba47262d9547695657885391b34e8732cb0c34b5b876b811851cd320f3a/uv-0.7.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:d246243f348796730e8ea9736ddd48702d4448d98af5e61693063ed616e30378", size = 16027456 }, + { url = "https://files.pythonhosted.org/packages/e6/33/1acf89318fb987a6eb9989a6991b76b6c930b6a724ce5f1ed848519d6a5f/uv-0.7.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:acef117a0c52299e60c6f7a3e60849050cd233704c561f688fac1100d113da2e", size = 16390903 }, + { url = "https://files.pythonhosted.org/packages/ad/66/2fe8ec6e5390de4cfc6db312464b4f28e5b3d98d576adc42731c0aeb5073/uv-0.7.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:90990e4c289feee24164c8e463fc0ebc9a336960119cd256acca7c1439f0f536", size = 17167937 }, + { url = "https://files.pythonhosted.org/packages/a5/8a/dc46e79f5fd068cb841a716a96f0344af62cf2deb2e78f57e0e147de26ac/uv-0.7.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4809e5f7f5b2d6423d6573fda5655389c955ca649499fe9750b61af95daf9b7d", size = 18077868 }, + { url = "https://files.pythonhosted.org/packages/da/af/f7165a205ce8bb5e00f197d86a6fce4b4a317db0e471a31db9137ca1cc2d/uv-0.7.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:acff7fba5ff40dcb5a42de496db92a3965edac7a3d687d9b013ba6e0336995df", size = 17793072 }, + { url = "https://files.pythonhosted.org/packages/27/5e/2e9172ec3fa8acfa69642900d6eee8e5021f6c14d135edef524c674b4cfb/uv-0.7.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbb2d322d453e498e1431c51421cee597962ecd3f93fcef853b258e9c7e7636c", size = 22181943 }, + { url = "https://files.pythonhosted.org/packages/f1/b1/8af4ea6d09d05b9edead5e701dd91e04d55971483a7a644bab7a979bb46b/uv-0.7.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1414a026c153ae0731daed0812b17bf77d34eafedaeb3a5c72e08181aea116b", size = 17400777 }, + { url = "https://files.pythonhosted.org/packages/09/ae/ccd123274ae59707e84fc5542776f89887818bad915167fbaeda65ebf52a/uv-0.7.3-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:c976fce3d1068a1d007f50127cc7873d67643c1a60439564970f092d9be41877", size = 16306132 }, + { url = "https://files.pythonhosted.org/packages/01/5c/99ef96ca53c74552b616bd341cd5d298bc8a603151343c409efeaf1552a0/uv-0.7.3-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:cc27207c35c959d2e0e873e86a80a2470a77b7a34a4512a831e8d4f7c87f4404", size = 16376728 }, + { url = "https://files.pythonhosted.org/packages/74/91/07f7e68f08e617d27ae9908a4e8deb756368b942319634956ed92d7cf35c/uv-0.7.3-py3-none-musllinux_1_1_i686.whl", hash = "sha256:5eb4872888a9fb10b62cc00be8e84822d63d3e622a5f340248e53ecf321dba96", size = 16707670 }, + { url = "https://files.pythonhosted.org/packages/a9/73/385a5a55fccfebac84a88b629992e301c080640691f2e27a3e3ccee8315e/uv-0.7.3-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:0646e463365e7277f22200ce2d43b7a44e5a3192320500b4983b4fe34d69a5fb", size = 17514613 }, + { url = "https://files.pythonhosted.org/packages/6a/97/1138bb26038805a14d930c7261faf363a5256757390b4be0aaf6e33a41c0/uv-0.7.3-py3-none-win32.whl", hash = "sha256:44e2f3fcbd1ab519bdb68986449b2e3103d2261be95f985cadcf7ec7c510b595", size = 16897117 }, + { url = "https://files.pythonhosted.org/packages/64/1b/c9f0ad7c75bf0a04c52c7e766593f5e79b1ac7d97fa1cb34c6ce0cfe3746/uv-0.7.3-py3-none-win_amd64.whl", hash = "sha256:0a446d4e5b10ce8a793156a276727bb7affa96a85e80dc5ad34e0c2de7e71cc8", size = 18323992 }, + { url = "https://files.pythonhosted.org/packages/47/1b/7ca1b8ec4bcf1c807f61e6ced7ca704791843cf1297db5edb54db07bd1db/uv-0.7.3-py3-none-win_arm64.whl", hash = "sha256:cb2547fd1466698e9b4f11de5eef7055b8cbcc3c693d79f6d747e3f8e6be2ab7", size = 17017988 }, +] + [[package]] name = "uvicorn" version = "0.34.2" From 97dc405c494129c47c4f5e60e2b4d9c234425c6f Mon Sep 17 00:00:00 2001 From: Naoki Numaguchi Date: Thu, 15 May 2025 06:43:45 +0900 Subject: [PATCH 4/5] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20skip=20integration=20t?= =?UTF-8?q?est?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/python-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 90ccbd7..7097da4 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -22,13 +22,14 @@ jobs: uses: astral-sh/setup-uv@v5 with: version: "0.7.3" - cache: true + enable-cache: true - name: Install dependencies run: uv sync --frozen --all-extras --dev - name: Run pytest - run: uv run pytest -v + # Skip real API validation tests + run: uv run pytest -v -m "not integration" - name: Run ruff format check - run: uv run ruff format --check . \ No newline at end of file + run: uv run ruff format --check . From e2a1dc201529d99f84cef0e5da7ada89133f61a8 Mon Sep 17 00:00:00 2001 From: Naoki Numaguchi Date: Thu, 15 May 2025 06:46:51 +0900 Subject: [PATCH 5/5] =?UTF-8?q?style:=20=F0=9F=92=84=20apply=20uv=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_main_tools.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_main_tools.py b/tests/test_main_tools.py index 991a6fc..0353608 100644 --- a/tests/test_main_tools.py +++ b/tests/test_main_tools.py @@ -268,9 +268,7 @@ def test_posts_update_success(mock_esa_client_in_main): # Assert assert result == expected_response_from_tool - mock_esa_client_in_main.update_post.assert_called_once_with( - post_number=post_number, payload=filtered_payload - ) + mock_esa_client_in_main.update_post.assert_called_once_with(post_number=post_number, payload=filtered_payload) def test_posts_update_success_partial_params(mock_esa_client_in_main): @@ -293,9 +291,7 @@ def test_posts_update_success_partial_params(mock_esa_client_in_main): # Assert assert result == expected_response_from_tool - mock_esa_client_in_main.update_post.assert_called_once_with( - post_number=post_number, payload=filtered_payload - ) + mock_esa_client_in_main.update_post.assert_called_once_with(post_number=post_number, payload=filtered_payload) def test_posts_update_no_params_provided(mock_esa_client_in_main, caplog):