Skip to content

Commit

Permalink
Prepare 1.14.0dev2 release (pantsbuild#7063)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateor authored Jan 19, 2019
1 parent 1ecc906 commit c342fd3
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 104 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Created by running `./build-support/bin/contributors.sh`.
+ Luca Clementi
+ Lukasz Jastrzebski
+ Marc Abramowitz
+ Marcin Podolski
+ Marilyn Cruz
+ Marius Eriksen
+ Mark Chu-Carroll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.backend.python.targets.python_target import PythonTarget
from pants.base.build_environment import get_buildroot, pants_version
from pants.base.deprecated import deprecated_conditional
from pants.base.exceptions import TaskError
from pants.base.hash_utils import hash_all
from pants.base.workunit import WorkUnitLabel
Expand Down Expand Up @@ -78,7 +77,7 @@ def register_options(cls, register):
register('--fail', fingerprint=True, default=True, type=bool,
help='Prevent test failure but still produce output for problems.')
register('--interpreter-constraints-whitelist', fingerprint=True,
default=None,
type=list,
help='A list of interpreter constraints for which matching targets will be linted '
'in addition to targets that match the global interpreter constraints '
'(either from defaults or pants.ini). If the user supplies an empty list, '
Expand Down Expand Up @@ -227,25 +226,14 @@ def execute(self):
[vt.target for vt in invalidation_check.invalid_vts]
)
for filters, targets in tgts_by_compatibility.items():
if self.get_options().interpreter_constraints_whitelist is None and not self._constraints_are_whitelisted(filters):
deprecated_conditional(
lambda: self.get_options().interpreter_constraints_whitelist is None,
'1.14.0.dev2',
"Python linting is currently restricted to targets that match the global "
"interpreter constraints: {}. Pants detected unacceptable filters: {}. "
"Use the `--interpreter-constraints-whitelist` lint option to whitelist "
"compatibiltiy constraints."
.format(PythonSetup.global_instance().interpreter_constraints, filters)
)
else:
sources = self.calculate_sources([tgt for tgt in targets])
if sources:
allowed_interpreters = set(interpreter_cache.setup(filters=filters))
if not allowed_interpreters:
raise TaskError('No valid interpreters found for targets: {}\n(filters: {})'
.format(targets, filters))
interpreter = min(allowed_interpreters)
failure_count += self.checkstyle(interpreter, sources)
sources = self.calculate_sources([tgt for tgt in targets])
if sources:
allowed_interpreters = set(interpreter_cache.setup(filters=filters))
if not allowed_interpreters:
raise TaskError('No valid interpreters found for targets: {}\n(filters: {})'
.format(targets, filters))
interpreter = min(allowed_interpreters)
failure_count += self.checkstyle(interpreter, sources)
if failure_count > 0 and self.get_options().fail:
raise TaskError('{} Python Style issues found. You may try `./pants fmt <targets>`'
.format(failure_count))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,6 @@ def test_lint_runs_for_blanket_whitelist(self):
self.execute_task(target_roots=[target_py2, target_py3])
self.assertIn('7 Python Style issues found', str(task_error.exception))

def test_lint_runs_for_default_constraints_only(self):
target_py2 = self.create_py2_failing_target()
target_py3 = self.create_py3_failing_target()
with self.assertRaises(TaskError) as task_error:
self.execute_task(target_roots=[target_py2, target_py3])
self.assertIn('4 Python Style issues found', str(task_error.exception))

def test_lint_ignores_unwhitelisted_constraints(self):
target_py3 = self.create_py3_failing_target()
self.assertEqual(0, self.execute_task(target_roots=[target_py3]))

def test_lint_runs_for_single_whitelisted_constraints(self):
target_py3 = self.create_py3_failing_target()
self.set_options(interpreter_constraints_whitelist=[self.py3_constraint])
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.14.0.dev1
1.14.0.dev2
2 changes: 2 additions & 0 deletions src/python/pants/backend/jvm/targets/jvm_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def __init__(self,
dependents have access to the closure of exports. An example will be that
if A exports B, and B exports C, then any targets that depends on A will
have access to both B and C.
:param list compiler_option_sets: A list of compiler_option_sets keys for the target. Platform
dependent.
:param bool zinc_file_manager: Whether to use zinc provided file manager that allows
transactional rollbacks, but in certain cases may conflict with
user libraries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _write_processor_info(self, processor_info_file, processors):
f.write('{}\n'.format(processor.strip()))

def compile(self, ctx, args, dependency_classpath, upstream_analysis,
settings, fatal_warnings, zinc_file_manager,
settings, compiler_option_sets, zinc_file_manager,
javac_plugin_map, scalac_plugin_map):
classpath = (ctx.classes_dir.path,) + tuple(ce.path for ce in dependency_classpath)

Expand Down Expand Up @@ -168,10 +168,8 @@ def compile(self, ctx, args, dependency_classpath, upstream_analysis,

javac_cmd.extend(args)

if fatal_warnings:
javac_cmd.extend(self.get_options().fatal_warnings_enabled_args)
else:
javac_cmd.extend(self.get_options().fatal_warnings_disabled_args)
compiler_option_sets_args = self.get_merged_args_for_compiler_option_sets(compiler_option_sets)
javac_cmd.extend(compiler_option_sets_args)

with argfile.safe_args(ctx.sources, self.get_options()) as batched_sources:
javac_cmd.extend(batched_sources)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def compile(self, ctx, args, dependency_classpath, upstream_analysis,
:param upstream_analysis: A map from classpath entry to analysis file for dependencies.
:param JvmPlatformSettings settings: platform settings determining the -source, -target, etc for
javac to use.
:param fatal_warnings: whether to convert compilation warnings to errors.
:param list compiler_option_sets: The compiler_option_sets flags for the target.
:param zinc_file_manager: whether to use zinc provided file manager.
:param javac_plugin_map: Map of names of javac plugins to use to their arguments.
:param scalac_plugin_map: Map of names of scalac plugins to use to their arguments.
Expand Down
148 changes: 148 additions & 0 deletions src/python/pants/notes/master.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,154 @@ 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.14.0.dev2 (1/19/2019)
-----------------------

New Features
~~~~~~~~~~~~
* Allow nailgun execution for RscCompile by bundling together the tool classpaths (#7092)
`PR #7092 <https://github.com/pantsbuild/pants/pull/7092>`_

* Python code generation for protobufs and gRPC (#6974)
`PR #6974 <https://github.com/pantsbuild/pants/pull/6974>`_

* refactor NativeExternalLibraryFetch to be a SimpleCodegenTask (#7060)
`PR #7060 <https://github.com/pantsbuild/pants/pull/7060>`_

* Rerun proto compilation when protos change (#7029)
`PR #7029 <https://github.com/pantsbuild/pants/pull/7029>`_

API Changes
~~~~~~~~~~~
* move dict key encoding into hash_utils.py and deprecate stable_json_hash() (#6475)
`PR #6475 <https://github.com/pantsbuild/pants/pull/6475>`_

Version updates
~~~~~~~~~~~~~~~
* Update psutil to fix deprecation warnings (#7112)
`PR #7112 <https://github.com/pantsbuild/pants/pull/7112>`_

* Bump twitter.common dependencies to 0.3.10 to pull in Py3 fixes. (#7102)
`PR #7102 <https://github.com/pantsbuild/pants/pull/7102>`_

* Upgrade several dependencies to fix Py3 deprecations (#7053)
`PR #7053 <https://github.com/pantsbuild/pants/pull/7053>`_

* Update pantsbuild/pants to scala 2.12, and bump the default patch version for 2.12 (#7035)
`PR #7035 <https://github.com/pantsbuild/pants/pull/7035>`_

Bugfixes
~~~~~~~~
* Move pants.init.subprocess into pants.process (#7081)
`PR #7081 <https://github.com/pantsbuild/pants/pull/7081>`_

* Continue to reexport stable_json_hash from its previous location. (#7103)
`PR #7103 <https://github.com/pantsbuild/pants/pull/7103>`_

* [compile.rsc] fix key error; ensure java compiles get necessary zinc scala deps (#7038)
`PR #7038 <https://github.com/pantsbuild/pants/pull/7038>`_

* Fix jvm compile unicode issues when using Python 3 (#6987)
`PR #6987 <https://github.com/pantsbuild/pants/pull/6987>`_

* Revert "set PEX_PYTHON_PATH when invoking the checkstyle pex for pexrc to work (#7013)" (#7028)
`PR #7028 <https://github.com/pantsbuild/pants/pull/7028>`_

Refactoring, Improvements, and Tooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Reorder CI based on what's most likely to change from a typical PR (#7104)
`PR #7104 <https://github.com/pantsbuild/pants/pull/7104>`_

* Switch operation getting to tower (#7108)
`PR #7108 <https://github.com/pantsbuild/pants/pull/7108>`_

* Only clippy on CI on one shard (#7109)
`PR #7109 <https://github.com/pantsbuild/pants/pull/7109>`_

* Make ci.sh's -b bootstrap flag a positive flag (#7096)
`PR #7096 <https://github.com/pantsbuild/pants/pull/7096>`_

* Use docker on wheel builder shard (#7100)
`PR #7100 <https://github.com/pantsbuild/pants/pull/7100>`_

* don't override PANTS_DEV if set to 0 in the calling environment to make python checkstyle work in a separate repo (#7017)
`PR #7017 <https://github.com/pantsbuild/pants/pull/7017>`_

* Split out unrelated CI jobs into their own distinct shards (#7090)
`PR #7090 <https://github.com/pantsbuild/pants/pull/7090>`_

* Hotfix for #6981 breaking release.sh (#7091)
`PR #7091 <https://github.com/pantsbuild/pants/pull/7091>`_

* Use ./pants3 for majority of CI (#6981)
`PR #6981 <https://github.com/pantsbuild/pants/pull/6981>`_

* [compile.rsc] fix typo (#7057)
`PR #7057 <https://github.com/pantsbuild/pants/pull/7057>`_

* Fix threading issue with report.py when using Py3 (#7085)
`PR #7085 <https://github.com/pantsbuild/pants/pull/7085>`_

* Allow Pants to run with Python 3 via `./pants3` script (#6959)
`PR #6959 <https://github.com/pantsbuild/pants/pull/6959>`_

* Properly render \n in exceptions with Py3 (#7073)
`PR #7073 <https://github.com/pantsbuild/pants/pull/7073>`_

* use the asttokens 3rdparty lib to make @rule parsing errors very smooth (#7023)
`PR #7023 <https://github.com/pantsbuild/pants/pull/7023>`_

* Add specific copyright year check on newly added python files (#7066)
`PR #7066 <https://github.com/pantsbuild/pants/pull/7066>`_

* Use homebrew addon feature in CI (#7062)
`PR #7062 <https://github.com/pantsbuild/pants/pull/7062>`_

* Add `collections.abc` backport to fix deprecation warning (#7055)
`PR #7055 <https://github.com/pantsbuild/pants/pull/7055>`_

* Improve symlink errors (#7054)
`PR #7054 <https://github.com/pantsbuild/pants/pull/7054>`_

* Fix invalid escape sequence problems (#7056)
`PR #7056 <https://github.com/pantsbuild/pants/pull/7056>`_

* Build rust code only once per platform in a CI run (#7047)
`PR #7047 <https://github.com/pantsbuild/pants/pull/7047>`_

* Remote execution uses tower-grpc to start executions (#7049)
`PR #7049 <https://github.com/pantsbuild/pants/pull/7049>`_

* Workaround for homebrew bug with osx shard (#7050)
`PR #7050 <https://github.com/pantsbuild/pants/pull/7050>`_
`Issue #5513 <https://github.com/Homebrew/brew/issues/5513>`_

* Support some conversions for prost protos (#7040)
`PR #7040 <https://github.com/pantsbuild/pants/pull/7040>`_

* Expose 1.13.x in the docsite notes dropdown. (#7045)
`PR #7045 <https://github.com/pantsbuild/pants/pull/7045>`_

* Reqwest uses rustls not openssl (#7002)
`PR #7002 <https://github.com/pantsbuild/pants/pull/7002>`_

* Fix awscli install to be language agnostic. (#7033)
`PR #7033 <https://github.com/pantsbuild/pants/pull/7033>`_

* Improve readability of integration test logging. (#7036)
`PR #7036 <https://github.com/pantsbuild/pants/pull/7036>`_

* Generate protos for tower as well as grpcio (#7030)
`PR #7030 <https://github.com/pantsbuild/pants/pull/7030>`_

* Ensure all rust crates have common prefix (#7031)
`PR #7031 <https://github.com/pantsbuild/pants/pull/7031>`_

* Eliminate bs4 warning. (#7027)
`PR #7027 <https://github.com/pantsbuild/pants/pull/7027>`_


1.14.0.dev1 (1/4/2019)
----------------------

Expand Down
49 changes: 7 additions & 42 deletions src/python/pants/option/compiler_option_sets_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from builtins import object

from pants.util.memo import memoized_property
from pants.util.meta import classproperty


Expand All @@ -16,17 +15,6 @@ class CompilerOptionSetsMixin(object):
@classmethod
def register_options(cls, register):
super(CompilerOptionSetsMixin, cls).register_options(register)

register('--fatal-warnings-enabled-args', advanced=True, type=list, fingerprint=True,
default=cls.get_fatal_warnings_enabled_args_default,
help='Extra compiler args to use when fatal warnings are enabled.',
removal_version='1.14.0.dev2',
removal_hint='Use compiler option sets instead.')
register('--fatal-warnings-disabled-args', advanced=True, type=list, fingerprint=True,
default=cls.get_fatal_warnings_disabled_args_default,
help='Extra compiler args to use when fatal warnings are disabled.',
removal_version='1.14.0.dev2',
removal_hint='Use compiler option sets instead.')
register('--compiler-option-sets-enabled-args', advanced=True, type=dict, fingerprint=True,
default=cls.get_compiler_option_sets_enabled_default_value,
help='Extra compiler args to use for each enabled option set.')
Expand Down Expand Up @@ -54,42 +42,19 @@ def get_fatal_warnings_disabled_args_default(cls):
"""Override to set default for this option."""
return ()

@memoized_property
def _use_deprecated_fatal_warnings(self):
"""Returns true if fatal warnings should be used from their deprecated location.
The deprecated location is used only if it is explicitly specified, and no args were explicitly
specified in the new location. This means that either one location or the other will be used,
but never both.
"""
set_in_deprecated_location = not self.get_options().is_default('fatal_warnings_enabled_args') or \
not self.get_options().is_default('fatal_warnings_disabled_args')
set_enabled_in_new_location = (not self.get_options().is_default('compiler_option_sets_enabled_args') and \
bool(self.get_options().compiler_option_sets_enabled_args.get('fatal_warnings', None)))
set_disabled_in_new_location = (not self.get_options().is_default('compiler_option_sets_disabled_args') and \
bool(self.get_options().compiler_option_sets_disabled_args.get('fatal_warnings', None)))
return set_in_deprecated_location and not (set_enabled_in_new_location or set_disabled_in_new_location)

# TODO(mateo): The compiler_option_sets could use an API that requires implementing platforms to
# surface documentation - this took me awhile to unwind.
def get_merged_args_for_compiler_option_sets(self, compiler_option_sets):
compiler_options = set()

# Start by setting the (deprecated) magically handled fatal warnings option.
if self._use_deprecated_fatal_warnings:
if 'fatal_warnings' in compiler_option_sets:
compiler_options.update(self.get_options().fatal_warnings_enabled_args)
else:
compiler_options.update(self.get_options().fatal_warnings_disabled_args)

# Set values for enabled options (ignoring fatal_warnings if it has been handled above).
# Set values for enabled options.
for option_set_key in compiler_option_sets:
if option_set_key != 'fatal_warnings' or not self._use_deprecated_fatal_warnings:
val = self.get_options().compiler_option_sets_enabled_args.get(option_set_key, ())
compiler_options.update(val)
val = self.get_options().compiler_option_sets_enabled_args.get(option_set_key, ())
compiler_options.update(val)

# Set values for disabled options (ignoring fatal_warnings if it has been handled above).
# Set values for disabled options.
for option_set_key, disabled_args in self.get_options().compiler_option_sets_disabled_args.items():
if not option_set_key in compiler_option_sets:
if option_set_key != 'fatal_warnings' or not self._use_deprecated_fatal_warnings:
compiler_options.update(disabled_args)
compiler_options.update(disabled_args)

return list(compiler_options)
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,6 @@ def test_zinc_unsupported_option(self):
# Confirm that we were warned.
self.assertIn('is not supported, and is subject to change/removal', pants_run.stdout_data)

def test_zinc_fatal_warnings(self):
def test_combination(target, expect_success, extra_args=[]):
with self.temporary_workdir() as workdir:
with self.temporary_cachedir() as cachedir:
pants_run = self.run_test_compile(
workdir,
cachedir,
'testprojects/src/scala/org/pantsbuild/testproject/compilation_warnings:{}'.format(
target),
extra_args=extra_args)

if expect_success:
self.assert_success(pants_run)
else:
self.assert_failure(pants_run)
test_combination('fatal', expect_success=False)
test_combination('nonfatal', expect_success=True)

test_combination('fatal', expect_success=True,
extra_args=['--compile-zinc-fatal-warnings-enabled-args=[\'-C-Werror\']'])
test_combination('fatal', expect_success=False,
extra_args=['--compile-zinc-fatal-warnings-disabled-args=[\'-S-Xfatal-warnings\']'])

def test_zinc_compiler_options_sets(self):
def test_combination(target, expect_success, extra_args=[]):
with self.temporary_workdir() as workdir:
Expand Down

0 comments on commit c342fd3

Please sign in to comment.