Skip to content

Commit

Permalink
issue: 882
Browse files Browse the repository at this point in the history
Upgrading rules_python version and fixed a regression test issue
  • Loading branch information
sjonnalagadda authored and Sridhar committed Aug 17, 2024
1 parent 447fb8e commit d15d998
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module(

# Do not update to newer versions until you need a specific new feature.
bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "rules_python", version = "0.34.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")

# Only for development
Expand Down
4 changes: 2 additions & 2 deletions distro/packaging_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def testBuild(self):
'file://%s' % local_path, self.source_repo, sha256,
rename_repo=self.dest_repo,
deps_method='rules_pkg_dependencies'
)
),
release_tools.rules_python_internal_content()
))
workspace.write(workspace_content)
if _VERBOSE:
Expand All @@ -90,7 +91,6 @@ def CopyTestFile(source_name, dest_name):
out.write(content)

CopyTestFile('BUILD.tpl', 'BUILD')

os.chdir(tempdir)
build_result = subprocess.check_output(['bazel', 'build', ':dummy_tar'])
if _VERBOSE:
Expand Down
4 changes: 4 additions & 0 deletions examples/naming_package_files/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ local_repository(
load("@rules_pkg//pkg:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()
load("@rules_python//:internal_deps.bzl", "rules_python_internal_deps")
rules_python_internal_deps()
load("@rules_python//:internal_setup.bzl", "rules_python_internal_setup")
rules_python_internal_setup()

http_archive(
name = "rules_cc",
Expand Down
8 changes: 8 additions & 0 deletions examples/naming_package_files/WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ local_repository(
load("@rules_pkg//pkg:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

load("@rules_python//:internal_deps.bzl", "rules_python_internal_deps")

rules_python_internal_deps()

load("@rules_python//:internal_setup.bzl", "rules_python_internal_setup")

rules_python_internal_setup()
6 changes: 3 additions & 3 deletions pkg/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def rules_pkg_dependencies():

http_archive(
name = "rules_python",
sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
strip_prefix = "rules_python-0.24.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.24.0/rules_python-0.24.0.tar.gz",
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
strip_prefix = "rules_python-0.34.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
)

http_archive(
Expand Down
7 changes: 7 additions & 0 deletions pkg/releasing/release_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ def workspace_content(
ret += '%s()\n' % m

return ret

def rules_python_internal_content():
ret = 'load("@rules_python//:internal_deps.bzl", "rules_python_internal_deps")'
ret += '\n\nrules_python_internal_deps()\n'
ret += 'load("@rules_python//:internal_setup.bzl", "rules_python_internal_setup")'
ret += '\n\nrules_python_internal_setup()\n'
return ret

0 comments on commit d15d998

Please sign in to comment.