Skip to content

Commit

Permalink
Add sapp to pyre open source release (2/n)
Browse files Browse the repository at this point in the history
Reviewed By: dkgi

Differential Revision: D19168340

fbshipit-source-id: fee2f07806c75acb3c269b80b573e3bf9184091a
  • Loading branch information
MaggieMoss authored and facebook-github-bot committed Dec 19, 2019
1 parent 43392a5 commit c7d4362
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/build-pypi-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ done
# Create build tree.
SCRIPTS_DIRECTORY="$(dirname "$("${READLINK}" -f "$0")")"

# sapp directory is either beside or inside pyre-check directory
SAPP_DIRECTORY="${SCRIPTS_DIRECTORY}/../tools/sapp/"
if [[ ! -d "${SAPP_DIRECTORY}" ]]; then
SAPP_DIRECTORY="${SCRIPTS_DIRECTORY}/../../sapp/"
fi



cd "${SCRIPTS_DIRECTORY}/"
BUILD_ROOT="$(mktemp -d)"
cd "${BUILD_ROOT}"
Expand All @@ -105,6 +113,11 @@ rsync -avm --filter='+ */' --filter='-! *.pysa' "${PYRE_ROOT}/stubs/taint" "${BU
rsync -avm --filter='+ */' --filter='-! *.pysa' "${PYRE_ROOT}/stubs/third_party_taint" "${BUILD_ROOT}/"
cp "${PYRE_ROOT}/stubs/taint/taint.config" "${BUILD_ROOT}/taint/taint.config"

# copy *.py and requirements.txt files from sapp, exclude everything else
rsync -avm --filter='- tests/' --filter='+ */' --filter='+ *.py' \
--filter='+ *requirements.json' --filter='- *' "${SAPP_DIRECTORY}" \
"${BUILD_ROOT}/${MODULE_NAME}/tools/sapp"

# Patch version number.
sed -i -e "/__version__/s/= \".*\"/= \"${PACKAGE_VERSION}\"/" "${BUILD_ROOT}/${MODULE_NAME}/client/version.py"

Expand Down
7 changes: 7 additions & 0 deletions scripts/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import glob
import json
import os
import sys
from typing import List, Tuple
Expand Down Expand Up @@ -54,6 +55,10 @@ def find_taint_stubs():
with open("README.md") as f:
long_description = f.read()

with open(
os.path.join("pyre_check", "tools", "sapp", "requirements.json")
) as json_file:
extra_requirements = json.load(json_file)

PYRE_EMAIL = "[email protected]"
AUTHOR = "Facebook"
Expand Down Expand Up @@ -89,10 +94,12 @@ def find_taint_stubs():
data_files=[("bin", ["bin/pyre.bin"])] + find_typeshed_files() + find_taint_stubs(),
python_requires=">=3.5",
install_requires=["pywatchman", "psutil", "libcst", "pyre_extensions"],
extras_require=extra_requirements,
entry_points={
"console_scripts": [
"pyre = pyre_check.client.pyre:main",
"pyre-upgrade = pyre_check.tools.upgrade.upgrade:main",
"sapp = pyre_check.tools.sapp.sapp.cli:cli [sapp]",
]
},
)

0 comments on commit c7d4362

Please sign in to comment.