aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/python
Commit message (Collapse)AuthorAge
* Add the .py3 extension as a valid Python source.Gravatar Googler2018-07-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 206156886
* C++: Implements py_wrap_cc in SkylarkGravatar plf2018-07-13
| | | | | RELNOTES:none PiperOrigin-RevId: 204463998
* Deletes AutoCodec.PUBLIC_FIELDS strategy. Superseded by DynamicCodec.Gravatar shahan2018-06-29
| | | | PiperOrigin-RevId: 202704472
* Make things easier to serialize: make constants constant, tag some lambdas. ↵Gravatar janakr2018-06-19
| | | | | | Get rid of a useless tag, because the Function being tagged is a concrete class, so won't be serializable. Will deal with it in a follow-up. Implement equality for BazelInfo. PiperOrigin-RevId: 201199255
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-19
| | | | | | | | | Rolls forward https://github.com/bazelbuild/bazel/commit/c720152ec1936a537c9519d522d3cb41d19cff77. This CL includes testing to make sure that linker parameters coming from every possible provider in Python rules is propagated. RELNOTES:none PiperOrigin-RevId: 201160720
* Automated rollback of commit c720152ec1936a537c9519d522d3cb41d19cff77.Gravatar janakr2018-06-18
| | | | | | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Refactors PyWrapCc to make it easier to migrate to Skylark Rolling forward https://github.com/bazelbuild/bazel/commit/6c87715b8ac6b32e636ba307440e2b7362b10a48. When I first tried to roll forward this CL I missed one place where PyCcLinkParamsProvider.TO_LINK_PARAMS should have been called. The target //production/midas/config:client_config_pb builds fine now. RELNOTES:none PiperOrigin-RevId: 201070354
* Automated rollback of commit a1c9f8d33457cd1f3b01299863bcab2667c13a52.Gravatar Googler2018-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** PY3 does not support Python proto1. *** Original change description *** Automated rollback of commit 4c72a82ada742bd369185cd07c57f96c497ce440. *** Reason for rollback *** Breaks, at least, //ads/aswan/tools:format_mr_results. *** Original change description *** Remove python3/ prefix to generated .pyc files. That makes: (a) merging PY2 and PY3 .runfiles impossible (which is incorrect anyway) and (b) generated .py source files incompatible with 2to3 (src_version=PY2) - that's OK as we deprecate 2to3. RELNOTES: n/a PiperOrigin-RevId: 200256210
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-11
| | | | | | | | | Rolling forward https://github.com/bazelbuild/bazel/commit/6c87715b8ac6b32e636ba307440e2b7362b10a48. When I first tried to roll forward this CL I missed one place where PyCcLinkParamsProvider.TO_LINK_PARAMS should have been called. The target //production/midas/config:client_config_pb builds fine now. RELNOTES:none PiperOrigin-RevId: 200032805
* Automated rollback of commit 6c87715b8ac6b32e636ba307440e2b7362b10a48.Gravatar cpeyser2018-06-08
| | | | | RELNOTES:none PiperOrigin-RevId: 199840978
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-08
| | | | | | | | Rolling forward https://github.com/bazelbuild/bazel/commit/6afc2eb67675e928bc8fa10c5d1745223186b6e0. This CL was only rolled back to make it easier to rollback https://github.com/bazelbuild/bazel/commit/d0982b905d93e219a0caccdcf5d6ae1e219387c2. RELNOTES:none PiperOrigin-RevId: 199779304
* Automated rollback of commit d0982b905d93e219a0caccdcf5d6ae1e219387c2.Gravatar janakr2018-06-07
| | | | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Delete PyCcLinkParamsProvider. No longer needed. RELNOTES:none PiperOrigin-RevId: 199710626
* Automated rollback of commit f137cea0ac74334013e7b064e59d1624cf032ac4.Gravatar janakr2018-06-07
| | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Refactors PyWrapCc to make it easier to migrate to Skylark RELNOTES:none PiperOrigin-RevId: 199702630
* Automated rollback of commit 4c72a82ada742bd369185cd07c57f96c497ce440.Gravatar jmmv2018-06-07
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks, at least, //ads/aswan/tools:format_mr_results. *** Original change description *** Remove python3/ prefix to generated .pyc files. That makes: (a) merging PY2 and PY3 .runfiles impossible (which is incorrect anyway) and (b) generated .py source files incompatible with 2to3 (src_version=PY2) - that's OK as we deprecate 2to3. RELNOTES: n/a PiperOrigin-RevId: 199661399
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-07
| | | | | RELNOTES:none PiperOrigin-RevId: 199619637
* C++: Delete PyCcLinkParamsProvider.Gravatar plf2018-06-07
| | | | | | | No longer needed. RELNOTES:none PiperOrigin-RevId: 199593828
* Remove python3/ prefix to generated .pyc files.Gravatar Googler2018-06-06
| | | | | | | | | That makes: (a) merging PY2 and PY3 .runfiles impossible (which is incorrect anyway) and (b) generated .py source files incompatible with 2to3 (src_version=PY2) - that's OK as we deprecate 2to3. RELNOTES: n/a PiperOrigin-RevId: 199491867
* Remove attribute read checks expecting a DATA transition.Gravatar gregce2018-05-25
| | | | | | | | | | | | | | This is a precursor to removing the DATA transition outright. While we could also have changed the Mode.DATA instances to Mode.TARGET (which would declare that we expect the attribute not to apply any transition), that would break existing definitions and make depot cleanup more delicate. Plus, these checks weren't being consistently applied across attributes anyway so they don't really offer much. A lot of this logic is really just leftover legacy from the pre-dynamic configuration days. PiperOrigin-RevId: 198085059
* Migrate struct() to skylarkbuildapiGravatar cparsons2018-05-24
| | | | | RELNOTES: None. PiperOrigin-RevId: 197915097
* Rename PatchTransition.apply to PatchTransiton.patch.Gravatar gregce2018-05-23
| | | | | | | This unclashes with the incoming ConfigurationTransition.apply method described in https://docs.google.com/document/d/1_UJKmAQ9EE8i3Pl0il3YLTYr-Q9EKYYyLatt2zohfyM/edit#heading=h.96gongkwg852. PiperOrigin-RevId: 197769784
* C++: Deletes CcLinkParamsInfoGravatar plf2018-05-15
| | | | | | | | This class is not necessary anymore. We can use CcLinkParamsStoreImpl directly which has been renamed to CcLinkParamsStore. RELNOTES:none PiperOrigin-RevId: 196656488
* C++: Wrap CcLinkParamsInfo with CcLinkingInfo.Gravatar plf2018-04-16
| | | | | | | CcLinkingInfo will eventually wrap all C++ linking providers. CcLinkParamsInfo is no longer a provider and will be renamed in a later CL. RELNOTES:none PiperOrigin-RevId: 193011702
* Serialize PythonUtils#GET_INIT_PY_FILES as a singleton so that object equalityGravatar cpeyser2018-04-02
| | | | | | holds in the check in Runfiles.Builder#merge. PiperOrigin-RevId: 191341008
* Remove categories from Bazel options.Gravatar ccalvarin2018-03-28
| | | | | | | | | These have all had a chance to be categorized with the OptionDocumentationCategory enum, and the help output already uses the enum-grouped format. The "incompatible changes" category has meaning for --all_incompatible_changes and will be removed separately. RELNOTES: None. PiperOrigin-RevId: 190773778
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Deletes CODEC fields now that they are no longer needed.Gravatar shahan2018-02-28
| | | | PiperOrigin-RevId: 187397314
* Add @AutoCodec to some PatchTransitions.Gravatar mjhalupka2018-02-27
| | | | PiperOrigin-RevId: 187230702
* @AutoCodec some more providers.Gravatar janakr2018-02-26
| | | | PiperOrigin-RevId: 187057628
* Automated rollback of commit fa0fac2a4e8a2e5c01b8390878289d00dcc17dba.Gravatar lberki2018-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Remove example changes; those need to build with the last Bazel release. *** Original change description *** Automated rollback of commit 0f9c6ea574918dda094cf5423fa3822112846c30. *** Reason for rollback *** Breaks Kokoro and I accidentally submitted the change without presubmit checks. *** Original change description *** Make __init__.py files creation optional Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185806241
* Use AutoCodec to generate CODECs for several provider types that are exportedGravatar cpeyser2018-02-14
| | | | | | by cc_library. PiperOrigin-RevId: 185729248
* Automated rollback of commit 0f9c6ea574918dda094cf5423fa3822112846c30.Gravatar lberki2018-02-14
| | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Kokoro and I accidentally submitted the change without presubmit checks. *** Original change description *** Make __init__.py files creation optional Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185676592
* Make __init__.py files creation optionalGravatar Mouad Benchchaoui2018-02-14
| | | | | | | | | | | Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185672243
* Allows @AutoCodec to use factory methods.Gravatar shahan2018-01-29
| | | | | | Generalizes @AutoCodec.Constructor to @AutoCodec.Instantiator. PiperOrigin-RevId: 183702768
* Rename Root to ArtifactRoot.Gravatar tomlu2018-01-16
| | | | | | This is slightly more descriptive, and we will potentially want to use the name Root for a broader concept shared between ArtifactRoot and RootedPath. PiperOrigin-RevId: 182082367
* Codecs for all non-test Fragment subclasses (except CppConfiguration, ↵Gravatar shahan2018-01-05
| | | | | | handled separately). PiperOrigin-RevId: 180974083
* Move PatchTransition and kin to analysis.config.transitions.Gravatar gregce2018-01-04
| | | | | | | HostTransition can't be migrated yet because it depends on BuildConfiguration. PiperOrigin-RevId: 180842784
* ObjectCodecs for all non-test FragmentOption subclasses.Gravatar Googler2017-12-27
| | | | PiperOrigin-RevId: 180202221
* Rename OutputGroupProvider -> OutputGroupInfo.Gravatar dslomov2017-12-14
| | | | | RELNOTES: None PiperOrigin-RevId: 179046403
* Document --build_python_zip optionGravatar pcloudy2017-11-17
| | | | | RELNOTES: None PiperOrigin-RevId: 176085426
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Remove the runfiles middleman from py_binary's data runfiles.Gravatar Benjamin Peterson2017-10-26
| | | | | | | | | | | | | | This requires polluting Runfiles and RuleConfiguredTargetBuilder with some custom infrastructure to lift a py_binary runfiles middleman into the FilesToRunProviders and output groups of its reverse dependency. That can all go away when the --experimental_build_transitive_python_runfiles transition is complete. This is another step towards https://bazel-review.googlesource.com/c/bazel/+/14010. Change-Id: Ib750d72d4be42324c8edec485707480690b9fc9c PiperOrigin-RevId: 173514090
* Support Python 2 and 3 in the same build.Gravatar gregce2017-10-20
| | | | | | | | | This is also an example of the versatility of dynamic configurations: this feature only requires changes to rules/python/... Issue #3871 PiperOrigin-RevId: 172775001
* Make the state in RuleContext explicitGravatar ulfjack2017-09-28
| | | | | | | | | | | | | | | | | | | | | This isn't ideal - RuleContext should not have state, but this ended up happening between adding a cache and refactoring how make variables are discovered. I have carefully traced back all callers that provide custom make variable suppliers and added an init call to their rule initialization. Note that the ConfigurationMakeVariableContext is _cached_, so callers that call in without any make variable suppliers and then call again with them would get the context from the previous call. We now enforce that the ConfigurationMakeVariableContext is only initialized once, and that this happens before any usage, which is slightly better than the previous state, where initialization was silently ignored on any subsequent call. Progress on #2475. PiperOrigin-RevId: 170312285
* Simplify RuleContext APIGravatar ulfjack2017-09-27
| | | | | | | | | Use ConfigurationMakeVariableContext instead of passing in lists of MakeVariableSuppliers. Progress on #2475. PiperOrigin-RevId: 170182945
* Reorganise the srcs_version attribute of py_binary/py_test/py_library rules:Gravatar Googler2017-09-27
| | | | | | | | | | | make the default for srcs_version be "PY2AND3" (while leaving default_python_version at "PY2"), since that's a more likely situation and a more obvious error condition. (Having PY2 as the default caused 2to3 to be used a lot more than necessary, which in turn can both hide and cause bugs.) Also, use attribute value restrictions to limit srcs_version and default_python_version to sensible values for the specific rule type. PiperOrigin-RevId: 170174546
* Add an option to control building of transitive py_binary runfiles trees. ,Gravatar Benjamin Peterson2017-09-26
| | | | | | | | | | | | | | | | | ) Currently, "bazel build :script" constructs the bazel-bin/python-prog.runfiles tree. We'd like to do anyway with this behavior but doing so is a backwards-incompatible change. To facilitate a transition, this CL adds an option --experimental_build_transitive_python_runfiles to control the behavior. In the example above, "bazel build --noexperimental_build_transitive_python_runfiles :script" won't construct bazel-bin/python-prog.runfiles. Change-Id: If4d5a84c956a0bbac9067dcf38a00e5732c450f2 PiperOrigin-RevId: 170038245
* Move --build_python_zip into PythonConfiguration.Gravatar mstaib2017-09-21
| | | | | | | | There's no need for it in the core configuration options, as it's used exclusively by Python rules. RELNOTES: None. PiperOrigin-RevId: 169435643
* Remove an unused method.Gravatar lberki2017-09-19
| | | | | RELNOTES: None. PiperOrigin-RevId: 169223392
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Support multiple command lines / params files in SpawnAction.Gravatar tomlu2017-09-15
| | | | | | This is necessary for the upcoming Skylark implementation of param files. PiperOrigin-RevId: 168744486
* Remove the unused fallback argument from getHost() and the unused method ↵Gravatar lberki2017-09-12
| | | | | | | getPotentialSplitTransitions() from FragmentOptions. RELNOTES: None. PiperOrigin-RevId: 168218102