Fix pypi build (#3548)

* Fix pypi build

The package on pypi only included opendevin/* (the poetry default). It also needs to include agenthub/*

* Bumped version so people will actually get it!

* Fix package definition
* Updated poetry lock file
* Update package name to openhands-ai
* Add py.typed to indicate that OpenHands has type annotations

* Replace package name with openhands_ai

* Fix tests to reflect new name

---------

Co-authored-by: Graham Neubig <neubig@gmail.com>
This commit is contained in:
tofarr
2024-08-26 01:31:37 -06:00
committed by GitHub
parent f9088766e8
commit 6ce77e157b
5 changed files with 2173 additions and 1965 deletions

0
openhands/py.typed Normal file
View File

View File

@@ -59,7 +59,7 @@ def _create_project_source_dist():
# Fetch the correct version from pyproject.toml # Fetch the correct version from pyproject.toml
package_version = _get_package_version() package_version = _get_package_version()
tarball_path = os.path.join( tarball_path = os.path.join(
project_root, 'dist', f'openhands-{package_version}.tar.gz' project_root, 'dist', f'openhands_ai-{package_version}.tar.gz'
) )
if not os.path.exists(tarball_path): if not os.path.exists(tarball_path):
logger.error(f'Source distribution not found at {tarball_path}') logger.error(f'Source distribution not found at {tarball_path}')

4112
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
[tool.poetry] [tool.poetry]
name = "openhands" name = "openhands-ai"
version = "0.9.0" version = "0.9.0"
description = "OpenHands: Code Less, Make More" description = "OpenHands: Code Less, Make More"
authors = ["OpenHands"] authors = ["OpenHands"]
@@ -7,6 +7,10 @@ license = "MIT"
readme = "README.md" readme = "README.md"
repository = "https://github.com/All-Hands-AI/OpenHands" repository = "https://github.com/All-Hands-AI/OpenHands"
include = ["poetry.lock"] include = ["poetry.lock"]
packages = [
{ include = "agenthub/**/*" },
{ include = "openhands/**/*" }
]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.11" python = "^3.11"
@@ -43,6 +47,11 @@ tree-sitter = "0.21.3"
bashlex = "^0.18" bashlex = "^0.18"
pyjwt = "^2.9.0" pyjwt = "^2.9.0"
dirhash = "*" dirhash = "*"
python-docx = "*"
PyPDF2 = "*"
python-pptx = "*"
pylatexenc = "*"
tornado = "*"
[tool.poetry.group.llama-index.dependencies] [tool.poetry.group.llama-index.dependencies]
llama-index = "*" llama-index = "*"
@@ -66,10 +75,6 @@ pytest-asyncio = "*"
pytest-forked = "*" pytest-forked = "*"
flake8 = "*" flake8 = "*"
openai = "*" openai = "*"
python-docx = "*"
PyPDF2 = "*"
pylatexenc = "*"
python-pptx = "*"
opencv-python = "*" opencv-python = "*"
pandas = "*" pandas = "*"
reportlab = "*" reportlab = "*"
@@ -77,15 +82,12 @@ reportlab = "*"
[tool.coverage.run] [tool.coverage.run]
concurrency = ["gevent"] concurrency = ["gevent"]
[tool.poetry.group.runtime.dependencies] [tool.poetry.group.runtime.dependencies]
jupyterlab = "*" jupyterlab = "*"
notebook = "*" notebook = "*"
jupyter_kernel_gateway = "*" jupyter_kernel_gateway = "*"
flake8 = "*" flake8 = "*"
python-docx = "*"
PyPDF2 = "*"
python-pptx = "*"
pylatexenc = "*"
opencv-python = "*" opencv-python = "*"
@@ -111,6 +113,7 @@ ignore = ["D1"]
[tool.ruff.lint.pydocstyle] [tool.ruff.lint.pydocstyle]
convention = "google" convention = "google"
[tool.poetry.group.evaluation.dependencies] [tool.poetry.group.evaluation.dependencies]
streamlit = "*" streamlit = "*"
whatthepatch = "*" whatthepatch = "*"

View File

@@ -36,6 +36,7 @@ def _check_source_code_in_dir(temp_dir):
# The source code should only include the `openhands` folder, but not the other folders # The source code should only include the `openhands` folder, but not the other folders
assert set(os.listdir(code_dir)) == { assert set(os.listdir(code_dir)) == {
'agenthub',
'openhands', 'openhands',
'pyproject.toml', 'pyproject.toml',
'poetry.lock', 'poetry.lock',
@@ -51,7 +52,7 @@ def _check_source_code_in_dir(temp_dir):
pyproject = toml.load(f) pyproject = toml.load(f)
_pyproject_version = pyproject['tool']['poetry']['version'] _pyproject_version = pyproject['tool']['poetry']['version']
assert _pyproject_version == version('openhands') assert _pyproject_version == version('openhands-ai')
def test_put_source_code_to_dir(temp_dir): def test_put_source_code_to_dir(temp_dir):