Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
Prepare the 1.3.0-dev0 release
Browse files Browse the repository at this point in the history
* Remove deprecations that were targeted at 1.3.0 (see committers list).
* Update contributors.
* Bump version.
* Update notes for 1.3.0dev0.
* Cherry-pick 1.2.0rc1 notes from the stable branch (see release doc update in this change for the recommendation to avoid this in the future).
* Update release docs for stable releases to suggest committing notes for stable releases to master first, and then cherry-picking them to the branch.

Testing Done:
https://travis-ci.org/pantsbuild/pants/builds/167824634

Bugs closed: 3965

Reviewed at https://rbcommons.com/s/twitter/r/4311/
  • Loading branch information
stuhood committed Oct 15, 2016
1 parent 1d1442f commit cd4d9ac
Show file tree
Hide file tree
Showing 22 changed files with 134 additions and 393 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run_pants(self, command, config=None, stdin_data=None, extra_env=None, **kwa
full_config = {
'GLOBAL': {
'pythonpath': ["%(buildroot)s/contrib/findbugs/src/python"],
'backend_packages': ["pants.contrib.findbugs"]
'backend_packages': ["pants.backend.codegen", "pants.backend.jvm", "pants.contrib.findbugs"]
}
}
if config:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def run_pants(self, command, config=None, stdin_data=None, extra_env=None, **kwa
full_config = {
'GLOBAL': {
'pythonpath': ["%(buildroot)s/contrib/scrooge/src/python"],
'backend_packages': ["pants.contrib.scrooge"]
'backend_packages': ["pants.backend.codegen", "pants.backend.jvm", "pants.contrib.scrooge"]
},
}
if config:
Expand Down
24 changes: 13 additions & 11 deletions src/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,24 @@ the release manager may also need to do a release from a stable branch.*
4. Bring the CONTRIBUTORS roster (from master) in
[CONTRIBUTORS.md](https://github.com/pantsbuild/pants/tree/master/CONTRIBUTORS.md)
up to date by running `build-support/bin/contributors.sh`.
5. If creating the release candidate create the stable branch from the commit you use to do the
release. For example if you were releasing `1.2.0rc0`, create the branch `1.2.x` from your
release commit.
6. Create a review for changes in the master branch and indicate `master` in the branch field.
5. Create and land a review for changes in the master branch.
6. Execute the release as described later on this page.
7. Finally, if creating a release candidate, create the stable branch from the commit in
master for your release. For example if you were releasing `1.2.0rc0`, create the branch
`1.2.x` from your release commit.

* ###Preparation for the release from the stable branch
See [Release Strategy](http://pantsbuild.github.io/release_strategy.html) for more details about
whether a release is needed from a stable branch.
1. Cherry pick changes that have been identified in the [backport proposals](https://docs.google.com/spreadsheets/d/12rsaVVhmSXrMVlZV6PUu5uzsKNNcceP9Lpf7rpju_IE/edit#gid=0)
2. In your release branch: Edit the version number in `src/python/pants/version.py`
3. Update `src/python/pants/notes/*.rst` to reflect the changes for this week (can use
`build-support/bin/release-changelog-helper.sh` to get a head start). For example if
you were releasing 1.2.0rc1 you would need to create `src/python/pants/notes/1.2.x.rst`.
4. Cherry pick changes to branch specific notes back to master.
5. Create a review for changes in the stable branch and indicate the stable
branch name in the branch field.
directly to the stable branch.
2. In master, update `src/python/pants/notes/*.rst` to reflect all patches that were
cherry-picked (can use `build-support/bin/release-changelog-helper.sh` to get a head start).
For example if you were releasing 1.2.0rc1 you would edit `src/python/pants/notes/1.2.x.rst`.
3. Create and land a review for the notes changes in master.
4. Cherry pick the merged notes changes from master to the release branch.
5. In your release branch: edit and commit the version number in `src/python/pants/version.py`.
6. Execute the release as described later on this page.

Dry Run (Optional)
------------------
Expand Down
52 changes: 21 additions & 31 deletions src/python/pants/backend/jvm/tasks/junit_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ def register_options(cls, register):
choices=junit_tests.VALID_CONCURRENCY_OPTS, default=junit_tests.CONCURRENCY_SERIAL,
help='Set the default concurrency mode for running tests not annotated with'
' @TestParallel or @TestSerial.')
register('--default-parallel', advanced=True, type=bool,
removal_hint='Use --default-concurrency instead.', removal_version='1.3.0',
help='Run classes without @TestParallel or @TestSerial annotations in parallel.')
register('--parallel-threads', advanced=True, type=int, default=0,
help='Number of threads to run tests in parallel. 0 for autoset.')
register('--test-shard', advanced=True,
Expand Down Expand Up @@ -236,36 +233,29 @@ def _args(self, output_dir):
if options.per_test_timer:
args.append('-per-test-timer')

if options.default_parallel:
# TODO(zundel): Remove when --default_parallel finishes deprecation
if options.default_concurrency != junit_tests.CONCURRENCY_SERIAL:
self.context.log.warn('--default-parallel overrides --default-concurrency')
if options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_CLASSES_AND_METHODS:
if not options.use_experimental_runner:
self.context.log.warn('--default-concurrency=PARALLEL_CLASSES_AND_METHODS is '
'experimental, use --use-experimental-runner.')
args.append('-default-concurrency')
args.append('PARALLEL_CLASSES_AND_METHODS')
elif options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_METHODS:
if not options.use_experimental_runner:
self.context.log.warn('--default-concurrency=PARALLEL_METHODS is experimental, use '
'--use-experimental-runner.')
if options.test_shard:
# NB(zundel): The experimental junit runner doesn't support test sharding natively. The
# legacy junit runner allows both methods and classes to run in parallel with this option.
self.context.log.warn('--default-concurrency=PARALLEL_METHODS with test sharding will '
'run classes in parallel too.')
args.append('-default-concurrency')
args.append('PARALLEL_METHODS')
elif options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_CLASSES:
args.append('-default-concurrency')
args.append('PARALLEL_CLASSES')
else:
if options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_CLASSES_AND_METHODS:
if not options.use_experimental_runner:
self.context.log.warn('--default-concurrency=PARALLEL_CLASSES_AND_METHODS is '
'experimental, use --use-experimental-runner.')
args.append('-default-concurrency')
args.append('PARALLEL_CLASSES_AND_METHODS')
elif options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_METHODS:
if not options.use_experimental_runner:
self.context.log.warn('--default-concurrency=PARALLEL_METHODS is experimental, use '
'--use-experimental-runner.')
if options.test_shard:
# NB(zundel): The experimental junit runner doesn't support test sharding natively. The
# legacy junit runner allows both methods and classes to run in parallel with this option.
self.context.log.warn('--default-concurrency=PARALLEL_METHODS with test sharding will '
'run classes in parallel too.')
args.append('-default-concurrency')
args.append('PARALLEL_METHODS')
elif options.default_concurrency == junit_tests.CONCURRENCY_PARALLEL_CLASSES:
args.append('-default-concurrency')
args.append('PARALLEL_CLASSES')
elif options.default_concurrency == junit_tests.CONCURRENCY_SERIAL:
args.append('-default-concurrency')
args.append('SERIAL')
elif options.default_concurrency == junit_tests.CONCURRENCY_SERIAL:
args.append('-default-concurrency')
args.append('SERIAL')

args.append('-parallel-threads')
args.append(str(options.parallel_threads))
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/bin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ python_library(
':extension_loader',
':plugin_resolver',
'src/python/pants/base:build_environment',
'src/python/pants/base:deprecated',
'src/python/pants/base:exceptions',
'src/python/pants/engine/legacy:change_calculator',
'src/python/pants/goal:goal',
Expand Down
21 changes: 1 addition & 20 deletions src/python/pants/bin/options_initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import pkg_resources

from pants.base.build_environment import pants_version
from pants.base.deprecated import deprecated_conditional
from pants.base.exceptions import BuildConfigurationError
from pants.bin.extension_loader import load_backends_and_plugins
from pants.bin.plugin_resolver import PluginResolver
Expand Down Expand Up @@ -150,28 +149,10 @@ def setup(self, init_logging=True):

# Conditionally load backends/plugins and materialize a `BuildConfiguration` object.
if not self._has_build_configuration():
missing = (set(global_bootstrap_options.default_backend_packages).difference(
global_bootstrap_options.backend_packages))
deprecated_conditional(
lambda: len(missing) > 0,
'1.3.0',
'default_backend_packages option',
'You are relying on the following backends being listed in the deprecated '
'default_backend_packages option: {}.\n '
'This is probably because you are overwriting the value of the backend_packages option '
'in your pants.ini, instead of appending to it.\n To get rid of this message, consider '
'changing backend_packages: [...] to backend_packages: +[...] in your pants.ini. '
'Once you are happy with the state of your backend_packages option, you can set '
'default_backend_packages to [] to silence this warning.'.format(
', '.join(missing))
)

backends = (global_bootstrap_options.default_backend_packages +
global_bootstrap_options.backend_packages)
build_configuration = self._load_plugins(self._working_set,
global_bootstrap_options.pythonpath,
global_bootstrap_options.plugins,
backends)
global_bootstrap_options.backend_packages)
self._set_build_configuration(build_configuration)
else:
build_configuration = self._get_build_configuration()
Expand Down
56 changes: 0 additions & 56 deletions src/python/pants/build_graph/from_target.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/python/pants/build_graph/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pants.base.build_environment import get_buildroot, pants_version
from pants.build_graph.aliased_target import AliasTargetFactory
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.build_graph.from_target import FromTarget
from pants.build_graph.intransitive_dependency import (IntransitiveDependencyFactory,
ProvidedDependencyFactory)
from pants.build_graph.prep_command import PrepCommand
Expand Down Expand Up @@ -52,7 +51,6 @@ def build_file_aliases():
},
context_aware_object_factories={
'buildfile_path': BuildFilePath,
'from_target': FromTarget,
'globs': Globs,
'intransitive': IntransitiveDependencyFactory,
'provided': ProvidedDependencyFactory,
Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/build_graph/source_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from collections import defaultdict

from pants.build_graph.build_file_address_mapper import BuildFileAddressMapper
from pants.source.payload_fields import DeferredSourcesField


class SourceMapper(object):
Expand Down Expand Up @@ -73,7 +72,7 @@ def _find_targets_for_source(self, source, spec_path):
break

def _sources_match(self, source, sources):
if not sources or isinstance(sources, DeferredSourcesField):
if not sources:
return False
return sources.matches(source)

Expand Down
20 changes: 3 additions & 17 deletions src/python/pants/build_graph/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
from pants.base.payload import Payload
from pants.base.payload_field import PrimitiveField
from pants.base.validation import assert_list
from pants.build_graph.address import Address, Addresses
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.build_graph.target_addressable import TargetAddressable
from pants.build_graph.target_scopes import Scope
from pants.source.payload_fields import DeferredSourcesField, SourcesField
from pants.source.payload_fields import SourcesField
from pants.source.wrapped_globs import Files, FilesetWithSpec
from pants.subsystem.subsystem import Subsystem
from pants.util.memo import memoized_property
Expand Down Expand Up @@ -619,10 +618,7 @@ def traversable_dependency_specs(self):
graph and linked in the graph as dependencies of this target
:rtype: list of strings
"""
# To support DeferredSourcesField
for name, payload_field in self.payload.fields:
if isinstance(payload_field, DeferredSourcesField) and payload_field.address:
yield payload_field.address.spec
return []

@property
def dependencies(self):
Expand Down Expand Up @@ -753,17 +749,7 @@ def create_sources_field(self, sources, sources_rel_path, address=None, key_arg=
:rtype: SourcesField
"""

if isinstance(sources, Addresses):
# Currently, this is only created by the result of from_target() which takes a single argument
if len(sources.addresses) != 1:
key_arg_section = "'{}' to be ".format(key_arg) if key_arg else ""
spec_section = " to '{}'".format(address.spec) if address else ""
raise self.WrongNumberOfAddresses(
"Expected {key_arg_section}a single address to from_target() as argument{spec_section}"
.format(key_arg_section=key_arg_section, spec_section=spec_section))
referenced_address = Address.parse(sources.addresses[0], relative_to=sources.rel_path)
return DeferredSourcesField(ref_address=referenced_address)
elif sources is None:
if sources is None:
sources = FilesetWithSpec.empty(sources_rel_path)
elif isinstance(sources, FilesetWithSpec):
pass
Expand Down
46 changes: 2 additions & 44 deletions src/python/pants/core_tasks/deferred_sources_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
import os

from pants.base.build_environment import get_buildroot
from pants.base.deprecated import warn_or_error
from pants.base.exceptions import TargetDefinitionException
from pants.build_graph.address import Address
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.build_graph.from_target import from_target_deprecation_hint
from pants.build_graph.remote_sources import RemoteSources
from pants.source.payload_fields import DeferredSourcesField
from pants.source.wrapped_globs import Files
from pants.task.task import Task

Expand Down Expand Up @@ -56,45 +52,8 @@ def prepare(cls, options, round_manager):
@classmethod
def register_options(cls, register):
register('--allow-from-target', default=True, type=bool,
help='Allows usage of `from_target` in BUILD files. If false, usages of `from_target` '
'will cause errors to be thrown. This will allow individual repositories to '
'disable the use of `from_target` in advance of its deprecation.')

def map_deferred_sources(self):
"""Inject sources into targets that set their sources to from_target() objects."""
deferred_sources_fields = []
def find_deferred_sources_fields(target):
for name, payload_field in target.payload.fields:
if isinstance(payload_field, DeferredSourcesField):
if not self.get_options().allow_from_target:
raise TargetDefinitionException(target, from_target_deprecation_hint)
warn_or_error(
removal_version='1.3.0',
deprecated_entity_description='DeferredSourcesField',
hint=from_target_deprecation_hint,
)
deferred_sources_fields.append((target, name, payload_field))
addresses = [target.address for target in self.context.targets()]
self.context.build_graph.walk_transitive_dependency_graph(addresses,
find_deferred_sources_fields)

unpacked_sources = self.context.products.get_data('unpacked_archives')
for (target, name, payload_field) in deferred_sources_fields:
sources_target = self.context.build_graph.get_target(payload_field.address)
if not sources_target:
raise self.SourcesTargetLookupError(
"Couldn't find {sources_spec} referenced from {target} field {name} in build graph"
.format(sources_spec=payload_field.address.spec, target=target.address.spec, name=name))
if not sources_target in unpacked_sources:
raise self.NoUnpackedSourcesError(
"Target {sources_spec} referenced from {target} field {name} did not unpack any sources"
.format(spec=sources_target.address.spec, target=target.address.spec, name=name))
sources, rel_unpack_dir = unpacked_sources[sources_target]
# We have no idea if rel_unpack_dir matches any of our source root patterns, so
# we explicitly register it here.
# TODO: Is there any way to know the lang and/or the category and provide it here?
self.context.source_roots.add_source_root(rel_unpack_dir)
payload_field.populate(sources, rel_unpack_dir)
removal_hint='from_target was removed in 1.3.0', removal_version='1.5.0',
help='This option has no effect, because from_target has been removed.')

def process_remote_sources(self):
"""Create synthetic targets with populated sources from remote_sources targets."""
Expand All @@ -114,5 +73,4 @@ def process_remote_sources(self):
self.context.build_graph.inject_dependency(dependent, synthetic_target.address)

def execute(self):
self.map_deferred_sources()
self.process_remote_sources()
3 changes: 1 addition & 2 deletions src/python/pants/engine/legacy/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from six import string_types

from pants.build_graph.address import Addresses
from pants.engine.addressable import Exactly, addressable_list
from pants.engine.fs import PathGlobs
from pants.engine.objects import Locatable
Expand Down Expand Up @@ -39,7 +38,7 @@ def has_concrete_sources(self):
see: https://github.com/pantsbuild/pants/issues/2997
"""
sources = getattr(self, 'sources', None)
return sources is not None and not isinstance(sources, Addresses)
return sources is not None

@property
def field_adaptors(self):
Expand Down
Loading

0 comments on commit cd4d9ac

Please sign in to comment.