Skip to content

Commit 6c69922

Browse files
committed
Update
[ghstack-poisoned]
1 parent 18c4c8d commit 6c69922

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.github/scripts/td_script_agnostic.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
export TORCHRL_BUILD_VERSION=0.8.0
4+
export NO_CPP_BINARIES=1
5+
6+
pip install git+https://github.com/pytorch/tensordict.git -U
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Linux Wheels
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- nightly
8+
- main
9+
- release/*
10+
tags:
11+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
12+
# Release candidate tags look like: v1.11.0-rc1
13+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
14+
workflow_dispatch:
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
jobs:
21+
generate-matrix:
22+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
23+
with:
24+
package-type: wheel
25+
os: linux
26+
test-infra-repository: pytorch/test-infra
27+
test-infra-ref: main
28+
build:
29+
needs: generate-matrix
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- repository: pytorch/rl
35+
smoke-test-script: test/smoke_test.py
36+
package-name: torchrl
37+
name: pytorch/rl
38+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
39+
with:
40+
repository: ${{ matrix.repository }}
41+
ref: ""
42+
test-infra-repository: pytorch/test-infra
43+
test-infra-ref: main
44+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
45+
package-name: ${{ matrix.package-name }}
46+
smoke-test-script: ${{ matrix.smoke-test-script }}
47+
trigger-event: ${{ github.event_name }}
48+
env-var-script: .github/scripts/td_script_agnostic.sh

setup.py

+19
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,26 @@ def run(self):
118118
# return None
119119

120120

121+
def strtobool(val):
122+
"""Convert a string representation of truth to true (1) or false (0).
123+
124+
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
125+
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
126+
'val' is anything else.
127+
"""
128+
val = val.lower()
129+
if val in (1, True, "y", "yes", "t", "true", "on", "1"):
130+
return 1
131+
elif val in (0, False, "n", "no", "f", "false", "off", "0"):
132+
return 0
133+
else:
134+
raise ValueError("invalid truth value {!r}".format(val))
135+
136+
121137
def get_extensions():
138+
no_cpp = strtobool(os.getenv("NO_CPP_BINARIES", "0"))
139+
if no_cpp:
140+
return []
122141
extension = CppExtension
123142

124143
extra_link_args = []

0 commit comments

Comments
 (0)