Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pantsbuild/pants into fix-union-f…
Browse files Browse the repository at this point in the history
…ields
  • Loading branch information
Eric-Arellano committed Jul 28, 2020
2 parents 9f5abd0 + f6ffe46 commit c98883d
Show file tree
Hide file tree
Showing 21 changed files with 213 additions and 160 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ jobs:
dist: xenial
env:
- CACHE_NAME=clippy
if: commit_message !~ /\[ci skip-rust-tests\]/
if: commit_message !~ /\[ci skip-rust\]/
name: Clippy (Rust linter)
os: linux
script:
Expand Down Expand Up @@ -530,7 +530,7 @@ jobs:
env:
- CACHE_NAME=rust_tests.linux
- LD_LIBRARY_PATH="/opt/python/3.6.7/lib:${LD_LIBRARY_PATH}"
if: commit_message !~ /\[ci skip-rust-tests\]/
if: commit_message !~ /\[ci skip-rust\]/
name: Rust tests - Linux
os: linux
script:
Expand Down Expand Up @@ -563,7 +563,7 @@ jobs:
- PATH="${PYENV_ROOT}/versions/${PYENV_PY37_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${PYENV_PY38_VERSION}/bin:${PATH}"
- CACHE_NAME=rust_tests.osx
if: commit_message !~ /\[ci skip-rust-tests\]/
if: commit_message !~ /\[ci skip-rust\]/
name: Rust tests - OSX
os: osx
osx_image: xcode8
Expand Down Expand Up @@ -615,6 +615,7 @@ jobs:
- PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem
- PREPARE_DEPLOY=1
- CACHE_NAME=wheels.linux
if: commit_message !~ /\[ci skip-build-wheels\]/
language: python
name: Build Linux wheels and fs_util
os: linux
Expand Down Expand Up @@ -667,6 +668,7 @@ jobs:
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
- PREPARE_DEPLOY=1
- CACHE_NAME=wheels.osx
if: commit_message !~ /\[ci skip-build-wheels\]/
language: generic
name: Build macOS wheels and fs_util
os: osx
Expand Down
5 changes: 4 additions & 1 deletion build-support/bin/generate_travis_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ def osx_shard(


# See https://docs.travis-ci.com/user/conditions-v1.
SKIP_RUST_CONDITION = r"commit_message !~ /\[ci skip-rust-tests\]/"
SKIP_RUST_CONDITION = r"commit_message !~ /\[ci skip-rust\]/"
SKIP_WHEELS_CONDITION = r"commit_message !~ /\[ci skip-build-wheels\]/"

# ----------------------------------------------------------------------
# Bootstrap engine
Expand Down Expand Up @@ -592,6 +593,7 @@ def build_wheels_linux() -> Dict:
**linux_shard(use_docker=True),
"name": "Build Linux wheels and fs_util",
"script": [docker_build_travis_ci_image(), docker_run_travis_ci_image(command)],
"if": SKIP_WHEELS_CONDITION,
}
safe_extend(shard, "env", _build_wheels_env(platform=Platform.linux))
return shard
Expand All @@ -607,6 +609,7 @@ def build_wheels_osx() -> Dict:
python_versions=[PythonVersion.py36, PythonVersion.py37, PythonVersion.py38],
install_py27=False,
),
"if": SKIP_WHEELS_CONDITION,
}
safe_extend(shard, "env", _build_wheels_env(platform=Platform.osx))
return shard
Expand Down
26 changes: 22 additions & 4 deletions build-support/githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,22 @@ NUM_RUST_FILES=$(echo "${CHANGED_FILES})" | grep -c -E \
-e "^build-support/bin/native" \
-e "^build-support/bin/generate_travis_yml.py")

NUM_RELEASE_FILES=$(echo "${CHANGED_FILES})" | grep -c -E \
-e "^src/python/pants/VERSION" \
-e "^src/python/pants/notes" \
-e "^src/rust/engine/fs/fs_util" \
-e "^build-support/bin/release.sh" \
-e "^build-support/bin/packages.py" \
-e "^build-support/bin/generate_travis_yml.py")

# To avoid putting skip labels multiple times, check if the labels already exist
# in the commit message.
grep "\[ci skip-rust-tests\]" "${COMMIT_MSG_FILEPATH}" > /dev/null
HAS_RUST_SKIP=$?
grep "\[ci skip\]" "${COMMIT_MSG_FILEPATH}" > /dev/null
HAS_CI_SKIP=$?
grep "\[ci skip-rust\]" "${COMMIT_MSG_FILEPATH}" > /dev/null
HAS_RUST_SKIP=$?
grep "\[ci skip-build-wheels\]" "${COMMIT_MSG_FILEPATH}" > /dev/null
HAS_WHEELS_SKIP=$?

if [[ "${HAS_CI_SKIP}" -eq 1 ]] && [ "${NUM_NON_MD_FILES}" -eq 0 ]; then
cat <<EOF >> "${COMMIT_MSG_FILEPATH}"
Expand All @@ -43,7 +53,15 @@ fi
if [[ "${HAS_RUST_SKIP}" -eq 1 ]] && [ "${NUM_RUST_FILES}" -eq 0 ]; then
cat <<EOF >> "${COMMIT_MSG_FILEPATH}"
# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
EOF
fi

