Skip to content

Commit

Permalink
Prepare the 0.0.35 release.
Browse files Browse the repository at this point in the history
Testing Done:
Ran `./pants` until it succeeded while weeding out deprecations that
have come due.

Checked we were option migration clean with:
```
$ ./pants run migrations/options/src/python:migrate_config
```

Ran rst2html on CHANGELOG.rst to sanity-check the render and links in
the release notes section.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/70445674

Bugs closed: 1790, 1791

Reviewed at https://rbcommons.com/s/twitter/r/2457/
  • Loading branch information
jsirois committed Jul 10, 2015
1 parent 0acdf8d commit 69a9561
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 225 deletions.
62 changes: 60 additions & 2 deletions src/python/pants/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,68 @@
RELEASE HISTORY
===============

0.0.34 (7/6/2015)
0.0.35 (7/10/2015)
------------------

Release Notes
~~~~~~~~~~~~~

With this release, if you use the
`isolated jvm compile strategy <https://github.com/pantsbuild/pants/blob/0acdf8d8ab49a0a6bdf5084a99e0c1bca0231cf6/pants.ini.isolated>`_,
java annotation processers that emit java sourcefiles or classfiles will be
handled correctly and the generated code will be bundled appropriately in jars.
In particular, this makes libraries like Google's AutoValue useable in a pants
build. See: `RB #2451 <https://rbcommons.com/s/twitter/r/2451>`_.

API Changes
~~~~~~~~~~~

* Deprecate with_description.
`RB #2444 <https://rbcommons.com/s/twitter/r/2444>`_

Bugfixes
~~~~~~~~

* Fixup BuildFile must_exist logic.
`RB #2441 <https://rbcommons.com/s/twitter/r/2441>`_

* Upgrade to pex 1.0.1.
`Issue #1658 <https://github.com/pantsbuild/pants/issues/1658>`_
`RB #2438 <https://rbcommons.com/s/twitter/r/2438>`_

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

* Add an option --main to the run.jvm task to override the specification of 'main' on a jvm_binary() target.
`RB #2442 <https://rbcommons.com/s/twitter/r/2442>`_

* Add jvm_options for thrift-linter.
`RB #2445 <https://rbcommons.com/s/twitter/r/2445>`_

* Added cwd argument to allow JavaTest targets to require particular working directories.
`RB #2440 <https://rbcommons.com/s/twitter/r/2440>`_

Small improvements, Refactoring and Tooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Record all output classes for the jvm isolated compile strategy.
`RB #2451 <https://rbcommons.com/s/twitter/r/2451>`_

* Robustify the pants ivy configuration.
`Issue #1779 <https://github.com/pantsbuild/pants/issues/1779>`_
`RB #2450 <https://rbcommons.com/s/twitter/r/2450>`_

* Some refactoring of global options.
`RB #2446 <https://rbcommons.com/s/twitter/r/2446>`_

* Improved error messaging for unknown Target kwargs.
`RB #2443 <https://rbcommons.com/s/twitter/r/2443>`_

* Remove Nailgun specific classes from zinc, since pants invokes Main directly.
`RB #2439 <https://rbcommons.com/s/twitter/r/2439>`_

0.0.34 (7/6/2015)
-----------------

Release Notes
~~~~~~~~~~~~~
Expand All @@ -19,7 +78,6 @@ for this new release. Download the pants source code and run:
./pants run migrations/options/src/python:migrate_config -- <path
to your pants.ini>
API Changes
~~~~~~~~~~~

Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ python_library(
'3rdparty/python:six',
'3rdparty/python/twitter/commons:twitter.common.dirutil',
'src/python/pants/base:build_environment',
'src/python/pants/base:deprecated',
],
)

Expand Down
29 changes: 0 additions & 29 deletions src/python/pants/backend/core/wrapped_globs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
unicode_literals, with_statement)

import os
from copy import deepcopy

from six import string_types
from twitter.common.dirutil.fileset import Fileset

from pants.base.build_environment import get_buildroot
from pants.base.deprecated import deprecated


class FilesetWithSpec(object):
Expand All @@ -31,33 +29,6 @@ def __iter__(self):
def __getitem__(self, index):
return self._result[index]

