• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 35299 / 4
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: fix/single-source-hydration
DEFAULT BRANCH: main
Ran 09 Sep 2020 06:30PM UTC
Files 433
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Sep 2020 05:58PM UTC coverage: 0.0%. Remained the same
PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py36

push

travis-ci-com

web-flow
Fix MyPy to work by default with Python 3.6+ code and Black with 3.8+ code (#10750)

### Problem

MyPy and Black both use typed-ast for parsing, just like we use it for dependency inference. Typed-ast understands Py27 and 34-37, but not Py38. For Py38, you instead must run with a Python 3.8 interpreter (which also understands 27 and 34-37).

This meant that our default Black and MyPy installations would break if encountering Py38 syntax like the walrus operator. You had to explicitly set `--black-interpreter-constrains` and `--mypy-interpreter-constraints`, which is not at all obvious.

### Solution

Detect if the user has constraints for 3.8+. If so, use the constraints `>=3.8` for the tools. Otherwise, use the tool's default constraints.

We check that the constraints do not include anything less than 3.8, such as 3.7. Why? If they need to support 3.7, then a user won't be using 3.8 syntax. We don't want to constraint to `>=3.8` because this would mean that they must have 3.8 on their machine, even though 3.7 would do just fine.

To facilitate this, we change `PexInterpreterConstraints` to store parsed `Requirement` objects.

#### Also fixes MyPy handing of Python 3.6 and Python 3.7

If the user leaves off `python_version`, MyPy defaults to the version of the interpreter used to run. MyPy also tells the AST parser to target this specific `python_version`. So, if you're running with our minimum requirement of Python 3.5, it will fail to parse any Python 3.6+ code like f-strings, unless you specifically set `python_version` in `mypy.ini`.

We apply the same fix as above so that MyPy now also works "out of the box" with Python 3.6-only and 3.7-only codebases. If users set `python_version` in `mypy.ini`, MyPy will respect this - we only influence the default behavior.

### Result

Toolchain's Python 3.8 codebase now works "out of the box" with Pants, i.e. without extra settings. Pants's codebase, which uses Py36, also works out of ... (continued)

0 of 29258 relevant lines covered (0.0%)

0.0 hits per line

Source Files on job 35299.4 (PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py36)
  • Tree
  • List 0
  • Changed 14
  • Source Changed 14
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13402
  • Travis Job 35299.4
  • 54b9a798 on github
  • Prev Job for PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py37 on master (#35298.4)
  • Next Job for PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py36 on master (#35301.5)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc