Skip to content

Conversation

@burtenshaw
Copy link
Collaborator

@burtenshaw burtenshaw commented Nov 25, 2025

This PR solves this issue. In short, that the package is not straightforward or conventional to install or import.

DX changes

The PR has a significant amount of new lines, made mostly out of grepping and moving. The fundamental change is this:

User will install like this:

# install everything
pip install openenv
pip install git+https://github.com/meta-pytorch/OpenEnv.git

# install a subset of dependencies
pip install openenv[core]
pip install openenv[cli]

User can use the core library in their envs like so:

from openenv.core.client_types import StepResult
from openenv.core.http_env_client import HTTPEnvClient
from coding_env.models import CodeAction, CodeObservation, CodeState

And install in the env tomls with openenv[core], openenv, or git+https://github.com/meta-pytorch/OpenEnv.git, without a subdirectory reference.

Implementation

The Changes to implement this are:

  • Collapsed the repo into a single distributable openenv package: CLI + runtime live under src/openenv/. Following Python conventions and simplifying toml definition.
  • openenv_core is now a shim.
  • and extras ([core], [cli], [all]) express optional deps in `pyproject.toml.
  • Moved sample environments out of src/ into top-level envs/
  • updated the CLI template to use openenv.core
  • updated docs to import from openenv.core and depend on openenv[core],
  • Updated README, guides, scripts, and tests to the new layout

Changes

Before

OpenEnv/
├── pyproject.toml          # publishes CLI-only “openenv” package
├── src/
│   ├── __init__.py
│   ├── core/               # separate openenv-core package (its own pyproject)
│   │   ├── client_types.py
│   │   ├── env_server/
│   │   ├── http_env_client.py
│   │   └── tools/
│   ├── envs/               # example environments bundled inside src/
│   │   ├── echo_env/
│   │   ├── coding_env/
│   │   └── ...
│   └── openenv_cli/        # CLI package exposed by root pyproject
│       ├── __main__.py
│       ├── commands/
│       └── templates/
└── tests/

After

After (single openenv namespace + externalized envs)
OpenEnv/
├── pyproject.toml          # publishes unified “openenv” (core + CLI)
├── src/
│   └── openenv/
│       ├── __init__.py     # namespace package
│       ├── core/           # runtime modules now under openenv.core
│       │   ├── client_types.py
│       │   ├── env_server/
│       │   ├── http_env_client.py
│       │   └── tools/
│       ├── cli/            # CLI lives under openenv.cli
│       │   ├── __main__.py
│       │   ├── commands/
│       │   └── templates/
│       └── ...
├── openenv_core/           # compatibility shim re-exporting openenv.core
├── envs/                   # sample/template environments (not packaged)
│   ├── echo_env/
│   ├── coding_env/
│   └── ...
└── tests/

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 25, 2025
Copy link
Contributor

@rycerzes rycerzes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Having a deprecation warning of sorts would be beneficial
Also I think the dependency grouping in the updated pyproject.toml needs clarification.
Right now, core contains all the server dependencies (FastAPI, Pydantic, Uvicorn, Requests), but it’s declared under optional-dependencies. That makes it seem like core is required for normal usage, yet it's not installed by default.

@pankit-eng
Copy link
Contributor

thanks @burtenshaw for the change. Will review this. do you mind mentioning the detailed project structure before vs after this change in the PR description? It ll make the review a bit easier. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burtenshaw - whats your take on the each env's version? We don't want the repo to be a host of multiple versions of envs, given this repo is purpose-built to be framework.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. We should just host the latest version of a limited set of envs.

@jspisak jspisak added the enhancement New feature or request label Dec 1, 2025
@burtenshaw
Copy link
Collaborator Author

thanks @burtenshaw for the change. Will review this. do you mind mentioning the detailed project structure before vs after this change in the PR description? It ll make the review a bit easier. Thanks!

@pankit-eng That's added to the description. Let me know what you think.

@burtenshaw
Copy link
Collaborator Author

burtenshaw commented Dec 1, 2025

@rycerzes

LGTM! Having a deprecation warning of sorts would be beneficial

I would skip this for this early version of the lib.

Also I think the dependency grouping in the updated pyproject.toml needs clarification. Right now, core contains all the server dependencies (FastAPI, Pydantic, Uvicorn, Requests), but it’s declared under optional-dependencies. That makes it seem like core is required for normal usage, yet it's not installed by default.

Understood. My thinking here was to expose an optional 'minimal' install for envs that just use openenv.core and not openenv.cli

@rycerzes
Copy link
Contributor

rycerzes commented Dec 2, 2025

@burtenshaw
Fair point on the deprecation warning. On the dependency grouping - having core as optional when it contains FastAPI, Pydantic, Uvicorn, and Requests (which seem essential for the server/framework) is a bit counterintuitive. Could you consider either making these part of the default install?

@burtenshaw
Copy link
Collaborator Author

burtenshaw commented Dec 2, 2025

On the dependency grouping - having core as optional when it contains FastAPI, Pydantic, Uvicorn, and Requests (which seem essential for the server/framework) is a bit counterintuitive. Could you consider either making these part of the default install?

@rycerzes Ok. They already included within dependencies (see here). [project.optional-dependencies].core is a mechanism to negate cli dependencies.

That said, I am not wedded to seperation I just thought it was convenient for docker builds to skips the extra cli dependencies. Do you find it confusing?

@rycerzes
Copy link
Contributor

rycerzes commented Dec 2, 2025

@burtenshaw

Ah got it, makes sense now. The naming just threw me off - openenv[core] reads like "minimal install". If the default install includes everything, then nvm, current setup is fine. Docker build optimization is worth it.

@burtenshaw
Copy link
Collaborator Author

Ah got it, makes sense now. The naming just threw me off - openenv[core] reads like "minimal install". If the default install includes everything, then nvm, current setup is fine. Docker build optimization is worth it.

Understood. I'll review the docs to make sure it's clear.

@burtenshaw
Copy link
Collaborator Author

Thanks for the review @pankit-eng, I'll merge to release and ping relevant PRs.

@burtenshaw burtenshaw merged commit e612a1b into release Dec 3, 2025
1 check passed
@burtenshaw burtenshaw mentioned this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants