You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update .gitignore to exclude PyPI build artifacts and enhance README with instructions for using the judge in Google Colab and publishing to PyPI. Modify setup.py to restrict package inclusion to only torch_judge for PyPI distribution.
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,23 @@ No cloud. No signup. No GPU needed. Just `make run` — or try it instantly on H
65
65
66
66
Or open any problem directly in Google Colab — every notebook has an [](https://colab.research.google.com/github/duoan/TorchCode/blob/master/templates/01_relu.ipynb) badge.
67
67
68
+
### Option 0b — Use the judge in Colab (pip)
69
+
70
+
In Google Colab, install the judge from PyPI so you can run `check(...)` without cloning the repo:
71
+
72
+
```bash
73
+
!pip install torch-judge
74
+
```
75
+
76
+
Then in a notebook cell:
77
+
78
+
```python
79
+
from torch_judge import check, status, hint, reset_progress
80
+
status() # list all problems and your progress
81
+
check("relu") # run tests for the "relu" task
82
+
hint("relu") # show a hint
83
+
```
84
+
68
85
### Option 1 — Pull the pre-built image (fastest)
69
86
70
87
```bash
@@ -260,6 +277,35 @@ No registration needed. The judge picks it up automatically.
260
277
261
278
---
262
279
280
+
## 📦 Publishing `torch-judge` to PyPI (maintainers)
281
+
282
+
The judge is published as a separate package so Colab/users can `pip install torch-judge` without cloning the repo.
283
+
284
+
### Automatic (GitHub Action)
285
+
286
+
Pushing a **version tag** (e.g. `v0.1.0`) triggers [`.github/workflows/pypi-publish.yml`](.github/workflows/pypi-publish.yml), which builds and uploads to PyPI.
287
+
288
+
1.**Bump version** in `pyproject.toml` (e.g. `version = "0.1.1"`).
- Run the workflow once (push a tag or **Actions → Publish torch-judge to PyPI → Run workflow**); PyPI will then link the publisher.
293
+
3.**Release**: `git tag v0.1.1 && git push origin v0.1.1` (tag must match the version in `pyproject.toml`).
294
+
295
+
Alternatively, use an API token: add repository secret `PYPI_API_TOKEN` (value = `pypi-...` from PyPI) and set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD` from that secret in the workflow if you prefer not to use Trusted Publishing.
296
+
297
+
### Manual
298
+
299
+
```bash
300
+
pip install build twine
301
+
python -m build
302
+
twine upload dist/*
303
+
```
304
+
305
+
Version is in `pyproject.toml`; bump it before each release.
0 commit comments