Skip to content

Commit

Permalink
Prep for 1.12.0.dev0 release (#6718)
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion authored Nov 7, 2018
1 parent dbbff71 commit 4571d20
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 165 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Created by running `./build-support/bin/contributors.sh`.
+ Shuo Li
+ Simeon Franklin
+ Stefan Sauer
+ Stephan Erb
+ Stu Hood
+ Tansy Arron-Walker
+ Ted Dziuba
Expand Down
14 changes: 0 additions & 14 deletions contrib/go/src/python/pants/contrib/go/targets/go_local_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import os

from pants.base.exceptions import TargetDefinitionException
from pants.base.parse_context import ParseContext
from pants.base.payload import Payload
from pants.build_graph.address import Address
from pants.source.wrapped_globs import Globs

from pants.contrib.go.targets.go_target import GoTarget

Expand Down Expand Up @@ -50,18 +48,6 @@ def create(cls, parse_context, **kwargs):
parse_context.create_object(cls, type_alias=cls.alias(), name=name, **kwargs)

def __init__(self, address=None, payload=None, sources=None, **kwargs):
if not sources:
# We grab all files in the current directory except BUILD files for 2 reasons:
# 1. cgo: If a file imports "C" then it may rely on sibling .c, .cc, etc files that `go build`
# will compile.
# 2. resources: Even though go does not support them; ie by providing a protocol to embed them
# in binaries, it does allow them to be placed in a directory where a test might use them
# for example via plain old filesystem access.
globs = Globs(ParseContext(rel_path=address.spec_path, type_aliases={}))
sources = globs('*', exclude=[globs('BUILD*'),
# This skips subdir content.
globs('*/**')])

payload = payload or Payload()
payload.add_fields({
'sources': self.create_sources_field(sources=sources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def test_globs_cgo(self):
self.create_file('src/go/src/foo/jake.hh')
self.create_file('src/go/src/foo/jake.hpp')
self.create_file('src/go/src/foo/jake.hxx')
target = self.make_target(spec='src/go/src/foo', target_type=self.target_type)
self.add_to_build_file('src/go/src/foo', '{}()\n'.format(self.target_type.alias()))
target = self.target('src/go/src/foo')

self.assertEqual(sorted(['foo/jake.go',
'foo/jake.c',
Expand All @@ -113,7 +114,8 @@ def test_globs_resources(self):
# We should grab all of these though.
self.create_file('src/go/src/foo/jake.go')
self.create_file('src/go/src/foo/jake.png')
target = self.make_target(spec='src/go/src/foo', target_type=self.target_type)
self.add_to_build_file('src/go/src/foo', '{}()'.format(self.target_type.alias()))
target = self.target('src/go/src/foo')

self.assertEqual(sorted(['foo/jake.go',
'foo/jake.png']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from collections import defaultdict
from itertools import chain

from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.util.contextutil import pushd, temporary_dir
from pants.util.dirutil import safe_mkdir, touch
from pants_test.task_test_base import TaskTestBase
Expand All @@ -31,6 +32,10 @@ class GoWorkspaceTaskTest(TaskTestBase):
def task_type(cls):
return MockGoWorkspaceTask

@classmethod
def alias_groups(cls):
return BuildFileAliases(targets={'go_library': GoLibrary})

def test_remove_unused_links(self):
with temporary_dir() as d:
dpath = lambda p: os.path.join(d, p)
Expand Down Expand Up @@ -61,7 +66,9 @@ def test_symlink_local_src(self):
for src in sources:
self.create_file(os.path.join(spec, src))

go_lib = self.make_target(spec=spec, target_type=GoLibrary)
self.add_to_build_file(spec, 'go_library()')

go_lib = self.target(spec)
ws_task = self.create_task(self.context())
gopath = ws_task.get_gopath(go_lib)

Expand All @@ -80,7 +87,7 @@ def assert_is_linked(src):
# Add source file and re-make library.
self.create_file(os.path.join(spec, 'w.go'))
self.reset_build_graph()
go_lib = self.make_target(spec=spec, target_type=GoLibrary)
go_lib = self.target(spec)

ws_task._symlink_local_src(gopath, go_lib, set())
for src in chain(sources, ['w.go']):
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0rc0
1.12.0.dev0
13 changes: 1 addition & 12 deletions src/python/pants/backend/jvm/tasks/rewrite_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from pants.backend.jvm.tasks.nailgun_task import NailgunTask
from pants.base.build_environment import get_buildroot
from pants.base.deprecated import deprecated_conditional
from pants.base.exceptions import TaskError
from pants.option.custom_types import dir_option
from pants.process.xargs import Xargs
Expand All @@ -29,17 +28,7 @@ def register_options(cls, register):
default=cls.target_types(),
advanced=True, type=list,
help='The target types to apply formatting to.')
try:
sideeffecting = cls.sideeffecting
except AttributeError:
deprecated_conditional(
lambda: True,
'1.12.0.dev0',
"RewriteBase's sideeffecting property should be a class property, not an instance property "
"but class {} didn't have a class property.".format(cls.__name__),
)
sideeffecting = False
if sideeffecting:
if cls.sideeffecting:
register('--output-dir', advanced=True, type=dir_option, fingerprint=True,
help='Path to output directory. Any updated files will be written here. '
'If not specified, files will be modified in-place.')
Expand Down
23 changes: 2 additions & 21 deletions src/python/pants/build_graph/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from hashlib import sha1

from six import string_types
from twitter.common.collections import OrderedSet, maybe_list
from twitter.common.collections import OrderedSet

from pants.base.build_environment import get_buildroot
from pants.base.deprecated import deprecated_conditional
Expand All @@ -26,7 +26,7 @@
from pants.build_graph.target_scopes import Scope
from pants.fs.fs import safe_filename
from pants.source.payload_fields import SourcesField
from pants.source.wrapped_globs import EagerFilesetWithSpec, FilesetWithSpec, Globs
from pants.source.wrapped_globs import EagerFilesetWithSpec, FilesetWithSpec
from pants.subsystem.subsystem import Subsystem
from pants.util.memo import memoized_property

Expand Down Expand Up @@ -832,25 +832,6 @@ def supports_default_sources(cls):
"""Whether this target type can provide default sources if none were specified explicitly."""
return cls.default_sources_globs is not None

@classmethod
def default_sources(cls, sources_rel_path):
"""Provide sources, if they weren't specified explicitly in the BUILD file.
By default this globs over self.default_sources_globs (e.g., '*.java')
but subclasses can override to provide more nuanced default behavior.
In this case, the subclasses must also override supports_default_sources().
"""
if cls.default_sources_globs is not None:
if cls.default_sources_exclude_globs is not None:
exclude = [Globs.create_fileset_with_spec(sources_rel_path,
*maybe_list(cls.default_sources_exclude_globs))]
else:
exclude = []
return Globs.create_fileset_with_spec(sources_rel_path,
*maybe_list(cls.default_sources_globs),
exclude=exclude)
return None

# TODO: Inline this as SourcesField(sources=sources) when all callers are guaranteed to pass an
# EagerFilesetWithSpec.
def create_sources_field(self, sources, sources_rel_path, key_arg=None):
Expand Down
19 changes: 17 additions & 2 deletions src/python/pants/core_tasks/deferred_sources_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from pants.build_graph.address import Address
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.build_graph.remote_sources import RemoteSources
from pants.source.wrapped_globs import Files
from pants.engine.fs import PathGlobs, PathGlobsAndRoot
from pants.source.wrapped_globs import EagerFilesetWithSpec
from pants.task.task import Task


Expand Down Expand Up @@ -52,13 +53,27 @@ def process_remote_sources(self):
"""Create synthetic targets with populated sources from remote_sources targets."""
unpacked_sources = self.context.products.get_data('unpacked_archives')
remote_sources_targets = self.context.targets(predicate=lambda t: isinstance(t, RemoteSources))
if not remote_sources_targets:
return

snapshot_specs = []
filespecs = []
for target in remote_sources_targets:
sources, rel_unpack_dir = unpacked_sources[target.sources_target]
sources_in_dir = tuple(os.path.join(rel_unpack_dir, source) for source in sources)
snapshot_specs.append(PathGlobsAndRoot(
PathGlobs(sources_in_dir),
get_buildroot(),
))
filespecs.append({'globs': sources_in_dir})

snapshots = self.context._scheduler.capture_snapshots(tuple(snapshot_specs))
for target, snapshot, filespec in zip(remote_sources_targets, snapshots, filespecs):
synthetic_target = self.context.add_new_target(
address=Address(os.path.relpath(self.workdir, get_buildroot()), target.id),
target_type=target.destination_target_type,
dependencies=target.dependencies,
sources=Files.create_fileset_with_spec(rel_unpack_dir, *sources),
sources=EagerFilesetWithSpec(rel_unpack_dir, filespec, snapshot),
derived_from=target,
**target.destination_target_args
)
Expand Down
133 changes: 133 additions & 0 deletions src/python/pants/notes/master.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,139 @@ Master Pre-Releases
This document describes ``dev`` releases which occur weekly from master, and which do
not undergo the vetting associated with ``stable`` releases.

1.12.0.dev0 (11/06/2018)
------------------------

New Features
~~~~~~~~~~~~

* Compiler option sets for Native targets (#6665)
`PR #6665 <https://github.com/pantsbuild/pants/pull/6665>`_

* Add UI to engine execution (#6647)
`PR #6647 <https://github.com/pantsbuild/pants/pull/6647>`_

* Add support for un-cacheable rules, and stop caching console_rules (#6516)
`PR #6516 <https://github.com/pantsbuild/pants/pull/6516>`_

* test console_task which aggregates test results (#6646)
`PR #6646 <https://github.com/pantsbuild/pants/pull/6646>`_

* console_rules can exit with exit codes (#6654)
`PR #6654 <https://github.com/pantsbuild/pants/pull/6654>`_

* Allow v2-only goals to be implicitly registered (#6653)
`PR #6653 <https://github.com/pantsbuild/pants/pull/6653>`_

* Collection is iterable (#6649)
`PR #6649 <https://github.com/pantsbuild/pants/pull/6649>`_

* fall back to most recent known osx version for bootstrap binaries (#6681)
`PR #6681 <https://github.com/pantsbuild/pants/pull/6681>`_

Bugfixes
~~~~~~~~

* Fail build when setup-py run failed (#6693)
`PR #6693 <https://github.com/pantsbuild/pants/pull/6693>`_

* Move ivy/coursier link farms under versioned task directories (#6686)
`PR #6686 <https://github.com/pantsbuild/pants/pull/6686>`_

* Fix bugs in the parent/child relationship in ProcessManager (#6670)
`PR #6670 <https://github.com/pantsbuild/pants/pull/6670>`_

* Ensure that changing platforms invalidates pex binary creation (#6202)
`PR #6202 <https://github.com/pantsbuild/pants/pull/6202>`_

* Fix python lint dependency on pyprep goal (#6606)
`Issue #5764 <https://github.com/pantsbuild/pants/issues/5764>`_
`PR #6606 <https://github.com/pantsbuild/pants/pull/6606>`_

Refactoring, Improvements, and Tooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Upgrade to pex 1.5.2. (#6725)
`PR #6725 <https://github.com/pantsbuild/pants/pull/6725>`_

* Bump to jarjar 1.7.2 to pull in several fixes. (#6695)
`PR #6695 <https://github.com/pantsbuild/pants/pull/6695>`_

* Add test to assert that type validation works for Get (#6731)
`PR #6731 <https://github.com/pantsbuild/pants/pull/6731>`_

* Add a better error message for missing RootRules (#6712)
`PR #6712 <https://github.com/pantsbuild/pants/pull/6712>`_

* Fix Python 3 renaming assertRegexpMatches to assertRegex (#6723)
`PR #6723 <https://github.com/pantsbuild/pants/pull/6723>`_

* De-flake JarPublishTest. (#6726)
`PR #6726 <https://github.com/pantsbuild/pants/pull/6726>`_

* Fix Python 3 binary vs unicode integration test issues (#6724)
`PR #6724 <https://github.com/pantsbuild/pants/pull/6724>`_

* Remove unneeded allow(dead_code) (#6717)
`PR #6717 <https://github.com/pantsbuild/pants/pull/6717>`_

* Fix test get subprocess output interleaved py3k (#6713)
`PR #6713 <https://github.com/pantsbuild/pants/pull/6713>`_

* Disable deploy shard for PR (#6709)
`PR #6709 <https://github.com/pantsbuild/pants/pull/6709>`_

* Fixup `Checkstyle` local resolves. (#6707)
`PR #6707 <https://github.com/pantsbuild/pants/pull/6707>`_

* Update Node.js README file (#6664)
`PR #6664 <https://github.com/pantsbuild/pants/pull/6664>`_

* Match `stage` for `Deploy Pants Pex Unstable` (#6704)
`PR #6704 <https://github.com/pantsbuild/pants/pull/6704>`_

* [rsc-compile] Bump rsc and scala meta versions in rsc compile (#6683)
`PR #6683 <https://github.com/pantsbuild/pants/pull/6683>`_

* Revert "Convert release.sh from bash to python [part 1] (#6674)" (#6699)
`PR #6674 <https://github.com/pantsbuild/pants/pull/6674>`_

* Pause all PantsService threads before forking a pantsd-runner (#6671)
`PR #6671 <https://github.com/pantsbuild/pants/pull/6671>`_

* Python3 unit test fixes pt1 (#6698)
`PR #6698 <https://github.com/pantsbuild/pants/pull/6698>`_

* Deploy pex every commit on master and branch (#6694)
`PR #6694 <https://github.com/pantsbuild/pants/pull/6694>`_

* Fix flaky list comparison test (#6688)
`PR #6688 <https://github.com/pantsbuild/pants/pull/6688>`_

* Do not compile native targets if they contain just header files (#6692)
`PR #6692 <https://github.com/pantsbuild/pants/pull/6692>`_

* Update PyPI default URL to pypi.org (#6691)
`PR #6691 <https://github.com/pantsbuild/pants/pull/6691>`_

* Re-add used-but-removed futures dep, which (due to a PR race) had a new usage added in 01c807ef, but its declaration removed in faeaf078. (#6680)
`PR #6680 <https://github.com/pantsbuild/pants/pull/6680>`_

* Remove the FSEventService pool in favor of execution on the dedicated service thread. (#6667)
`PR #6667 <https://github.com/pantsbuild/pants/pull/6667>`_

* Convert release.sh from bash to python [part 1] (#6674)
`PR #6674 <https://github.com/pantsbuild/pants/pull/6674>`_

* Make PailgunServer multithreaded in order to avoid blocking the PailgunService thread. (#6669)
`PR #6669 <https://github.com/pantsbuild/pants/pull/6669>`_

* add some more context to errors locating the native engine binary (#6575)
`PR #6575 <https://github.com/pantsbuild/pants/pull/6575>`_

* Remove broken pants_dev broken image (#6655)
`PR #6655 <https://github.com/pantsbuild/pants/pull/6655>`_

1.11.0rc0 (10/16/2018)
----------------------

Expand Down
2 changes: 1 addition & 1 deletion tests/python/pants_test/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from pants_test.option.util.fakes import create_options_for_optionables


deprecated_module('1.12.0.dev0', 'Use pants_test.test_base instead')
deprecated_module('1.12.0.dev2', 'Use pants_test.test_base instead')


class TestGenerator(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

class BuildFileAliasesTest(unittest.TestCase):

class RedTarget(Target):
pass

class BlueTarget(Target):
pass

Expand All @@ -26,7 +23,7 @@ def setUp(self):
lambda ctx: ctx.create_object(self.BlueTarget,
type_alias='jill',
name=os.path.basename(ctx.rel_path)),
self.BlueTarget, self.RedTarget)
self.BlueTarget)

def test_create(self):
self.assertEqual(BuildFileAliases(targets={},
Expand Down Expand Up @@ -126,5 +123,5 @@ def test_target_macro_factories(self):

def test_target_types_by_alias(self):
aliases = BuildFileAliases(targets={'jake': Target, 'jill': self.target_macro_factory})
self.assertEqual({'jake': {Target}, 'jill': {self.BlueTarget, self.RedTarget}},
self.assertEqual({'jake': {Target}, 'jill': {self.BlueTarget}},
aliases.target_types_by_alias)
Loading

0 comments on commit 4571d20

Please sign in to comment.