Skip to content

Commit d94a31f

Browse files
committed
Add auto build uploading
1 parent f56f093 commit d94a31f

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2727
2828
build:
29-
name: Test
29+
name: Build
3030
runs-on: ${{ matrix.os }}
3131
strategy:
3232
fail-fast: false
@@ -60,6 +60,24 @@ jobs:
6060
else
6161
chmod +x ./build.sh && ./build.sh
6262
fi
63+
64+
- name: Find Correct Build
65+
id: findbuild
66+
shell: bash
67+
run: |
68+
if [[ "$RUNNER_OS" == "Windows" ]]; then
69+
output=__pyfastutil.pyd
70+
else
71+
output=__pyfastutil.so
72+
fi
73+
echo "::set-output name=libname::$output"
74+
75+
- name: Upload Build Artifacts
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: ${{ steps.findbuild.outputs.libname }}
79+
path: pyfastutil/${{ steps.findbuild.outputs.libname }}
80+
6381
- name: Test with pytest and generate coverage report
6482
run: |
6583
pytest --cov=your_package_name --cov-report=xml

pyfastutil/src/ints/BigIntArrayList.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ static PyObject *BigIntArrayList_remove(PyObject *pySelf, PyObject *object) {
412412
static PyObject *BigIntArrayList_sort(PyObject *pySelf, PyObject *args, PyObject *kwargs) {
413413
auto *self = reinterpret_cast<BigIntArrayList *>(pySelf);
414414

415-
PyObject *keyFunc = nullptr;
415+
PyObject *keyFunc = Py_None;
416416
int reverseInt = 0; // default: false
417-
static const char *kwlist[] = {"key", "reverse", nullptr};
417+
static constexpr const char *kwlist[] = {"key", "reverse", nullptr};
418418

419419
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Oi", const_cast<char **>(kwlist), &keyFunc, &reverseInt)) {
420420
return nullptr;
@@ -424,7 +424,7 @@ static PyObject *BigIntArrayList_sort(PyObject *pySelf, PyObject *args, PyObject
424424

425425
// do sort
426426
try {
427-
if (keyFunc == nullptr || keyFunc == Py_None) {
427+
if (keyFunc == Py_None) {
428428
if (self->vector.size() >= 32) {
429429
// simd sort with auto-fallback
430430
Py_BEGIN_ALLOW_THREADS

pyfastutil/src/ints/IntArrayList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static PyObject *IntArrayList_sort(PyObject *pySelf, PyObject *args, PyObject *k
414414

415415
PyObject *keyFunc = nullptr;
416416
int reverseInt = 0; // default: false
417-
static const char *kwlist[] = {"key", "reverse", nullptr};
417+
static constexpr const char *kwlist[] = {"key", "reverse", nullptr};
418418

419419
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Oi", const_cast<char **>(kwlist), &keyFunc, &reverseInt)) {
420420
return nullptr;

0 commit comments

Comments
 (0)