Skip to content

Commit

Permalink
Fix site package installation location (#1779)
Browse files Browse the repository at this point in the history
* Remove dependency on pyproject.toml in site package

* Add package_data

* Move to include, mapped by poetry

* Bump

* Poetry enforces stricter package rules

* Fix compose.full

* Restore workflow

* config location

* Test location

* Include files AND packages in wheel
  • Loading branch information
NolanTrem authored Jan 8, 2025
1 parent 877899c commit cff489c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions py/cli/utils/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ def get_compose_files():
"..",
)
compose_files = {
"base": os.path.join(package_dir, "compose.yaml"),
"full": os.path.join(package_dir, "compose.full.yaml"),
"base": os.path.join(package_dir, "r2r", "compose.yaml"),
"full": os.path.join(package_dir, "r2r", "compose.full.yaml"),
"full_scale": os.path.join(
package_dir, "compose.full_with_replicas.yaml"
package_dir, "r2r", "compose.full_with_replicas.yaml"
),
}

Expand Down
2 changes: 1 addition & 1 deletion py/core/main/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class R2RConfig:
current_file_path = os.path.dirname(__file__)
config_dir_root = os.path.join(current_file_path, "..", "configs")
default_config_path = os.path.join(
current_file_path, "..", "..", "r2r.toml"
current_file_path, "..", "..", "r2r", "r2r.toml"
)

CONFIG_OPTIONS: dict[str, Optional[str]] = {}
Expand Down
21 changes: 9 additions & 12 deletions py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,25 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "r2r"
readme = "README.md"
version = "3.3.23"
version = "3.3.24"

description = "SciPhi R2R"
authors = ["Owen Colegrove <[email protected]>"]
license = "MIT"
include = [
"r2r.toml",
"compose.yaml",
"compose.full.yaml",
"compose.full_with_replicas.yaml",
"pyproject.toml",
"migrations/**/*",
"r2r/**/*.yaml",
"r2r/**/*.toml"
]

packages = [
{ include = "r2r" },
{ include = "r2r", from = "." },
{ include = "sdk", from = "." },
{ include = "shared", from = "." },
{ include = "core", from = "." },
{ include = "cli", from = "." },
]
include = [
{ path = "migrations/**/*", format = ["sdist", "wheel"] },
{ path = "pyproject.toml", format = ["sdist", "wheel"] },
{ path = "r2r/**/*.yaml", format = ["sdist", "wheel"] },
{ path = "r2r/**/*.toml", format = ["sdist", "wheel"] }
]

[tool.poetry.dependencies]
# Python Versions
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions py/tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@pytest.fixture
def base_config():
"""Load the base r2r.toml config"""
config_path = Path(__file__).parent.parent.parent / "r2r.toml"
config_path = Path(__file__).parent.parent.parent / "r2r/r2r.toml"
with open(config_path) as f:
return toml.load(f)

Expand Down Expand Up @@ -140,7 +140,7 @@ def get_config_files():
def test_config_required_keys(config_file):
"""Test that all required keys are present in all config files"""
if config_file == "r2r.toml":
file_path = Path(__file__).parent.parent.parent / "r2r.toml"
file_path = Path(__file__).parent.parent.parent / "r2r/r2r.toml"
else:
file_path = (
Path(__file__).parent.parent.parent
Expand Down

0 comments on commit cff489c

Please sign in to comment.