diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5e5d757d..15cbe79a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | pip install -r ./scripts/configs/requirements.txt - pip install -e ./gymlib + pip install ./gymlib_package ./scripts/install_sysdeps.sh - name: Check formatting diff --git a/.gitignore b/.gitignore index 9b3065ed..601b999d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ .mypy_cache/ .conda/ .idea/ +build/ test_clean_scratchspace/ workspace/ default_*_benchbase_config_*.xml diff --git a/gymlib/gymlib/__init__.py b/gymlib_package/gymlib/__init__.py similarity index 100% rename from gymlib/gymlib/__init__.py rename to gymlib_package/gymlib/__init__.py diff --git a/gymlib/gymlib/magic.py b/gymlib_package/gymlib/magic.py similarity index 100% rename from gymlib/gymlib/magic.py rename to gymlib_package/gymlib/magic.py diff --git a/gymlib_package/gymlib/py.typed b/gymlib_package/gymlib/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/gymlib/pyproject.toml b/gymlib_package/pyproject.toml similarity index 61% rename from gymlib/pyproject.toml rename to gymlib_package/pyproject.toml index 6f54fe22..2d2e93b9 100644 --- a/gymlib/pyproject.toml +++ b/gymlib_package/pyproject.toml @@ -5,8 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "gymlib" version = "0.1.0" -requires-python = ">=3.8" -dependencies = [] -[tool.setuptools] -py-modules = ["gymlib"] \ No newline at end of file +[tool.setuptools.packages.find] +where = ["."] +include = ["gymlib*"] \ No newline at end of file diff --git a/lab.py b/lab.py new file mode 100644 index 00000000..77595ff3 --- /dev/null +++ b/lab.py @@ -0,0 +1,3 @@ +import gymlib + +print(gymlib.magic.get_magic_number()) diff --git a/scripts/_build_conda_env.sh b/scripts/_build_conda_env.sh index 7685f104..77dc6026 100755 --- a/scripts/_build_conda_env.sh +++ b/scripts/_build_conda_env.sh @@ -40,7 +40,7 @@ fi if [ -f "$python_version_path" ]; then python_version=$(cat "$python_version_path") else - echo "Warning: .python_version not found in $python_version_path. Using default Python 3.10." + echo "Info: .python_version not found in $python_version_path. Using default Python 3.10." python_version="3.10" fi @@ -56,15 +56,16 @@ if [ -f "$requirements_path" ]; then echo "Installing pip requirements from $requirements_path..." pip install -r "$requirements_path" else - echo "Warning: $requirements_path not found. Skipping pip install." + echo "Info: $requirements_path not found. Skipping pip install." fi # We always install gymlib so that the agent has access to it. -if [ -d "gymlib" ]; then - echo "Installing gymlib in editable mode..." - pip install -e ./gymlib +if [ -d "gymlib_package" ]; then + echo "Installing gymlib..." + # Note that I don't use -e here. When I tried -e, the editor wouldn't be able to find gymlib. + pip install ./gymlib_package else - echo "Error: gymlib directory not found in $(pwd). Please ensure you're running this script from the right folder." + echo "Error: gymlib_package directory not found in $(pwd). Please ensure you're running this script from the right folder." exit 1 fi diff --git a/scripts/mypy.sh b/scripts/mypy.sh index 462a5efa..fd689b18 100755 --- a/scripts/mypy.sh +++ b/scripts/mypy.sh @@ -1,3 +1,4 @@ #!/bin/bash # Ignore agents/ because those are all submodules. -mypy --config-file scripts/configs/mypy.ini . --exclude agents/ \ No newline at end of file +# Ignore gymlib_package/build/ to avoid the error of mypy finding two gymlib packages. +mypy --config-file scripts/configs/mypy.ini . --exclude agents/ --exclude gymlib_package/build/ \ No newline at end of file