Skip to content

Commit 3e5ade7

Browse files
test
1 parent 50f5a16 commit 3e5ade7

File tree

4 files changed

+179
-164
lines changed

4 files changed

+179
-164
lines changed
Lines changed: 118 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
1-
# This workflow will upload a Python Package to PyPI when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Upload Python Package
10-
11-
on:
12-
release:
13-
types: [published]
14-
15-
permissions:
16-
contents: read
17-
18-
jobs:
19-
release-build:
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
27-
with:
28-
submodules: 'recursive'
29-
token: ${{ secrets.PAT_TOKEN }}
30-
31-
- uses: actions/setup-python@v5
32-
with:
33-
python-version: "3.x"
34-
35-
- name: Install Build
36-
run: |
37-
# NOTE: put your own distribution build steps here.
38-
python -m pip install build
39-
40-
- name: Build wheels
41-
uses: pypa/cibuildwheel@v3.0.1
42-
# env:
43-
with:
44-
package-dir: .
45-
output-dir: wheelhouse
46-
config-file: "{package}/pyproject.toml"
47-
48-
- name: Upload distributions
49-
uses: actions/upload-artifact@v4
50-
with:
51-
name: release-dists
52-
path: wheelhouse/
53-
54-
pypi-publish:
55-
runs-on: ubuntu-latest
56-
needs:
57-
- release-build
58-
permissions:
59-
# IMPORTANT: this permission is mandatory for trusted publishing
60-
id-token: write
61-
62-
# Dedicated environments with protections for publishing are strongly recommended.
63-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
64-
environment:
65-
name: pypi
66-
url: https://pypi.org/p/TensorArray/${{ github.event.release.name }}
67-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
68-
# url: https://pypi.org/p/YOURPROJECT
69-
#
70-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
71-
# ALTERNATIVE: exactly, uncomment the following line instead:
72-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
73-
74-
steps:
75-
- name: Retrieve release distributions
76-
uses: actions/download-artifact@v4
77-
with:
78-
name: release-dists
79-
path: wheelhouse/
80-
81-
- name: Publish release distributions to PyPI
82-
uses: pypa/gh-action-pypi-publish@release/v1
83-
with:
84-
packages-dir: wheelhouse/
85-
86-
testpypi-publish:
87-
runs-on: ubuntu-latest
88-
needs:
89-
- release-build
90-
permissions:
91-
# IMPORTANT: this permission is mandatory for trusted publishing
92-
id-token: write
93-
94-
# Dedicated environments with protections for publishing are strongly recommended.
95-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
96-
environment:
97-
name: testpypi
98-
url: https://test.pypi.org/p/TensorArray/${{ github.event.release.name }}
99-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
100-
# url: https://pypi.org/p/YOURPROJECT
101-
#
102-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
103-
# ALTERNATIVE: exactly, uncomment the following line instead:
104-
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
105-
106-
steps:
107-
- name: Retrieve release distributions
108-
uses: actions/download-artifact@v4
109-
with:
110-
name: release-dists
111-
path: wheelhouse/
112-
113-
- name: Publish release distributions to TestPyPI
114-
uses: pypa/gh-action-pypi-publish@release/v1
115-
with:
116-
repository-url: https://test.pypi.org/legacy/
117-
packages-dir: wheelhouse/
118-
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: 'recursive'
29+
token: ${{ secrets.PAT_TOKEN }}
30+
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.x"
34+
35+
- name: Install Build
36+
run: |
37+
# NOTE: put your own distribution build steps here.
38+
python -m pip install build
39+
40+
- name: Build wheels
41+
uses: pypa/cibuildwheel@v3.0.1
42+
# env:
43+
with:
44+
package-dir: .
45+
output-dir: wheelhouse
46+
config-file: "{package}/pyproject.toml"
47+
48+
- name: Upload distributions
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: release-dists
52+
path: wheelhouse/
53+
54+
pypi-publish:
55+
runs-on: ubuntu-latest
56+
needs:
57+
- release-build
58+
permissions:
59+
# IMPORTANT: this permission is mandatory for trusted publishing
60+
id-token: write
61+
62+
# Dedicated environments with protections for publishing are strongly recommended.
63+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
64+
environment:
65+
name: pypi
66+
url: https://pypi.org/p/TensorArray/${{ github.event.release.name }}
67+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
68+
# url: https://pypi.org/p/YOURPROJECT
69+
#
70+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
71+
# ALTERNATIVE: exactly, uncomment the following line instead:
72+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
73+
74+
steps:
75+
- name: Retrieve release distributions
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: release-dists
79+
path: wheelhouse/
80+
81+
- name: Publish release distributions to PyPI
82+
uses: pypa/gh-action-pypi-publish@release/v1
83+
with:
84+
packages-dir: wheelhouse/
85+
86+
testpypi-publish:
87+
runs-on: ubuntu-latest
88+
needs:
89+
- release-build
90+
permissions:
91+
# IMPORTANT: this permission is mandatory for trusted publishing
92+
id-token: write
93+
94+
# Dedicated environments with protections for publishing are strongly recommended.
95+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
96+
environment:
97+
name: testpypi
98+
url: https://test.pypi.org/p/TensorArray/${{ github.event.release.name }}
99+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
100+
# url: https://pypi.org/p/YOURPROJECT
101+
#
102+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
103+
# ALTERNATIVE: exactly, uncomment the following line instead:
104+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
105+
106+
steps:
107+
- name: Retrieve release distributions
108+
uses: actions/download-artifact@v4
109+
with:
110+
name: release-dists
111+
path: wheelhouse/
112+
113+
- name: Publish release distributions to TestPyPI
114+
uses: pypa/gh-action-pypi-publish@release/v1
115+
with:
116+
repository-url: https://test.pypi.org/legacy/
117+
packages-dir: wheelhouse/
118+