@deprecated(removal_version='0.0.35',
hint_message='Instead of globs(a) + globs(b), use globs(a, b)')
def __add__(self, other):
filespec = deepcopy(self.filespec)
if isinstance(other, FilesetWithSpec):
filespec['globs'] += other.filespec['globs']
other_result = other._result
else:
filespec['globs'] += [os.path.join(self._rel_root, other_path) for other_path in other]
other_result = other
result = list(set(self._result).union(set(other_result)))
return FilesetWithSpec(self._rel_root, result, filespec)

@deprecated(removal_version='0.0.35',
hint_message='Instead of glob arithmetic, use glob(..., exclude=[...])')
def __sub__(self, other):
filespec = deepcopy(self.filespec)
exclude = filespec.get('exclude', [])
if isinstance(other, FilesetWithSpec):
exclude.append(other.filespec)
other_result = other._result
else:
exclude.append({'globs' : [os.path.join(self._rel_root, other_path) for other_path in other]})
other_result = other
filespec['exclude'] = exclude
result = list(set(self._result) - set(other_result))
return FilesetWithSpec(self._rel_root, result, filespec)

class FilesetRelPathWrapper(object):
def __init__(self, parse_context):
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/python/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ python_library(
'src/python/pants/base:address_lookup_error',
'src/python/pants/base:build_environment',
'src/python/pants/base:build_graph',
'src/python/pants/base:deprecated',
'src/python/pants/base:exceptions',
'src/python/pants/base:generator',
'src/python/pants/base:hash_utils',
Expand Down
47 changes: 4 additions & 43 deletions src/python/pants/backend/python/tasks/pytest_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from pants.backend.python.python_setup import PythonRepos, PythonSetup
from pants.backend.python.targets.python_tests import PythonTests
from pants.backend.python.tasks.python_task import PythonTask
from pants.base.deprecated import deprecated
from pants.base.exceptions import TaskError, TestFailedTaskError
from pants.base.target import Target
from pants.base.workunit import WorkUnit
Expand Down Expand Up @@ -67,43 +66,6 @@ def failed_targets(self):
return self._failed_targets


def deprecated_env_accessors(removal_version, **replacement_mapping):
"""Generates accessors for legacy env ver/replacement option pairs.
The generated accessors issue a deprecation warning when the deprecated env var is present and
enjoy the "compile" time removal forcing that normal @deprecated functions and methods do.
"""
def create_accessor(env_name, option_name):
@deprecated(removal_version=removal_version,
hint_message='Use the {option} option instead of the deprecated {env} environment '
'variable'.format(option=option_name, env=env_name))
def deprecated_accessor():
return os.environ.get(env_name)

def accessor(self):
value = None
if env_name in os.environ:
value = deprecated_accessor()
sanitized_option_name = option_name.lstrip('-').replace('-', '_')
value = self.get_options()[sanitized_option_name] or value
return value
return accessor

def decorator(clazz):
for env_name, option_name in replacement_mapping.items():
setattr(clazz, 'get_DEPRECATED_{}'.format(env_name), create_accessor(env_name, option_name))
return clazz

return decorator


# TODO(John Sirois): Replace this helper and use of the accessors it generates with direct options
# access prior to releasing 0.0.35
@deprecated_env_accessors(removal_version='0.0.35',
JUNIT_XML_BASE='--junit-xml-dir',
PANTS_PROFILE='--profile',
PANTS_PYTHON_TEST_FAILSOFT='--fail-slow',
PANTS_PY_COVERAGE='--coverage')
class PytestRun(PythonTask):
_TESTING_TARGETS = [
# Note: the requirement restrictions on pytest and pytest-cov match those in requirements.txt,
Expand Down Expand Up @@ -175,8 +137,7 @@ def run_tests(self, targets, workunit):
else:
results = {}
# Coverage often throws errors despite tests succeeding, so force failsoft in that case.
fail_hard = (not self.get_DEPRECATED_PANTS_PYTHON_TEST_FAILSOFT() and
not self.get_DEPRECATED_PANTS_PY_COVERAGE())
fail_hard = not self.get_options().fail_slow and not self.get_options().coverage
for target in targets:
if isinstance(target, PythonTests):
rv = self._do_run_tests([target], workunit)
Expand Down Expand Up @@ -247,7 +208,7 @@ def pytest_collection_modifyitems(session, config, items):
@contextmanager
def _maybe_emit_junit_xml(self, targets):
args = []
xml_base = self.get_DEPRECATED_JUNIT_XML_BASE()
xml_base = self.get_options().junit_xml_dir
if xml_base and targets:
xml_base = os.path.realpath(xml_base)
xml_path = os.path.join(xml_base, Target.maybe_readable_identify(targets) + '.xml')
Expand Down Expand Up @@ -376,7 +337,7 @@ def is_python_lib(tgt):

@contextmanager
def _maybe_emit_coverage_data(self, targets, chroot, pex, workunit):
coverage = self.get_DEPRECATED_PANTS_PY_COVERAGE()
coverage = self.get_options().coverage
if coverage is None:
yield []
return
Expand Down Expand Up @@ -468,7 +429,7 @@ def _do_run_tests_with_args(self, pex, workunit, args):
env = {
'PYTHONUNBUFFERED': '1',
}
profile = self.get_DEPRECATED_PANTS_PROFILE()
profile = self.get_options().profile
if profile:
env['PEX_PROFILE'] = '{0}.subprocess.{1:.6f}'.format(profile, time.time())
with environment_as(**env):
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
unicode_literals, with_statement)


VERSION = '0.0.34'
VERSION = '0.0.35'
85 changes: 0 additions & 85 deletions tests/python/pants_test/backend/core/test_wrapped_globs.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,88 +170,3 @@ def test_rglob_respects_follow_links_override(self):
'java_library(name="w", sources=rglobs("*.java", follow_links=False))')
graph = self.context().scan(self.build_root)
assert ['foo.java'] == list(graph.get_target_from_spec('z/w').sources_relative_to_source_root())

