Skip to content

Commit

Permalink
adding mobile adapt release
Browse files Browse the repository at this point in the history
  • Loading branch information
anamhira47 committed Oct 27, 2024
1 parent d97ca68 commit 5820ecf
Show file tree
Hide file tree
Showing 9 changed files with 1,393 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/release.yml → .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- uses: actions/setup-python@v3
with:
python-version: 3.11
python-version: 3.12

- run: |
pip install poetry
Expand Down
2 changes: 1 addition & 1 deletion cognisim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .core import MobileAdapt

from .device.device_factory import DeviceFactory


Expand Down
10 changes: 1 addition & 9 deletions cognisim/device/device_factory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# device/device_factory.py
# from .device import Device
from cognisim.device.android.android_device import AndroidDevice
from cognisim.device.web_device import WebDevice
from cognisim.device.ios.ios_device import IOSDevice
from loguru import logger

Expand All @@ -28,14 +27,7 @@ def create_device(

elif platform == 'web':
logger.info("Creating web device")
return WebDevice(
app_start_url=app_url,
state_representation=state_representation,
download_directory=download_directory,
session_id=session_id,
tracing=tracing,
tracingconfig=tracingconfig
)
raise NotImplementedError("Web support is not yet implemented")
else:
raise ValueError(
"Invalid type. Expected one of: 'android', 'web'.")
2 changes: 1 addition & 1 deletion cookbook/examplescript2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from PIL import Image

from mobileadapt import mobileadapt
from cognisim import mobileadapt


async def save_screenshot(screenshot_data, filename):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from loguru import logger
from PIL import Image

from mobileadapt import mobileadapt
from cognisim import mobileadapt

""" From the root directory use the following command to start the script:
python example-scripts/examplescript.py
Expand Down
25 changes: 25 additions & 0 deletions cookbook/smoke_example_ios.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

import base64
import io
import os

from datetime import datetime

from PIL import Image
from loguru import logger
from cognisim import mobileadapt


async def main():

ios_device = mobileadapt(platform="ios")

await ios_device.start_device()


encoded_ui, screenshot, ui = await ios_device.get_state()
logger.info(f"Current state: {encoded_ui}")

if __name__ == "__main__":
asyncio.run(main())
1,326 changes: 1,326 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "mobileadapt"
name = "cognisim"
version = "0.1.0"
description = "A package for mobile app adaptation and testing"
authors = ["Revyl AI <[email protected]>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/RevylAI/Mobileadapt"
homepage = "https://mobileadapt.revyl.ai"
packages = [{include = "mobileadapt"}]
packages = [{include = "cognisim"}]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand All @@ -35,6 +35,7 @@ pillow = "^10.4.0"
opencv-python = "^4.10.0.84"
retrying = "^1.3.4"
openai = "^1.43.0"
setuptools = "^75.2.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
Expand Down
34 changes: 34 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from setuptools import find_packages, setup

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setup(
name="mobileadapt",
version="0.1.0",
author="Revyl AI",
author_email="[email protected]",
description="A package for mobile app adaptation and testing",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/revyl-ai/mobileadapt",
packages=find_packages(),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
python_requires=">=3.7",
install_requires=[
"appium-python-client",
"loguru",
"lxml",
"numpy",
"attrs",
],
)

0 comments on commit 5820ecf

Please sign in to comment.