소스 검색

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>
tofarr 1 년 전
부모
커밋
6ce77e157b
5개의 변경된 파일434개의 추가작업 그리고 373개의 파일을 삭제
  1. 0 0
      openhands/py.typed
  2. 1 1
      openhands/runtime/utils/runtime_build.py
  3. 419 362
      poetry.lock
  4. 12 9
      pyproject.toml
  5. 2 1
      tests/unit/test_runtime_build.py

+ 0 - 0
openhands/py.typed


+ 1 - 1
openhands/runtime/utils/runtime_build.py

@@ -59,7 +59,7 @@ def _create_project_source_dist():
     # Fetch the correct version from pyproject.toml
     package_version = _get_package_version()
     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):
         logger.error(f'Source distribution not found at {tarball_path}')

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 419 - 362
poetry.lock


+ 12 - 9
pyproject.toml

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

+ 2 - 1
tests/unit/test_runtime_build.py

@@ -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
     assert set(os.listdir(code_dir)) == {
+        'agenthub',
         'openhands',
         'pyproject.toml',
         'poetry.lock',
@@ -51,7 +52,7 @@ def _check_source_code_in_dir(temp_dir):
         pyproject = toml.load(f)
 
     _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):

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.