Skip to content

Commit

Permalink
No longer read saved state project info from cli flags
Browse files Browse the repository at this point in the history
Reviewed By: stroxler

Differential Revision: D45407210

fbshipit-source-id: 9e66051fd648f107f96dca5ed2d0d0008742eb03
  • Loading branch information
grievejia authored and facebook-github-bot committed May 3, 2023
1 parent b8e56c3 commit 6bd1e24
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 41 deletions.
3 changes: 0 additions & 3 deletions client/command_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class CommandArguments:
save_initial_state_to: Optional[str] = None
load_initial_state_from: Optional[str] = None
changed_files_path: Optional[str] = None
saved_state_project: Optional[str] = None
dot_pyre_directory: Optional[Path] = None
isolation_prefix: Optional[str] = None
python_version: Optional[str] = None
Expand All @@ -115,7 +114,6 @@ class StartArguments:
no_watchman: bool = False
noninteractive: bool = False
save_initial_state_to: Optional[str] = None
saved_state_project: Optional[str] = None
sequential: bool = False
show_error_traces: bool = False
store_type_check_resolution: bool = False
Expand Down Expand Up @@ -148,7 +146,6 @@ def create(
no_watchman=no_watchman,
noninteractive=command_argument.noninteractive,
save_initial_state_to=command_argument.save_initial_state_to,
saved_state_project=command_argument.saved_state_project,
sequential=command_argument.sequential,
show_error_traces=command_argument.show_error_traces,
store_type_check_resolution=store_type_check_resolution,
Expand Down
13 changes: 1 addition & 12 deletions client/commands/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,7 @@ def get_saved_state_action(
changed_files_path=start_arguments.changed_files_path,
)

saved_state_project = (
frontend_configuration.SavedStateProject(
name=start_arguments.saved_state_project,
metadata=(
relative_local_root.replace("/", "$")
if relative_local_root is not None
else None
),
)
if start_arguments.saved_state_project is not None
else configuration.get_saved_state_project()
)
saved_state_project = configuration.get_saved_state_project()
if saved_state_project is not None:
return LoadSavedStateFromProject(
project_name=saved_state_project.name,
Expand Down
27 changes: 2 additions & 25 deletions client/commands/tests/start_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,24 +338,6 @@ def test_get_saved_state_action(self) -> None:
LoadSavedStateFromFile(shared_memory_path="foo", changed_files_path="bar"),
)

# Ensure command_arguments override internal_configuration
self.assertEqual(
get_saved_state_action(
command_arguments.StartArguments(saved_state_project="my_project"),
saved_state_configuration,
),
LoadSavedStateFromProject(project_name="my_project"),
)
self.assertEqual(
get_saved_state_action(
command_arguments.StartArguments(saved_state_project="my_project"),
saved_state_configuration,
relative_local_root="local/root",
),
LoadSavedStateFromProject(
project_name="my_project", project_metadata="local$root"
),
)
self.assertEqual(
get_saved_state_action(
command_arguments.StartArguments(
Expand Down Expand Up @@ -414,7 +396,6 @@ def test_create_server_arguments(self) -> None:
command_arguments.StartArguments(
debug=True,
no_watchman=False,
saved_state_project="project",
sequential=False,
show_error_traces=True,
store_type_check_resolution=True,
Expand Down Expand Up @@ -460,9 +441,7 @@ def test_create_server_arguments(self) -> None:
MatchPolicy.FULL_PATH, str(root_path / "critical")
),
],
saved_state_action=LoadSavedStateFromProject(
project_name="project", project_metadata="local"
),
saved_state_action=None,
show_error_traces=True,
store_type_check_resolution=True,
strict=True,
Expand Down Expand Up @@ -515,9 +494,7 @@ def test_create_server_arguments_disable_saved_state(self) -> None:
root_path,
)
),
command_arguments.StartArguments(
no_saved_state=True, saved_state_project="some/project"
),
command_arguments.StartArguments(no_saved_state=True),
)
self.assertIsNone(arguments.saved_state_action)

Expand Down
1 change: 0 additions & 1 deletion client/pyre.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ def pyre(
save_initial_state_to=save_initial_state_to,
load_initial_state_from=load_initial_state_from,
changed_files_path=changed_files_path,
saved_state_project=None,
dot_pyre_directory=Path(dot_pyre_directory)
if dot_pyre_directory is not None
else None,
Expand Down

0 comments on commit 6bd1e24

Please sign in to comment.