CMakeLists.txt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
cmake_minimum_required(VERSION 3.18.0)
2-
3-
project(TensorArray_Python VERSION 0.1.0 LANGUAGES C CXX)
4-
5-
include(CTest)
6-
enable_testing()
7-
8-
add_subdirectory("third_party/pybind11" EXCLUDE_FROM_ALL)
9-
add_subdirectory("tensor-array-repo/Tensor-Array" EXCLUDE_FROM_ALL)
10-
pybind11_add_module(tensor2 SHARED src/tensor_array/_core/tensor_bind.cc)
11-
12-
target_include_directories(
13-
tensor2
14-
PUBLIC "${CMAKE_CURRENT_LIST_DIR}/tensor-array-repo/Tensor-Array/src"
15-
INTERFACE ${Python_INCLUDE_DIRS}
16-
)
17-
18-
SET_TARGET_PROPERTIES(tensor2 PROPERTIES PREFIX "")
19-
20-
target_link_libraries(tensor2 PUBLIC TensorArray::Core)
21-
22-
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
23-
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
24-
include(CPack)
1+
cmake_minimum_required(VERSION 3.18.0)
2+
3+
project(TensorArray_Python VERSION 0.1.0 LANGUAGES C CXX)
4+
5+
include(CTest)
6+
enable_testing()
7+
8+
add_subdirectory("third_party/pybind11" EXCLUDE_FROM_ALL)
9+
add_subdirectory("tensor-array-repo/Tensor-Array" EXCLUDE_FROM_ALL)
10+
pybind11_add_module(tensor2 SHARED src/tensor_array/_core/tensor_bind.cc)
11+
12+
target_include_directories(
13+
tensor2
14+
PUBLIC "${CMAKE_CURRENT_LIST_DIR}/tensor-array-repo/Tensor-Array/src"
15+
INTERFACE ${Python_INCLUDE_DIRS}
16+
)
17+
18+
SET_TARGET_PROPERTIES(tensor2 PROPERTIES PREFIX "")
19+
20+
target_link_libraries(tensor2 PUBLIC TensorArray::Core)
21+
22+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
23+
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
24+
include(CPack)

pyproject.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"ninja",
5-
"cmake>=3.18,<3.29"
6-
]
7-
build-backend = "setuptools.build_meta"
8-
9-
[tool.cibuildwheel]
10-
environment-pass = ["CUDA_PATH"]
11-
environment.PATH = "${PATH}:${CUDA_PATH}/bin"
12-
environment.LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CUDA_PATH}/lib:${CUDA_PATH}/lib64"
13-
environment.cuda = "12.9"
14-
environment.temp = "/tmp/cuda-temp"
15-
xbuild-tools = ["cmake", "ninja"]
16-
17-
[tool.cibuildwheel.linux]
18-
before-all = [
19-
"chmod +x {package}/scripts/build-env/manylinux.sh",
20-
"{package}/scripts/build-env/manylinux.sh"
21-
]
22-
xbuild-tools = ["cmake", "ninja", "nvcc"]
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"ninja",
5+
"cmake>=3.18,<3.29"
6+
]
7+
build-backend = "setuptools.build_meta"
8+
9+
[tool.cibuildwheel]
10+
environment-pass = ["CUDA_PATH"]
11+
environment.PATH = "${PATH}:${CUDA_PATH}/bin"
12+
environment.LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CUDA_PATH}/lib:${CUDA_PATH}/lib64"
13+
environment.cuda = "12.9"
14+
environment.temp = "/tmp/cuda-temp"
15+
xbuild-tools = ["cmake", "ninja"]
16+
17+
[tool.cibuildwheel.linux]
18+
before-all = [
19+
"chmod +x {package}/scripts/build-env/manylinux.sh",
20+
"{package}/scripts/build-env/manylinux.sh"
21+
]
22+
xbuild-tools = ["cmake", "ninja"]

scripts/build-env/manylinux.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ $USE_SUDO dnf -y install redhat-lsb-core wget
2020
echo "Running CUDA installation script..."
2121
tensor-array-repo/Tensor-Array/scripts/actions/install-cuda-rhel.sh
2222

23+
# debugging output
24+
echo
25+
echo "------------------------------"
26+
echo
27+
echo "CUDA_PATH="
28+
echo "$CUDA_PATH"
29+
echo
30+
echo "PATH="
31+
echo "$PATH"
32+
echo "LD_LIBRARY_PATH="
33+
echo "$LD_LIBRARY_PATH"
34+
echo
35+
echo "------------------------------"
36+
echo
37+
2338
# Check if nvcc is available
2439
echo "Checking for nvcc..."
2540
if ! command -v nvcc &> /dev/null; then

0 commit comments

Comments
 (0)