Skip to content

Commit

Permalink
chore: Use uv (#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Feb 4, 2025
1 parent dd5a1cb commit b64acf3
Show file tree
Hide file tree
Showing 7 changed files with 399 additions and 490 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ jobs:
with:
python-version: "3.10"

- name: Install Poetry
run: |
pip install --upgrade pip poetry
pip --version
poetry --version
- uses: astral-sh/setup-uv@v5.2.2
with:
version: ~=0.5.27

- name: Install dependencies
run: |
poetry install
uv sync
- name: Set preview variables
if: github.event_name == 'pull_request'
Expand All @@ -59,14 +57,14 @@ jobs:
env:
API_URL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.api-url || secrets.HUB_API_URL }}
run: >
poetry run python utility_scripts/api/make_files.py
uv run python utility_scripts/api/make_files.py
-o _hub_api
--hub-url ${{ env.HUB_URL }}
--api-url ${{ env.API_URL }}
- name: Test API Schema
run: >
poetry run python utility_scripts/api/api_schema_validate.py
uv run python utility_scripts/api/api_schema_validate.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/plugin_definition_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,18 @@ jobs:
python-version: 3.9
architecture: x64

- name: Upgrade pip
run: |
pip install pip poetry
pip --version
poetry --version
- name: Poetry install
run: |
poetry install
- uses: astral-sh/setup-uv@v5.2.2
with:
version: ~=0.5.27

- name: Plugin definition schema validation
run: |
poetry run python utility_scripts/plugin_definitions/plugin_schema_validate.py
uv run python utility_scripts/plugin_definitions/plugin_schema_validate.py
- name: Validate plugin names
run: |
poetry run python utility_scripts/plugin_definitions/yaml_check_names.py
uv run python utility_scripts/plugin_definitions/yaml_check_names.py
- name: Validate maintainers
run: |
poetry run python utility_scripts/plugin_definitions/maintainers_validate.py
uv run python utility_scripts/plugin_definitions/maintainers_validate.py
14 changes: 4 additions & 10 deletions .github/workflows/validate-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ jobs:
python-version: 3.9
architecture: x64

- name: Upgrade pip
run: |
pip install pip poetry
pip --version
poetry --version
- name: Poetry install
run: |
poetry install
- uses: astral-sh/setup-uv@v5.2.2
with:
version: ~=0.5.27

- name: Get invalid URLs
id: urls
run: |
output=$(poetry run python utility_scripts/plugin_definitions/check_links.py)
output=$(uv run python utility_scripts/plugin_definitions/check_links.py)
echo "INVALID_URL<<EOF" >> $GITHUB_ENV
echo "$output" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
440 changes: 0 additions & 440 deletions poetry.lock

This file was deleted.

30 changes: 15 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[tool.poetry]
package-mode = false
[project]
name = "meltano-hub"
version = "0.0.1"
description = "Meltano hub contains the definition of all meltano taps, targets, utilities, etc."
authors = ["Meltano Team"]
authors = [{ name = "Meltano Team" }]
requires-python = ">=3.9"
dependencies = [
"jsonschema>=4.17.3,<4.18",
"ruamel.yaml>=0.18.6",
"yamllint>=1.35.1",
"requests>=2.32.3",
]

[tool.poetry.dependencies]
python = ">=3.9"
jsonschema = ">=4.17.3,<4.18"
"ruamel.yaml" = ">=0.18.6"
yamllint = ">=1.35.1"
requests = ">=2.32.3"
[dependency-groups]
dev = ["ruff>=0.9"]

[tool.poetry.group.dev.dependencies]
ruff = ">=0.9"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.uv]
package = false
8 changes: 3 additions & 5 deletions utility_scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ This script generates the JSON files for the Meltano Hub API.

#### Usage

After activating the Poetry environment, run the following command:

```bash
HUB_URL='https://hub.meltano.com' \
API_URL='https://ty9g0lccp8.execute-api.us-west-2.amazonaws.com/dev' \
python utility_scripts/api/make_files.py -o _hub_api --hub-url $HUB_URL --api-url $API_URL
export HUB_URL='https://hub.meltano.com'
export API_URL='https://ty9g0lccp8.execute-api.us-west-2.amazonaws.com/dev'
uv run python utility_scripts/api/make_files.py -o _hub_api --hub-url $HUB_URL --api-url $API_URL
```

To sync the files with the target S3 bucket, run the following command:
Expand Down
Loading

0 comments on commit b64acf3

Please sign in to comment.