diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f647bb96..efe4bba3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,22 +15,13 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 - - name: Install Poetry - run: pip install poetry - - - name: Cache dependencies - uses: actions/cache@v4 - env: - cache-name: cache-dependencies + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - path: ~/.cache/pypoetry - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- + enable-cache: true - name: Install dependencies - run: poetry install + run: uv sync - name: Register problem matcher run: echo "::add-matcher::.github/workflows/matchers/ruff.json" @@ -39,7 +30,7 @@ jobs: run: rm .gitignore - name: Run ruff format - run: poetry run ruff format --check googleapiclient-stubs apiclient-stubs + run: uv run ruff format --check googleapiclient-stubs apiclient-stubs ruff-check: runs-on: ubuntu-latest @@ -49,28 +40,19 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 - - name: Install Poetry - run: pip install poetry - - - name: Cache dependencies - uses: actions/cache@v4 - env: - cache-name: cache-dependencies + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - path: ~/.cache/pypoetry - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('poetry.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- + enable-cache: true - name: Install dependencies - run: poetry install + run: uv sync - name: Delete .gitignore (https://github.com/astral-sh/ruff/issues/8753) run: rm .gitignore - name: Run ruff check - run: poetry run ruff check --output-format github googleapiclient-stubs apiclient-stubs + run: uv run ruff check --output-format github googleapiclient-stubs apiclient-stubs mypy: runs-on: ubuntu-latest @@ -80,26 +62,17 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 - - name: Install Poetry - run: pip install poetry - - - name: Cache dependencies - uses: actions/cache@v4 - env: - cache-name: cache-dependencies + - name: Install uv + uses: astral-sh/setup-uv@v2 with: - path: ~/.cache/pypoetry - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- + enable-cache: true - name: Install dependencies - run: poetry install + run: uv sync - name: Register problem matchers run: echo "::add-matcher::.github/workflows/matchers/mypy.json" - name: Run Mypy run: | - poetry run mypy googleapiclient-stubs apiclient-stubs + uv run mypy googleapiclient-stubs apiclient-stubs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5773ca7c..da8217a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,13 +10,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + # - name: Set up Python + # uses: actions/setup-python@v5 - - name: Install Poetry - run: pip install poetry + - name: Install uv + uses: astral-sh/setup-uv@v2 + + - name: Build + run: uv build - - name: Build and publish - run: poetry publish --build --username __token__ --password "$PYPI_TOKEN" - env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - name: Publish + run: uv publish diff --git a/pyproject.toml b/pyproject.toml index 0842ca5b..35eab27c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,29 +1,29 @@ -[tool.poetry] +[project] name = "google-api-python-client-stubs" version = "1.27.0" description = "Type stubs for google-api-python-client" -authors = ["Henrik Bruådal <henrik.bruasdal@gmail.com>"] +authors = [ + { name = "Henrik Bruådal", email = "henrik.bruasdal@gmail.com" }, +] readme = "README.md" license = "Apache-2.0" repository = "https://github.com/henribru/google-api-python-client-stubs" -packages = [ - { include = "googleapiclient-stubs" }, - { include = "apiclient-stubs" }, -] classifiers = [ "Typing :: Stubs Only", ] +dependencies = [ + "google-api-python-client>=2.141.0", + "types-httplib2>=0.22.0.2", + "typing-extensions>=3.10.0", +] +requires-python = ">=3.7" -[tool.poetry.dependencies] -python = "^3.7" -google-api-python-client = ">=2.141.0" -typing-extensions = ">=3.10.0" -types-httplib2 = ">=0.22.0.2" - -[tool.poetry.group.dev.dependencies] -mypy = {version = "^1.9.0", python = "^3.8"} -stubdefaulter = "^0.1.0" -ruff = "^0.3.3" +[tool.uv] +dev-dependencies = [ + "mypy>=1.11.2 ; python_full_version >= '3.8'", + "ruff>=0.6.8", + "stubdefaulter>=0.1.0", +] [tool.ruff.lint] select = ["UP", "I"] @@ -38,6 +38,9 @@ known-first-party = [ [tool.mypy] warn_unused_ignores = true +[tool.hatch.build.targets.wheel] +packages = ["googleapiclient-stubs", "apiclient-stubs"] + [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build"