Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor displays gymlib correctly #63

Merged
merged 4 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __pycache__/
.mypy_cache/
.conda/
.idea/
build/
test_clean_scratchspace/
workspace/
default_*_benchbase_config_*.xml
Expand Down
File renamed without changes.
File renamed without changes.
Empty file added gymlib_package/gymlib/py.typed
Empty file.
7 changes: 3 additions & 4 deletions gymlib/pyproject.toml → gymlib_package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
[tool.setuptools.packages.find]
where = ["."]
include = ["gymlib*"]
3 changes: 3 additions & 0 deletions lab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import gymlib

print(gymlib.magic.get_magic_number())
13 changes: 7 additions & 6 deletions scripts/_build_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion scripts/mypy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Ignore agents/ because those are all submodules.
mypy --config-file scripts/configs/mypy.ini . --exclude agents/
# 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/
Loading