Skip to content
Merged
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
57 changes: 48 additions & 9 deletions .github/workflows/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ on:
- push
- pull_request
jobs:
test-wheel_resolver:
name: Test wheel_resolver (Python ${{ matrix.python }})
uses: ./.github/workflows/plugin_test.yaml
with:
id: wheel_resolver
runner: ubuntu-latest
python: ${{ matrix.python }}
please_pex_from_repo: false
test_targets: //tools/wheel_resolver/...
strategy:
fail-fast: false
matrix:
python:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
test-please_pex:
name: Test (Python ${{ matrix.python }}, in-repo please_pex)
uses: ./.github/workflows/plugin_test.yaml
Expand Down Expand Up @@ -37,26 +56,46 @@ jobs:
- '3.12'
- '3.13'
- '3.14'
release-tools:
name: Release tools
release-please_pex:
name: Release please_pex
if: github.ref == 'refs/heads/master'
needs:
- test-please_pex
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Build tools
run: ./pleasew build //package:release_files
- name: Release tools
- name: Build release files
run: ./pleasew build //package:please_pex_release_files
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: thought-machine/release-action@master
with:
release-files: plz-out/package/please_pex
version-file: tools/please_pex/VERSION
change-log-file: tools/please_pex/ChangeLog
release-prefix: please_pex
release-wheel_resolver:
name: Release wheel_resolver
if: github.ref == 'refs/heads/master'
needs:
- test-wheel_resolver
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Build release files
run: ./pleasew build //package:wheel_resolver_release_files
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: thought-machine/release-action@master
with:
release-files: plz-out/package
version-file: tools/VERSION
change-log-file: tools/ChangeLog
release-prefix: tools
release-files: plz-out/package/wheel_resolver
version-file: tools/wheel_resolver/VERSION
change-log-file: tools/wheel_resolver/ChangeLog
release-prefix: wheel_resolver
release-plugin:
name: Release plugin
if: github.ref == 'refs/heads/master'
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/plugin_test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
on:
workflow_call:
inputs:
id:
description: "A identifier for this test run. Will be included in the Please log archive file name."
type: string
default: test
runner:
description: "The GitHub runner type on which this workflow should run."
required: true
Expand All @@ -14,6 +18,10 @@ on:
required: false
type: boolean
default: false
test_targets:
description: "A space-delimited list of targets to pass to `plz test`."
type: string
default: //...
jobs:
test:
name: Run tests
Expand All @@ -38,9 +46,9 @@ jobs:
cp $(./pleasew query outputs //tools/please_pex) $HOME/please_pex
echo "PLZ_ARGS="$(grep ^PLZ_ARGS= $GITHUB_ENV | cut -d= -f2-)" -o plugin.python.pextool:$HOME/please_pex" >> $GITHUB_ENV
- name: Run tests
run: ./pleasew test --keep_going --log_file plz-out/log/test.log
run: ./pleasew test --keep_going --log_file plz-out/log/test.log ${{ inputs.test_targets }}
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs-python_${{ inputs.python }}-please_pex_${{ inputs.please_pex_from_repo && 'repo' || 'stable' }}
name: logs-${{ inputs.id }}-python_${{ inputs.python }}-please_pex_${{ inputs.please_pex_from_repo && 'repo' || 'stable' }}
path: plz-out/log
16 changes: 8 additions & 8 deletions build_defs/version.build_defs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
def version(name:str, version_file:str="VERSION", visibility:list=["PUBLIC"]):
def version(name:str, version_const:str="VERSION", version_file:str="VERSION", visibility:list=["PUBLIC"]):
assert version_const == version_const.upper(), "version_const must be a constant identifier"
return genrule(
name = name,
srcs = [version_file],
outs = [f"{name}.build_defs"],
cmd = "echo VERSION = \\\"$(cat $SRCS)\\\" > $OUT",
visibility = visibility,
)

name = name,
srcs = [version_file],
outs = [f"{name}.build_defs"],
cmd = f'''echo "{version_const} = '$(cat $SRCS)'" > $OUTS''',
visibility = visibility,
)
28 changes: 14 additions & 14 deletions package/BUILD
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
subinclude("//tools:version", "//build_defs:archs", "///go//build_defs:go")
subinclude("//build_defs:archs")

