Skip to content

Commit d8b4647

Browse files
authored
Broken cython publish (#248)
* sets the github action to only publish sdist packages to pypi as the wheels are missing the compiled versions * change paper building to only build the paper during a pull request to the paper branch * adds `noexception` flags to cython code where needed
1 parent 23463a3 commit d8b4647

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

.github/workflows/draft-pdf.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Build paper PDF
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
branches:
6+
- paper
47

58
jobs:
69
paper:

.github/workflows/python-publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
name: ${{ matrix.os }} ${{ matrix.python-version }}
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest, macOS-latest, windows-latest]
13-
python-version: ['3.8', '3.9', '3.10', '3.11']
14-
poetry-version: [1.2]
12+
os: [ubuntu-latest]
13+
python-version: ['3.11']
14+
# os: [ubuntu-latest, macOS-latest, windows-latest]
15+
# python-version: ['3.8', '3.9', '3.10', '3.11']
16+
poetry-version: [1.6]
1517
fail-fast: false
1618
runs-on: ${{ matrix.os }}
1719

@@ -27,5 +29,7 @@ jobs:
2729
poetry-version: ${{ matrix.poetry-version }}
2830
- name: Install package
2931
run: poetry install
30-
- name: Build and publish package
31-
run: poetry publish --build --skip-existing --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
32+
- name: Build package
33+
run: poetry build --format sdist
34+
- name: Publish package
35+
run: poetry publish --skip-existing --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}

pyndl/ndl_parallel.pxd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ from error_codes cimport ErrorCode
88

99
cdef ErrorCode learn_inplace_binary_to_binary_ptr(char*, dtype_t, dtype_t, dtype_t, dtype_t,
1010
dtype_t*, unsigned int, unsigned int*, unsigned int,
11-
unsigned int) nogil
11+
unsigned int) noexcept nogil
1212

1313

1414
cdef ErrorCode learn_inplace_binary_to_real_ptr(char*, dtype_t, dtype_t*,
1515
dtype_t*, unsigned int, unsigned int, unsigned int,
16-
unsigned int) nogil
16+
unsigned int) noexcept nogil
1717

1818

1919
cdef ErrorCode learn_inplace_real_to_real_ptr(char*, dtype_t, dtype_t*,
2020
dtype_t*, dtype_t*, unsigned int, unsigned int,
21-
unsigned int, unsigned int) nogil
21+
unsigned int, unsigned int) noexcept nogil
2222

2323

2424
cdef ErrorCode learn_inplace_real_to_binary_ptr(char*, dtype_t, dtype_t,
2525
dtype_t, dtype_t*, dtype_t*, unsigned int, unsigned
26-
int, unsigned int) nogil
26+
int, unsigned int) noexcept nogil

pyndl/ndl_parallel.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ test_index += test_cue_index
3131
assert test_index == 18446744069414584320
3232

3333

34-
cdef inline void read_next_int(void *data, FILE *binary_file) nogil:
34+
cdef inline void read_next_int(void *data, FILE *binary_file) noexcept nogil:
3535
fread(data, 4, 1, binary_file) # little endian
3636

3737

3838
cdef extern from "stdio.h":
3939
#FILE * fopen ( const char * filename, const char * mode )
40-
FILE *fopen(const char *, const char *) nogil
40+
FILE *fopen(const char *, const char *) noexcept nogil
4141
#int fclose ( FILE * stream )
42-
int fclose(FILE *) nogil
42+
int fclose(FILE *) noexcept nogil
4343
#size_t fread ( void *ptr, size_t size, size_t count, FILE *stream );
44-
size_t fread (void *, size_t, size_t, FILE *) nogil
44+
size_t fread (void *, size_t, size_t, FILE *) noexcept nogil
4545

4646

4747
def learn_inplace_binary_to_binary(binary_file_paths,
@@ -78,7 +78,7 @@ def learn_inplace_binary_to_binary(binary_file_paths,
7878

7979

8080

81-
cdef int is_element_of(unsigned int elem, unsigned int* arr, unsigned int size) nogil:
81+
cdef int is_element_of(unsigned int elem, unsigned int* arr, unsigned int size) noexcept nogil:
8282
cdef unsigned int ii
8383
for ii in range(size):
8484
if arr[ii] == elem:
@@ -94,7 +94,7 @@ cdef ErrorCode learn_inplace_binary_to_binary_ptr(char* binary_file_path,
9494
unsigned int n_all_cues,
9595
unsigned int* all_outcome_indices,
9696
unsigned int start,
97-
unsigned int end) nogil:
97+
unsigned int end) noexcept nogil:
9898

9999

100100
cdef unsigned int number_of_events, number_of_cues, number_of_outcomes
@@ -178,7 +178,7 @@ cdef ErrorCode learn_inplace_binary_to_real_ptr(char* binary_file_path,
178178
unsigned int n_all_cues,
179179
unsigned int n_outcome_vector_dimensions,
180180
unsigned int start,
181-
unsigned int end) nogil:
181+
unsigned int end) noexcept nogil:
182182

183183

184184
cdef unsigned int number_of_events, number_of_cues, number_of_outcomes
@@ -265,7 +265,7 @@ cdef ErrorCode learn_inplace_real_to_real_ptr(char* binary_file_path,
265265
unsigned int n_cue_vector_dimensions,
266266
unsigned int n_outcome_vector_dimensions,
267267
unsigned int start,
268-
unsigned int end) nogil:
268+
unsigned int end) noexcept nogil:
269269

270270
cdef unsigned int number_of_events, number_of_cues, number_of_outcomes
271271
cdef dtype_t association_strength, update, summed_cue_vector_value, summed_outcome_vector_value
@@ -376,7 +376,7 @@ cdef ErrorCode learn_inplace_real_to_binary_ptr(char* binary_file_path,
376376
dtype_t* weights,
377377
unsigned int n_cue_vector_dimensions,
378378
unsigned int start,
379-
unsigned int end) nogil:
379+
unsigned int end) noexcept nogil:
380380

381381
cdef unsigned int number_of_events, number_of_cues, number_of_outcomes
382382
cdef dtype_t association_strength, update, summed_cue_vector_value

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyndl"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
description = "Naive discriminative learning implements learning and classification models based on the Rescorla-Wagner equations."
55

66
license = "MIT"

0 commit comments

Comments
 (0)