From 6ce560ac6f6962c59840ecaa279898098db96036 Mon Sep 17 00:00:00 2001 From: Rehan Khwaja Date: Fri, 6 Sep 2024 19:19:54 -0700 Subject: [PATCH] Switch from poetry to uv --- .github/workflows/ci.yml | 13 ++++---- .gitignore | 2 +- pyproject.toml | 69 +++++++++++++++++++++------------------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa6530..40629af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ name: ci on: push: branches: - - master + - main pull_request: branches: - '*' @@ -48,15 +48,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install poetry - uses: abatilo/actions-poetry@v3 + - name: Install uv + uses: yezz123/setup-uv@v4 - name: Dependencies run: | - poetry config virtualenvs.create false - poetry install + uv sync --no-cache - name: Lint run: | - poe lint + uv run poe lint - name: Tests env: GOOGLEDRIVEFS_TEST_CLIENT_ID: ${{ secrets.GOOGLEDRIVEFS_TEST_CLIENT_ID }} @@ -66,7 +65,7 @@ jobs: if: ${{needs.secrets.outputs.valid}} == 'true' run: | if python --version | grep -q 'Python 3.12' ; then - poe test + uv run poe test fi - name: Coverage uses: codecov/codecov-action@v4 diff --git a/.gitignore b/.gitignore index 4ab08c7..26e9a3f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ __pycache__/ # Distribution / packaging dist/ -poetry.lock +uv.lock .venv *.egg-info pip-wheel-metadata diff --git a/pyproject.toml b/pyproject.toml index cb34664..c8b7710 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,10 @@ -[tool.poetry] +[project] name = "fs.googledrivefs" -packages = [ - { include = "fs"} -] version = "2.4.3" description = "Pyfilesystem2 implementation for Google Drive" -authors = ["Rehan Khwaja "] -license = "MIT" -homepage = "https://github.com/rkhwaja/fs.googledrivefs" +maintainers = [ + { name = "Rehan Khwaja", email = "rehan@khwaja.name" } +] keywords = ["filesystem", "Pyfilesystem2", "google"] readme = "README.md" classifiers = [ @@ -18,27 +15,27 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12" + "Programming Language :: Python :: 3.12", +] +requires-python = ">=3.8" +dependencies = [ + "fs>=2.4.13", + "google-api-python-client>=1.7.10", + "google-auth>=1.5.1", ] -[tool.poetry.dependencies] -python = ">=3.8" -fs = ">=2.4.13" -google-api-python-client = ">=1.7.10" -google-auth = ">=1.5.1" +[project.urls] +Homepage = "https://github.com/rkhwaja/fs.googledrivefs" + +[project.entry-points."fs.opener"] +"googledrive" = "fs.googledrivefs.opener:GoogleDriveFSOpener" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.poetry.dev-dependencies] -pytest = ">=7.2.0" -pytest-timeout = ">=1.3.3" -requests-oauthlib = ">=1.0" -pyperclip = ">=1.7" -pytest-cov = ">=2.10.1" -poethepoet = ">=0.16.4" -pyngrok = ">=7" -pytest-localserver = ">=0.5.0" -pytest-xdist = ">=3.2.1" -ruff = ">=0.5.5" -pytest-rerunfailures = ">=14.0" +[tool.hatch.build.targets.wheel] +packages = ["fs"] [tool.poe.tasks] lint = "ruff check fs/googledrivefs/ tests/" @@ -49,11 +46,6 @@ pytest -n 4 --reruns 2 --only-rerun TimeoutError --cov=fs/googledrivefs --timeou coverage xml """ -[tool.poetry.plugins] # Optional super table - -[tool.poetry.plugins."fs.opener"] -"googledrive" = "fs.googledrivefs.opener:GoogleDriveFSOpener" - [tool.ruff] line-length = 200 lint.ignore = ["ANN", "D", "DTZ", "EM102", "ERA001", "FBT002", "FIX", "G004", "I", "N", "PT009", "PT027", "PT013", "PTH", "S101", "TCH003", "TD", "TRY003", "W191"] @@ -68,6 +60,17 @@ target-version = "py38" inline-quotes = "single" multiline-quotes = "single" -[build-system] -requires = ["poetry_core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +[tool.uv] +dev-dependencies = [ + "poethepoet>=0.16.4", + "pyngrok>=7", + "pyperclip>=1.7", + "pytest-cov>=2.10.1", + "pytest-localserver>=0.5.0", + "pytest-rerunfailures>=14.0", + "pytest-timeout>=1.3.3", + "pytest-xdist>=3.2.1", + "pytest>=7.2.0", + "requests-oauthlib>=1.0", + "ruff>=0.5.5", +]