curved-wall-59116
12/10/2021, 10:51 AMmypy==0.91
for type checking. When my colleague runs ./pants typecheck <projects/project>
it works pretty well.
When i run it, it will solve the constraints.txt file, and it takes 25+ mins. How come it runs so slowly on my computer?curved-television-6568
12/10/2021, 10:58 AMcurved-wall-59116
12/10/2021, 11:18 AM#!/usr/bin/env bash
set -euo pipefail
# You can change these constants.
PYTHON_BIN=python3.8
VIRTUALENV=.venv
PIP="${VIRTUALENV}/bin/pip"
CONSTRAINTS_FILE=constraints.txt
"${PYTHON_BIN}" -m venv "${VIRTUALENV}"
source .venv/bin/activate
echo "Installing pip"
"${PIP}" install pip --upgrade
echo "Installing poetry"
"${PIP}" install poetry
# Install all our requirements.txt, and also any 3rdparty
# dependencies specified outside requirements.txt, e.g. via a
# handwritten python_requirement_library target.
echo "Poetry update"
poetry update
echo "Installing dependencies"
"${PIP}" install -r <(poetry export --dev --without-hashes) -r <(./pants dependencies --type=3rdparty ::)
echo "Remove lockfile"
rm poetry.lock
echo "Generating constraints.txt"
rm constraints.txt
#pip uninstall pkg-resources==0.0.0 -y
pip list --format freeze >> constraints.txt
And this should be the same for everyone using our monorepomodern-wolf-36228
12/10/2021, 11:25 AMbrash-baker-91190
12/10/2021, 11:44 AMpkg-resources
and pkg_resources
🤔 )... https://stackoverflow.com/questions/39577984/what-is-pkg-resources-0-0-0-in-output-of-pip-freeze-commandcurved-wall-59116
12/10/2021, 12:04 PMbrash-baker-91190
12/10/2021, 1:54 PM./pants dependencies --type=3rdparty ::
), which doesn't output anything about pkg-resources
. We end up just filtering that out with a tasteful `grep -v`: https://github.com/grapl-security/grapl/blob/04f6869f723b353471f466c843a3f9c33e83171e/build-support/manage_virtualenv.sh#L59-L61brash-baker-91190
12/10/2021, 1:55 PMhappy-kitchen-89482
12/10/2021, 2:55 PMhappy-kitchen-89482
12/10/2021, 2:56 PMhappy-kitchen-89482
12/10/2021, 2:56 PMhappy-kitchen-89482
12/10/2021, 2:57 PMhappy-kitchen-89482
12/10/2021, 2:57 PMhappy-kitchen-89482
12/10/2021, 2:58 PMhappy-kitchen-89482
12/10/2021, 2:58 PMhappy-kitchen-89482
12/10/2021, 2:59 PMcurved-wall-59116
12/10/2021, 3:41 PMpants 2.7
And when pants has cached the constraints the constraints solving is fast. However if i rename a file, add a new one or a new dependency it all has to be redone. Will try what you posted above, when it finishes solving again 🙂happy-kitchen-89482
12/10/2021, 4:03 PMhappy-kitchen-89482
12/10/2021, 4:04 PMcurved-wall-59116
12/10/2021, 4:25 PMcurved-wall-59116
12/10/2021, 4:25 PMhappy-kitchen-89482
12/10/2021, 4:35 PMpip install -r constraints.txt
in a clean virtualenv?