Skip to content

Commit

Permalink
Trying to get the sdist version to work
Browse files Browse the repository at this point in the history
  • Loading branch information
whitead committed Oct 30, 2022
1 parent a2c1ab8 commit 1d9a341
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
# - name: Build wheels
# uses: pypa/[email protected]
# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl
- name: Build a source tarball
run: |
pip install build
Expand Down
12 changes: 8 additions & 4 deletions molbloom/bloom/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>

#define VERSION "0.1.1"
#define VERSION "0.1.2"
#define FILE_VERSION 1u
#define min(X, Y) (((X) < (Y)) ? (X) : (Y))
#define max(X, Y) (((X) > (Y)) ? (X) : (Y))
Expand Down Expand Up @@ -52,6 +52,8 @@ bloom_t *bloom_new(uint64_t size, uint64_t n, const char *name)
if (strlen(name) > 32)
{
fprintf(stderr, "bloom_new: name too long\n");
free(b->data);
free(b);
return NULL;
}
else
Expand Down Expand Up @@ -130,22 +132,24 @@ bloom_t *bloom_read(char *filename)
if (strcmp(magic, "BLOOM") != 0)
{
fprintf(stderr, "bloom_read: invalid magic number\n");
fclose(f);
return NULL;
}
uint8_t version = getc(f);
char version = getc(f);
if (version != FILE_VERSION)
{
fprintf(stderr, "bloom_read: invalid version number\n");
fclose(f);
return NULL;
}
uint32_t k;
uint64_t m;
fread(&k, sizeof(uint32_t), 1, f);
fread(&m, sizeof(uint64_t), 1, f);
bloom_t *b = malloc(sizeof(bloom_t));
bloom_t *b = (bloom_t *)malloc(sizeof(bloom_t));
b->k = k;
b->m = m;
b->data = malloc(m / 8);
b->data = (char *)malloc(m / 8);
strcpy(b->name, "loaded bloom filter");
fread(b->data, 1, m / 8, f);
fclose(f);
Expand Down
2 changes: 1 addition & 1 deletion molbloom/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build-system]
requires = ["setuptools ~= 59.0", "cython ~= 0.29.0"]
requires = ["setuptools ~= 59.0", "cython ~= 0.29.0", "wheel"]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
]
),
include_dirs=["molbloom/bloom"],
version=__version__,
description="Purchaseable SMILES filter",
author="Andrew White",
Expand Down
3 changes: 3 additions & 0 deletions tool/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
molbloom/bloom.pyx
molbloom/cbloomd.pxd
molbloom/bloom/bloom.h
2 changes: 1 addition & 1 deletion tool/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CC := cc

main: main.c
${CC} main.c -o molbloom-bloom -I../molbloom/bloom -lm
${CC} -Wall main.c -o molbloom-bloom -I../molbloom/bloom -lm

clean:
rm -rvf *.o molbloom

0 comments on commit 1d9a341

Please sign in to comment.