Skip to content

Commit

Permalink
Fix sanity-check script
Browse files Browse the repository at this point in the history
Summary:
I am confused about why this ever worked - we weren't
putting the virtualenv bin directory on our PATH and we
weren't specifying the path to the `pyre.bin` binary
pulled from pypi - as a result, it was impossible to run
pyre without a PYRE_BINARY override (which would be silly
since the whole point is to test the version uploaded
to `test.pypi.org`!)

Reviewed By: grievejia

Differential Revision: D37473043

fbshipit-source-id: 43f4c87be41369bb769fdad931ae42d486170c29
  • Loading branch information
stroxler authored and facebook-github-bot committed Jun 28, 2022
1 parent 0ee42a6 commit 4e280cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/build_pypi_sanity_test.py
Expand Up @@ -62,6 +62,7 @@ def run_sanity_test(version: str, use_wheel: bool) -> None:
builder.create(venv)

pyre_path = venv / "bin" / "pyre"
pyre_bin_path = venv / "bin" / "pyre.bin"
pyre_upgrade_path = venv / "bin" / "pyre-upgrade"

# Confirm that pypi package can be successfully installed
Expand All @@ -81,7 +82,8 @@ def run_sanity_test(version: str, use_wheel: bool) -> None:
f"pyre-check=={version}",
]
)
production_assert(pyre_path.exists(), "Pyre was not installed.")
production_assert(pyre_path.exists(), "Pyre (client) was not installed.")
production_assert(pyre_bin_path.exists(), "Pyre binary (pyre.bin executable) was not installed.")
production_assert(pyre_upgrade_path.exists(), "Pyre upgrade was not installed.")

# Create test project.
Expand Down Expand Up @@ -110,7 +112,7 @@ def run_sanity_test(version: str, use_wheel: bool) -> None:
# Confirm `pyre` reports errors as expected.
LOG.warning("Testing `pyre` error reporting...")
result = subprocess.run(
[pyre_path, "--output=json", "check"],
[pyre_path, "--binary", pyre_bin_path, "--output=json", "check"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=temporary_project_path,
Expand Down

0 comments on commit 4e280cc

Please sign in to comment.