Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue: 882 #884

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why we need this version bump?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep it uniform. The consumers of rules_pkg will get rules_python 0.34.0. So, if rules_pkg also need a version of rules_python for it's build, then let the build also use same version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is whether there is a feature in rules_python 0.34.0 that rules_pkg is now using? In general for bzlmod, rulesets should declare the minimum viable version for their dependencies. This allows clients to dictate the version of a dependency.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 I am very dubious about this. It pulls in rules_python internal things.
That may work at this instant in time, but it feels brittle w.rt. new versions.

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()
5 changes: 5 additions & 0 deletions examples/rich_structure/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ 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",
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
Expand Down
5 changes: 5 additions & 0 deletions examples/time_stamping/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ 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