-
Notifications
You must be signed in to change notification settings - Fork 4
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
VirtualEnv can be created from setup.py files #306
Conversation
Alright @andyk, this should be ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just 3 nits/typos in docstrings and one possible suggestion for an assert statement.
""" | ||
This command clears all virtual environments that have been cached by | ||
AgentOS in your local file system. All the virtual environments can be | ||
automatically recreated when re-running a Component ``requirements_path`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing "with" in "re-running a Component with `requirements_path` specified."
def clear_repo_cache(assume_yes): | ||
""" | ||
This command clears all git repos that have been cached by AgentOS on your | ||
local file system. These repos will be recreated if as you run Components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra "if" in "These repos will be recreated if as you run..."
for req_path in c.requirements_path.split(";"): | ||
full_req_path = self.repo.get_local_file_path( | ||
c.identifier.version, req_path | ||
).absolute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to assert that the requirements_file exists here?
This PR allows virtual environments to be created based on the
install_requires
kwarg found insetup.py
files. Also included in this PR:More cache-clearing commands:
agentos clear-env-cache
agentos clear-repo-cache
agentos clear-cache # clears both env and repo cache
You can list multiple requirements files (Python package
setup.py
files or pip-compatiblerequirements.txt
files) in therequirements_path
Component spec key separated by a semicolon and all will be installed into the virtual env.Update to
rllib_agent
andsb3_agent
requirements.Minor improvements to the
install_requirements.py
environment setup script.Remove unneeded requirements from AgentOS
setup.py
.Try the following demo in your Python REPL to get a Policy class component out of Ilya's repo:
Fixes #275.