release_files = {
_tools = {
"please_pex": "//tools/please_pex",
"wheel_resolver": "//tools/wheel_resolver",
}

def release_file(name:str, file_target:str, arch:str):
def release_file(name:str, version:str, file_target:str, arch:str):
return genrule(
name = f"{name}_{arch}",
srcs = [f"///{arch}" + canonicalise(file_target)],
outs = [f"{name}-{VERSION}-{arch}"],
outs = [f"{name}-{version}-{arch}"],
cmd = "mv $SRC $OUT",
)

filegroup(
name = "release_files",
srcs = [
release_file(name, target, arch)
for name, target in release_files.items()
for arch in SUPPORTED_ARCHS
],
labels = ["hlink:plz-out/package"],
)

for tool, package in _tools.items():
subinclude(f"{package}:version")
filegroup(
name = f"{tool}_release_files",
srcs = [
release_file(tool, VERSION, package, arch)
for arch in SUPPORTED_ARCHS
],
labels = [f"hlink:plz-out/package/{tool}"],
)
8 changes: 2 additions & 6 deletions tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
subinclude("//build_defs:version")

version(name = "version")

TOOLS_VERSION = "1.7.0"
_PLEASE_PEX_VERSION = "1.7.0"

remote_file(
name = "please_pex",
url = f"https://github.com/please-build/python-rules/releases/download/tools-v{TOOLS_VERSION}/please_pex-{TOOLS_VERSION}-{CONFIG.OS}_{CONFIG.ARCH}",
url = f"https://github.com/please-build/python-rules/releases/download/tools-v{_PLEASE_PEX_VERSION}/please_pex-{_PLEASE_PEX_VERSION}-{CONFIG.OS}_{CONFIG.ARCH}",
hashes = [
"d8f518764c06e690ea1a4fb90fd532b00c15247cd7d8fb58562748df5b1a0db7", # darwin_amd64
"3a4ff1599c757d2dff4ed9a11e2efa429bb7e644fe8f6ee7191ae1dec903e57b", # darwin_arm64
Expand Down
1 change: 0 additions & 1 deletion tools/VERSION

This file was deleted.

8 changes: 7 additions & 1 deletion tools/please_pex/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
subinclude("//build_defs:python", "///go//build_defs:go")
subinclude(
"///go//build_defs:go",
"//build_defs:python",
"//build_defs:version",
)

version(name = "version")

go_binary(
name = "pex_main",
Expand Down
12 changes: 7 additions & 5 deletions tools/ChangeLog → tools/please_pex/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.0.0
-------------
* Release please_pex and wheel_resolver tools independently of each other

Version 1.7.0
-------------
* Upgrade coverage package in please_pex's bootstrap .pex to v7.10.7 (#243)
Expand Down Expand Up @@ -46,7 +50,6 @@ Version 1.4.2
* Upgrade `coverage` package to 7.6.4 in please_pex's bootstrap pex (#197)
This drops native-speed tracing support for Python 3.8 and adds it for Python 3.13.
* Remove unnecessary six dependency in the unittest test runner dependency bundle (#199)
* Remove redundant requests dependency from wheel resolver (#200)
* Prevent Python >= 3.12 from emitting a `DeprecationWarning` when using `importlib.metadata`
on modules in pex files (#203)

Expand All @@ -68,11 +71,11 @@ Version 1.3.5

Version 1.3.4
-------------
* Refactor wheel_resolver to allow for non-PyPI downloads (#167)
* No changes were made to please_pex in this release

Version 1.3.3
-------------
* Include wheel_resolver in tools release (#164)
* No changes were made to please_pex in this release

Version 1.3.2
-------------
Expand All @@ -84,8 +87,7 @@ Version 1.3.1

Version 1.3.0
-------------
* Added wheel_resolver tool; see [README](./wheel_resolver/README.md)
(#149)
* No changes were made to please_pex in this release

Version 1.2.2
-------------
Expand Down
1 change: 1 addition & 0 deletions tools/please_pex/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
7 changes: 6 additions & 1 deletion tools/wheel_resolver/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
subinclude("//build_defs:python")
subinclude(
"//build_defs:python",
"//build_defs:version",
)

version(name = "version")

python_binary(
name="wheel_resolver",
Expand Down
67 changes: 67 additions & 0 deletions tools/wheel_resolver/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Version 2.0.0
-------------
* Release please_pex and wheel_resolver tools independently of each other

Version 1.7.0
-------------
* No changes were made to wheel_resolver in this release

Version 1.6.2
-------------
* No changes were made to wheel_resolver in this release

Version 1.6.1
-------------
* No changes were made to wheel_resolver in this release

Version 1.6.0
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.5
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.4
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.3
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.2
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.1
-------------
* No changes were made to wheel_resolver in this release

Version 1.5.0
-------------
* No changes were made to wheel_resolver in this release

Version 1.4.2
-------------
* Remove redundant requests dependency from wheel resolver (#200)

Version 1.4.1
-------------
* No changes were made to wheel_resolver in this release

Version 1.4.0
-------------
* No changes were made to wheel_resolver in this release

Version 1.3.5
-------------
* No changes were made to wheel_resolver in this release

Version 1.3.4
-------------
* Refactor wheel_resolver to allow for non-PyPI downloads (#167)

Version 1.3.3
-------------
* Include wheel_resolver in tools release (#164)
1 change: 1 addition & 0 deletions tools/wheel_resolver/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0