# Remove the following tests when operator support is dropped from globs
def test_globs_add_globs_added_to_spec(self):
self.add_to_build_file('y/BUILD', 'java_library(name="y",'
' sources=globs("morx.java") + globs("fleem.java"))')
graph = self.context().scan(self.build_root)
globs = graph.get_target_from_spec('y').globs_relative_to_buildroot()
self.assertEquals({'globs': ['y/morx.java', 'y/fleem.java']},
globs)

def test_globs_add_list_added_to_spec(self):
self.add_to_build_file('y/BUILD', 'java_library(name="y",'
' sources=globs("morx.java") + ["fleem.java"])')
graph = self.context().scan(self.build_root)
globs = graph.get_target_from_spec('y').globs_relative_to_buildroot()
self.assertEquals({'globs': ['y/morx.java', 'y/fleem.java']},
globs)

def test_rglob_add_operator_with_other_rglob(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("fleem.java") + rglobs("morx.java"))'
)
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java','morx.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))

def test_rglob_add_operator_with_list(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("fleem.java") + ["morx.java"])'
)
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java', 'morx.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))

def test_rglob_add_operator_with_overlapping_rglob_has_distinct_list(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("*.java") + rglobs("*.java"))')
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java', 'morx.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))

def test_globs_sub_globs_added_to_spec_exclude(self):
self.add_to_build_file('y/BUILD', 'java_library(name="y",'
' sources=globs("*.java") - globs("fleem.java"))')
graph = self.context().scan(self.build_root)
globs = graph.get_target_from_spec('y').globs_relative_to_buildroot()
self.assertEquals({'globs': ['y/*.java'],
'exclude': [{'globs': ['y/fleem.java']}]},
globs)

def test_glob_sub_list_added_to_spec_exclude(self):
self.add_to_build_file('y/BUILD', 'java_library(name="y",'
' sources=globs("*.java") - ["fleem.java"])')
graph = self.context().scan(self.build_root)
globs = graph.get_target_from_spec('y').globs_relative_to_buildroot()
self.assertEquals({'globs': ['y/*.java'],
'exclude': [{'globs': ['y/fleem.java']}]},
globs)

def test_rglob_sub_operator_with_other_rglob(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("*.java") - rglobs("morx.java"))')
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))

def test_rglob_sub_operator_with_list(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("*.java") - ["morx.java"])')
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))

def test_rglob_sub_operator_with_non_overlapping_rglob(self):
self.add_to_build_file('y/BUILD',
'java_library(name="y",'
' sources=rglobs("*.java") - rglobs("*.scala"))')
graph = self.context().scan(self.build_root)
self.assertEqual(['fleem.java', 'morx.java'],
list(graph.get_target_from_spec('y').sources_relative_to_source_root()))
Loading

0 comments on commit 69a9561

Please sign in to comment.