diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a8c83bee..12be8438f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,6 @@ jobs: env: REPO: ${{ github.event.pull_request.head.repo.full_name }} BRANCH: ${{ github.event.pull_request.head.ref }} - SKIP_POETRY_SHELL: 1 steps: - name: Checkout code @@ -38,29 +37,22 @@ jobs: if: matrix.os == 'macos-latest' run: sh install/install_openadapt.sh - - name: Install poetry - uses: snok/install-poetry@v1 - with: - version: 1.5.1 - virtualenvs-create: true - virtualenvs-in-project: true + - name: Install uv + run: pip install uv - name: Cache deps id: cache-deps uses: actions/cache@v2 with: path: .venv - key: pydeps-${{ hashFiles('**/poetry.lock') }} + key: pydeps-${{ hashFiles('**/pyproject.toml') }} - - run: poetry install --no-interaction --no-root + - name: Create virtual environment if: steps.cache-deps.outputs.cache-hit != 'true' - - - name: Activate virtualenv - run: source .venv/bin/activate - if: steps.cache-deps.outputs.cache-hit == 'true' + run: uv venv - name: Check formatting with Black - run: poetry run black --preview --check . --exclude '/(alembic|\.cache|\.venv|venv|contrib|__pycache__)/' + run: uv run black --preview --check . --exclude '/(alembic|\.cache|\.uv|venv|contrib|__pycache__)/' - name: Run Flake8 - run: poetry run flake8 --exclude=alembic,.venv,venv,contrib,.cache,.git + run: uv run flake8 --exclude=alembic,.venv,venv,contrib,.cache,.git diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index 51a77ab1d..836077354 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -39,14 +39,13 @@ jobs: python-version: '3.10' - name: Install dependencies run: | - pip install poetry - poetry install + pip install uv brew install nvm - poetry run postinstall + uv run python scripts/postinstall brew install python-tk@3.10 - name: Build MacOS executable run: | - poetry run python -m openadapt.build + uv run python -m openadapt.build cd dist zip -r ../OpenAdapt.app.zip OpenAdapt.app mv OpenAdapt.dmg .. @@ -82,16 +81,15 @@ jobs: node-version: 21 - name: Install dependencies run: | - pip install poetry - poetry install + pip install uv cd openadapt/app/dashboard npm install cd ../../../ - pip install wheel - poetry run postinstall + uv pip install wheel + uv run python scripts/postinstall.py - name: Build Windows executable run: | - poetry run python -m openadapt.build + uv run python -m openadapt.build cd dist 7z a -tzip ../OpenAdapt.zip OpenAdapt move OpenAdapt_Installer.exe .. @@ -190,8 +188,7 @@ jobs: - name: Install the latest version of the project run: | git pull - pip install poetry - poetry install + pip install uv - name: Download macOS executable uses: actions/download-artifact@v4 with: @@ -238,12 +235,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.10' + - name: Install uv + run: pip install uv - name: Publish to PyPI env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: | - pip install poetry - poetry install - poetry config pypi-token.pypi $PYPI_TOKEN - poetry build - poetry publish --no-interaction --skip-existing + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: uv publish diff --git a/install/install_openadapt.ps1 b/install/install_openadapt.ps1 index d42f2a631..12f0a8960 100644 --- a/install/install_openadapt.ps1 +++ b/install/install_openadapt.ps1 @@ -358,14 +358,14 @@ Install-VCRedist # OpenAdapt Setup RunAndCheck "git clone -q https://github.com/MLDSAI/OpenAdapt.git" "clone git repo" Set-Location .\OpenAdapt -RunAndCheck "pip install poetry" "Run ``pip install poetry``" -RunAndCheck "poetry install" "Run ``poetry install``" -RunAndCheck "poetry run postinstall" "Install other dependencies" -SkipCleanup:$true +RunAndCheck "pip install uv" "Run ``pip install uv``" +RunAndCheck "uv venv" "Run ``uv venv``" +RunAndCheck "uv run python scripts/postinstall.py" "Install other dependencies" -SkipCleanup:$true RunAndCheck "cd openadapt" -RunAndCheck "poetry run alembic upgrade head" "Run ``alembic upgrade head``" -SkipCleanup:$true +RunAndCheck "uv run alembic upgrade head" "Run ``alembic upgrade head``" -SkipCleanup:$true RunAndCheck "cd .." -RunAndCheck "poetry run pytest" "Run ``Pytest``" -SkipCleanup:$true +RunAndCheck "uv run pytest" "Run ``Pytest``" -SkipCleanup:$true Write-Host "OpenAdapt installed Successfully!" -ForegroundColor Green -Start-Process powershell -Verb RunAs -ArgumentList "-NoExit", "-Command", "Set-Location -Path '$pwd'; poetry shell" +Start-Process powershell -Verb RunAs -ArgumentList "-NoExit", "-Command", "Set-Location -Path '$pwd';" ################################ SCRIPT ################################### diff --git a/install/install_openadapt.sh b/install/install_openadapt.sh index ebbb39d3f..f507f9f87 100644 --- a/install/install_openadapt.sh +++ b/install/install_openadapt.sh @@ -155,14 +155,11 @@ RunAndCheck "git clone $REPO_URL" "Clone git repo" cd OpenAdapt RunAndCheck "git checkout $BRANCH" "Checkout branch $BRANCH" -RunAndCheck "pip3.10 install poetry" "Install Poetry" -RunAndCheck "poetry install" "Install Python dependencies" -RunAndCheck "poetry run postinstall" "Install other dependencies" +RunAndCheck "pip3.10 install uv " "Install uv" +RunAndCheck "uv venv" "Create virtual environment" +RunAndCheck "uv run python scripts/postinstall.py" "Install other dependencies" RunAndCheck "cd openadapt" -RunAndCheck "poetry run alembic upgrade head" "Update database" +RunAndCheck "uv run alembic upgrade head" "Update database" RunAndCheck "cd .." -RunAndCheck "poetry run pytest" "Run tests" -if [ -z "$SKIP_POETRY_SHELL" ]; then - RunAndCheck "poetry shell" "Activate virtual environment" -fi +RunAndCheck "uv run pytest" "Run tests" echo OpenAdapt installed successfully! diff --git a/pyproject.toml b/pyproject.toml index 97f9c1cd2..dabae23fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,133 +1,115 @@ -[tool.poetry] +[project] +authors = [ + {name = "Richard Abrich", email = "richard@openadapt.ai"}, +] +requires-python = "<3.14,>=3.10" +dependencies = [ + "alembic==1.8.1", + "black<25.0.0,>=24.8.0", + "pygetwindow<0.0.5; sys_platform == \"win32\"", + "pywin32==306; sys_platform == \"win32\"", + "xcffib==1.5.0; sys_platform == \"linux\"", + "ascii-magic==2.3.0", + "bokeh==2.4.3", + "clipboard==0.0.4", + "deepdiff[optimize]<7.0.0,>=6.3.0", + "ascii-magic==2.3.0", + "dictalchemy3==1.0.0", + "fire==0.4.0", + "ipdb==0.13.11", + "loguru==0.6.0", + "matplotlib==3.6.2", + "mss==6.1.0", + "openai<2.0.0,>=1.51.0", + "pandas==2.0.0", + "presidio-analyzer==2.2.32", + "presidio-anonymizer==2.2.32", + "pytesseract==0.3.7", + "pytest==7.1.3", + "rapidocr-onnxruntime==1.2.3", + "scikit-learn==1.2.2", + "scipy<2.0.0,>=1.11.0", + "torch<3.0.0,>=2.0.0", + "tqdm==4.64.0", + "transformers==4.29.2", + "python-dotenv==1.0.0", + "pyinstaller==6.11.0", + "setuptools-lint<1.0.0,>=0.6.0", + "sphinx==7.0.1", + "spacy<4.0.0,>=3.5.3", + "fuzzywuzzy==0.18.0", + "segment-anything<2.0,>=1.0", + "torchvision<1.0.0,>=0.15.2", + "sumy==0.11.0", + "nltk==3.8.1", + "pillow<11.0.0,>=10.4.0", + "pywinauto<1.0.0,>=0.6.8; sys_platform == \"win32\"", + "flake8<7.0.0,>=6.0.0", + "flake8-docstrings<2.0.0,>=1.7.0", + "moviepy==1.0.3", + "python-levenshtein<1.0.0,>=0.21.1", + "magic-wormhole==0.12.0", + "pyside6<7.0.0.0,>=6.5.1.1", + "flake8-annotations<4.0.0,>=3.0.1", + "pre-commit<4.0.0,>=3.3.3", + "pympler<2.0.0,>=1.0.1", + "psutil<6.0.0,>=5.9.5", + "sentry-sdk<2.0.0,>=1.28.1", + "gitpython<4.0.0,>=3.1.32", + "pyobjc-framework-avfoundation<10.0,>=9.2; sys_platform == \"darwin\"", + "fastapi<1.0.0,>=0.111.1", + "screen-recorder-sdk<2.0.0,>=1.3.0; sys_platform == \"win32\"", + "pyaudio<1.0.0,>=0.2.13; sys_platform == \"win32\"", + "oa-atomacos==3.2.0; sys_platform == \"darwin\"", + "presidio-image-redactor<1.0.0,>=0.0.48", + "pywebview<5.0.0,>=4.2.2", + "click<9.0.0,>=8.1.6", + "spacy-transformers<2.0.0,>=1.2.5", + "boto3<2.0.0,>=1.28.30", + "botocore<2.0.0,>=1.31.30", + "easyocr<2.0.0,>=1.7.0", + "spacy-curated-transformers<1.0.0,>=0.2.0", + "anthropic<1.0.0,>=0.34.2", + "orjson<4.0.0,>=3.9.15", + "replicate<1.0.0,>=0.25.0", + "gradio-client==0.15.0", + "google-generativeai<1.0.0,>=0.5.0", + "uvicorn[standard]<1.0.0,>=0.30.0", + "ultralytics<9.0.0,>=8.1.47", + "imagehash<5.0.0,>=4.3.1", + "pydantic-settings<3.0.0,>=2.2.1", + "pyqt-toast-notification<2.0.0,>=1.1.0", + "pudb<2025.0,>=2024.1", + "sounddevice<1.0.0,>=0.4.6", + "soundfile<1.0.0,>=0.12.1", + "posthog<4.0.0,>=3.5.0", + "wheel<1.0.0,>=0.43.0", + "cython<4.0.0,>=3.0.10", + "av<13.0.0,>=12.3.0", + "beautifulsoup4<5.0.0,>=4.12.3", + "dtaidistance<3.0.0,>=2.3.12", + "tokencost<1.0.0,>=0.1.12", + "numba<1.0.0,>=0.60.0", + "llvmlite<1.0.0,>=0.43.0", + "ell-ai<1.0.0,>=0.0.14", + "pynput<2.0.0,>=1.7.7", + "multiprocessing-utils<1.0,>=0.4", +] name = "openadapt" version = "0.43.1" description = "GUI Process Automation with Transformers" -authors = [ - 'OpenAdapt.AI Team ', -] classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent", ] - readme = "README.md" -repository = "https://github.com/mldsai/openadapt" +[project.urls] +"Bug Tracker" = "https://github.com/OpenAdaptAI/OpenAdapt/issues" homepage = "https://openadapt.ai/" +repository = "https://github.com/OpenAdaptAI/OpenAdapt" -[tool.poetry.urls] -"Bug Tracker" = "https://github.com/MLDSAI/OpenAdapt/issues" - -[tool.poetry.dependencies] -python = ">=3.10,<3.14" -alembic = "1.8.1" -black = "^24.8.0" -pygetwindow = { version = "<0.0.5", markers = "sys_platform == 'win32'" } -pywin32 = { version = "306", markers = "sys_platform == 'win32'" } -xcffib = { version = "1.5.0", markers = "sys_platform == 'linux'" } -ascii-magic = "2.3.0" -bokeh = "2.4.3" -clipboard = "0.0.4" -deepdiff = { extras = ["optimize"], version = "^6.3.0" } -ascii_magic = "2.3.0" -dictalchemy3 = "1.0.0" -fire = "0.4.0" -ipdb = "0.13.11" -loguru = "0.6.0" -matplotlib = "3.6.2" -mss = "6.1.0" -openai = "^1.51.0" -pandas = "2.0.0" -presidio_analyzer = "2.2.32" -presidio_anonymizer = "2.2.32" -pytesseract = "0.3.7" -pytest = "7.1.3" -rapidocr-onnxruntime = "1.2.3" -scikit-learn = "1.2.2" -scipy = "^1.11.0" -torch = "^2.0.0" -tqdm = "4.64.0" -transformers = "4.29.2" -python-dotenv = "1.0.0" -pyinstaller = "6.11.0" -setuptools-lint = "^0.6.0" -sphinx = "7.0.1" -spacy = "^3.5.3" -fuzzywuzzy = "0.18.0" -segment-anything = "^1.0" -torchvision = "^0.15.2" -sumy = "0.11.0" -nltk = "3.8.1" -pillow = "^10.4.0" -pywinauto = { version = "^0.6.8", markers = "sys_platform == 'win32'" } -flake8 = "^6.0.0" -flake8-docstrings = "^1.7.0" -moviepy = "1.0.3" -python-levenshtein = "^0.21.1" -magic-wormhole = "0.12.0" -pyside6 = "^6.5.1.1" -flake8-annotations = "^3.0.1" -pre-commit = "^3.3.3" -pympler = "^1.0.1" -psutil = "^5.9.5" -sentry-sdk = "^1.28.1" -gitpython = "^3.1.32" -pyobjc-framework-avfoundation = { version = "^9.2", markers = "sys_platform == 'darwin'" } -fastapi = "^0.111.1" -screen-recorder-sdk = { version = "^1.3.0", markers = "sys_platform == 'win32'" } -pyaudio = { version = "^0.2.13", markers = "sys_platform == 'win32'" } -oa-atomacos = { version = "3.2.0", markers = "sys_platform == 'darwin'" } -presidio-image-redactor = "^0.0.48" -pywebview = "^4.2.2" -click = "^8.1.6" -spacy-transformers = "^1.2.5" -boto3 = "^1.28.30" -botocore = "^1.31.30" -easyocr = "^1.7.0" -spacy-curated-transformers = "^0.2.0" -anthropic = "^0.34.2" -orjson = "^3.9.15" -replicate = "^0.25.0" -gradio-client = "0.15.0" -google-generativeai = "^0.5.0" -uvicorn = {version = "^0.30.0", extras = ["standard"]} -ultralytics = "^8.1.47" -imagehash = "^4.3.1" -pydantic-settings = "^2.2.1" -pyqt-toast-notification = "^1.1.0" -pudb = "^2024.1" -sounddevice = "^0.4.6" -soundfile = "^0.12.1" -posthog = "^3.5.0" - -wheel = "^0.43.0" -cython = "^3.0.10" -av = "^12.3.0" -beautifulsoup4 = "^4.12.3" -dtaidistance = "^2.3.12" -tokencost = "^0.1.12" -numba = "^0.60.0" -llvmlite = "^0.43.0" -ell-ai = "^0.0.14" -pynput = "^1.7.7" -multiprocessing-utils = "^0.4" -[tool.pytest.ini_options] -filterwarnings = [ - # suppress warnings starting from "setuptools>=67.3" - "ignore:Deprecated call to `pkg_resources\\.declare_namespace\\('.*'\\):DeprecationWarning", - "ignore:pkg_resources is deprecated as an API", -] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.isort] -profile = "black" -group_by_package = true -from_first = true - -[tool.poetry.scripts] +[project.scripts] visualize = "openadapt.visualize:main" record = "openadapt.record:start" replay = "openadapt.replay:start" @@ -135,7 +117,6 @@ app = "openadapt.app.tray:_run" reset = "openadapt.scripts.reset_db:reset_db" capture = "openadapt.capture:test" postinstall = "scripts.postinstall:main" - [tool.black] line-length = 88 extend-exclude = ''' @@ -151,13 +132,12 @@ extend-exclude = ''' [tool.semantic_release] version_variable = ["openadapt/__init__.py:__version__"] -version_toml = ["pyproject.toml:tool.poetry.version"] major_on_zero = false branch = "main" commit_subject = "chore(release): v{version}" commit_version_number = true -upload_to_PyPI = false +upload_to_PyPI = true upload_to_release = true upload_to_repository = false repository_url = "https://upload.pypi.org/legacy/" -build_command = "pip install poetry && poetry env use python3.10 && poetry build" +build_command = "uv publish"