Skip to content

Commit 997d6f7

Browse files
authored
fix: wrong value of has_py3_only_sources in the PyInfo constructor (#3315)
The has_py3_only_sources field was being set to the has_py2_only_sources variable
1 parent e9b4dfc commit 997d6f7

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ END_UNRELEASED_TEMPLATE
7272

7373
{#v0-0-0-fixed}
7474
### Fixed
75+
* (rules) The `PyInfo` constructor was setting the wrong value for
76+
`has_py3_only_sources` - this is now fixed.
7577
* (bootstrap) The stage1 bootstrap script now correctly handles nested `RUNFILES_DIR`
7678
environments, fixing issues where a `py_binary` calls another `py_binary`
7779
([#3187](https://github.com/bazel-contrib/rules_python/issues/3187)).

python/private/py_info.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _PyInfo_init(
146146
"direct_pyc_files": direct_pyc_files,
147147
"direct_pyi_files": direct_pyi_files,
148148
"has_py2_only_sources": has_py2_only_sources,
149-
"has_py3_only_sources": has_py2_only_sources,
149+
"has_py3_only_sources": has_py3_only_sources,
150150
"imports": imports,
151151
"transitive_implicit_pyc_files": transitive_implicit_pyc_files,
152152
"transitive_implicit_pyc_source_files": transitive_implicit_pyc_source_files,

tests/base_rules/py_info/py_info_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _provide_py_info_impl(ctx):
3535
if ctx.attr.has_py2_only_sources != -1:
3636
kwargs["has_py2_only_sources"] = bool(ctx.attr.has_py2_only_sources)
3737
if ctx.attr.has_py3_only_sources != -1:
38-
kwargs["has_py2_only_sources"] = bool(ctx.attr.has_py2_only_sources)
38+
kwargs["has_py3_only_sources"] = bool(ctx.attr.has_py3_only_sources)
3939

4040
providers = []
4141
providers.append(PyInfo(**kwargs))

0 commit comments

Comments
 (0)