Skip to content

Commit 3ed0632

Browse files
authored
Use pypa to publish to pypi instead of maturin (#207)
As we are having issues with the `maturin upload` action, this PR proposes to use the pypa action that is used in Outlines to publish the wheels to pypi. It also adds a debug step that prints out some information on the working directory and that are intended to be removed in the future.
1 parent 1a74d8d commit 3ed0632

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ jobs:
4545
- name: Dry-run publish to crates.io
4646
run: cargo publish --dry-run --allow-dirty
4747

48-
- name: Publish to PyPI
49-
uses: PyO3/maturin-action@v1
50-
env:
51-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_SECRET}}
48+
- name: Print directory information
49+
run: |
50+
pwd
51+
ls -la
52+
ls -la dist
53+
54+
- name: Publish to PyPi
55+
uses: pypa/gh-action-pypi-publish@v1.4.2
5256
with:
53-
command: upload
54-
args: --non-interactive --skip-existing dist/*
57+
user: __token__
58+
password: ${{ secrets.PYPI_SECRET }}
5559

5660
- name: Publish to crates.io
5761
env:

src/python_bindings/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl PyGuide {
9292
/// `data_ptr` should be the data ptr to a `torch.tensor`, or `np.ndarray`, `mx.array` or other
9393
/// contiguous memory array.
9494
fn write_mask_into(&self, data_ptr: usize, numel: usize, element_size: usize) -> PyResult<()> {
95-
let expected_elements = (self.index.0.vocab_size() + 31) / 32;
95+
let expected_elements = self.index.0.vocab_size().div_ceil(32);
9696
if element_size != 4 {
9797
return Err(PyErr::new::<pyo3::exceptions::PyValueError, _>(
9898
format!(

0 commit comments

Comments
 (0)