Skip to content

Commit 6c2b75c

Browse files
authored
Merge pull request #35 from AMYPAD/pypi-trusted-publish
2 parents b1df21d + 32fb56a commit 6c2b75c

3 files changed

Lines changed: 29 additions & 12 deletions

File tree

.github/workflows/comment-bot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ jobs:
66
tag: # /tag <tagname> <commit>
77
if: startsWith(github.event.comment.body, '/tag ')
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
issues: write
913
steps:
1014
- uses: actions/checkout@v4
1115
- name: React Seen
@@ -27,7 +31,6 @@ jobs:
2731
post({
2832
owner: context.repo.owner, repo: context.repo.repo,
2933
comment_id: context.payload.comment.id, content: "eyes"})
30-
github-token: ${{ secrets.GH_TOKEN }}
3134
- name: Tag Commit
3235
run: |
3336
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} repo
@@ -47,4 +50,3 @@ jobs:
4750
post({
4851
owner: context.repo.owner, repo: context.repo.repo,
4952
comment_id: context.payload.comment.id, content: "rocket"})
50-
github-token: ${{ secrets.GH_TOKEN }}

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ jobs:
113113
deploy:
114114
needs: [check, test, cuda]
115115
name: PyPI Deploy
116+
environment: pypi
117+
permissions:
118+
contents: write
119+
id-token: write
116120
runs-on: ubuntu-latest
117121
steps:
118122
- uses: actions/checkout@v4
@@ -126,8 +130,9 @@ jobs:
126130
uses: casperdcl/deploy-pypi@v2
127131
with:
128132
build: -s
129-
password: ${{ secrets.PYPI_TOKEN }}
130-
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
133+
upload: false
134+
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
135+
uses: pypa/gh-action-pypi-publish@release/v1
131136
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
132137
name: Release
133138
run: |

CONTRIBUTING.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,30 @@ Install in "development/editable" mode including dev/test dependencies:
44

55
```sh
66
git clone https://github.com/AMYPAD/CuVec && cd CuVec
7-
export SETUPTOOLS_ENABLE_FEATURES=legacy-editable
8-
pip install -e .[dev]
7+
8+
# `pip install -e .[dev]` won't work due to https://github.com/scikit-build/scikit-build-core/issues/114
9+
# work-around:
10+
# 1. install dependencies (one-off)
11+
pip install toml
12+
python -c 'import toml; c=toml.load("pyproject.toml")
13+
print("\0".join(c["build-system"]["requires"] + c["project"]["dependencies"] + c["project"]["optional-dependencies"]["dev"]), end="")' \
14+
| xargs -0 pip install -U ninja cmake
15+
# 2. delete build artefacts, (re)build & install in-place with debug info
16+
git clean -Xdf
17+
pip install --no-build-isolation --no-deps -t . -U -v . \
18+
-Ccmake.define.CUVEC_DEBUG=1
19+
-Ccmake.define.CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type"
20+
git restore cuvec/src # undo deletion of sources
921
```
1022

11-
Alternatively, if `cmake` and a generator (such as `make` or `ninja`) are
12-
available, then `setup.py build` and `develop` can be explicitly called;
13-
optionally with extra `cmake` and generator arguments:
23+
Once installed in development/editable mode, tests may be run using:
1424

1525
```sh
16-
python setup.py build develop easy_install cuvec[dev] -- -DCUVEC_DEBUG:BOOL=ON -- -j8
26+
pytest
1727
```
1828

19-
Once installed in development/editable mode, tests may be run using:
29+
To run performance tests, build with debugging disabled (`CUVEC_DEBUG=0`), then run:
2030

2131
```sh
22-
pytest
32+
python tests/test_perf.py
2333
```

0 commit comments

Comments
 (0)