if [[ "${HAS_WHEELS_SKIP}" -eq 1 ]] && [ "${NUM_RELEASE_FILES}" -eq 0 ]; then
cat <<EOF >> "${COMMIT_MSG_FILEPATH}"
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
EOF
fi
3 changes: 1 addition & 2 deletions src/python/pants/backend/python/lint/bandit/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
SourceFiles,
SpecifiedSourceFilesRequest,
)
from pants.engine.fs import Digest, MergeDigests, PathGlobs
from pants.engine.fs import Digest, GlobMatchErrorBehavior, MergeDigests, PathGlobs
from pants.engine.process import FallibleProcessResult, Process
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
from pants.engine.target import FieldSetWithOrigin
from pants.engine.unions import UnionRule
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.strutil import pluralize

Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/backend/python/lint/black/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
SourceFiles,
SpecifiedSourceFilesRequest,
)
from pants.engine.fs import EMPTY_SNAPSHOT, Digest, MergeDigests, PathGlobs
from pants.engine.fs import EMPTY_SNAPSHOT, Digest, GlobMatchErrorBehavior, MergeDigests, PathGlobs
from pants.engine.process import FallibleProcessResult, Process, ProcessResult
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
from pants.engine.target import FieldSetWithOrigin
from pants.engine.unions import UnionRule
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.strutil import pluralize

Expand Down
10 changes: 8 additions & 2 deletions src/python/pants/backend/python/lint/flake8/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@
SourceFiles,
SpecifiedSourceFilesRequest,
)
from pants.engine.fs import Digest, DigestSubset, MergeDigests, PathGlobs, Snapshot
from pants.engine.fs import (
Digest,
DigestSubset,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
Snapshot,
)
from pants.engine.process import FallibleProcessResult, Process
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
from pants.engine.target import FieldSetWithOrigin
from pants.engine.unions import UnionRule
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.strutil import pluralize

Expand Down
11 changes: 8 additions & 3 deletions src/python/pants/backend/python/lint/isort/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@
SourceFiles,
SpecifiedSourceFilesRequest,
)
from pants.engine.fs import EMPTY_SNAPSHOT, Digest, MergeDigests, PathGlobs
from pants.engine.fs import (
EMPTY_SNAPSHOT,
Digest,
GlobExpansionConjunction,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
from pants.engine.process import FallibleProcessResult, Process, ProcessResult
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
from pants.engine.target import FieldSetWithOrigin
from pants.engine.unions import UnionRule
from pants.option.custom_types import GlobExpansionConjunction
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.strutil import pluralize

Expand Down
10 changes: 8 additions & 2 deletions src/python/pants/backend/python/lint/pylint/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
from pants.core.util_rules import determine_source_files, strip_source_roots
from pants.core.util_rules.determine_source_files import SourceFiles, SpecifiedSourceFilesRequest
from pants.engine.addresses import Address, Addresses
from pants.engine.fs import EMPTY_DIGEST, AddPrefix, Digest, MergeDigests, PathGlobs
from pants.engine.fs import (
EMPTY_DIGEST,
AddPrefix,
Digest,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
from pants.engine.process import FallibleProcessResult, Process
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
Expand All @@ -44,7 +51,6 @@
TransitiveTargets,
)
from pants.engine.unions import UnionRule
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.meta import frozen_after_init
from pants.util.strutil import pluralize
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/rules/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
Digest,
DigestContents,
FileContent,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
Expand All @@ -44,7 +45,6 @@
from pants.engine.target import TransitiveTargets
from pants.engine.unions import UnionRule
from pants.option.custom_types import file_option
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup


Expand Down
11 changes: 8 additions & 3 deletions src/python/pants/backend/python/rules/pex_from_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@
PythonRequirementsField,
)
from pants.engine.addresses import Address, Addresses
from pants.engine.fs import Digest, DigestContents, MergeDigests, PathGlobs
from pants.engine.fs import (
Digest,
DigestContents,
GlobExpansionConjunction,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
from pants.engine.rules import RootRule, rule
from pants.engine.selectors import Get
from pants.engine.target import TransitiveTargets
from pants.option.custom_types import GlobExpansionConjunction
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.meta import frozen_after_init

Expand Down
10 changes: 8 additions & 2 deletions src/python/pants/backend/python/typecheck/mypy/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@
from pants.core.goals.typecheck import TypecheckRequest, TypecheckResult, TypecheckResults
from pants.core.util_rules import determine_source_files, pants_bin, strip_source_roots
from pants.engine.addresses import Addresses
from pants.engine.fs import CreateDigest, Digest, FileContent, MergeDigests, PathGlobs
from pants.engine.fs import (
CreateDigest,
Digest,
FileContent,
GlobMatchErrorBehavior,
MergeDigests,
PathGlobs,
)
from pants.engine.process import FallibleProcessResult, Process
from pants.engine.rules import SubsystemRule, rule
from pants.engine.selectors import Get, MultiGet
from pants.engine.target import FieldSetWithOrigin, TransitiveTargets
from pants.engine.unions import UnionRule
from pants.option.global_options import GlobMatchErrorBehavior
from pants.python.python_setup import PythonSetup
from pants.util.strutil import pluralize

Expand Down
4 changes: 1 addition & 3 deletions src/python/pants/base/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple, Union, cast

from pants.engine.collection import Collection
from pants.engine.fs import PathGlobs
from pants.option.custom_types import GlobExpansionConjunction
from pants.option.global_options import GlobMatchErrorBehavior
from pants.engine.fs import GlobExpansionConjunction, GlobMatchErrorBehavior, PathGlobs
from pants.util.collections import assert_single_element
from pants.util.dirutil import fast_relpath_optional, recursive_dirname
from pants.util.filtering import and_filters, create_filters
Expand Down

0 comments on commit c98883d

Please sign in to comment.