diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index 9120653..67e0d65 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -51,11 +51,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir name: artifact path: dist - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository_url: https://test.pypi.org/legacy/ diff --git a/README.md b/README.md index 77dc88b..610f2d8 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ This is a python module for encoding, decoding, and correcting data using [BCH c $ pip install bchlib ## Installing from source: - Make sure you have python-dev setup. For Windows, this means you need [Visual Studio 2015](https://stackoverflow.com/a/44290942/6844002). + On Linux, you will need python-dev or equivalent package. Windows, you need Microsoft Visual C++. I've tested this manually using [Visual Studio 2015](https://stackoverflow.com/a/44290942/6844002). $ pip install . ## Usage Example - See [the tests directory](tests) for usage examles. + See Python's built-in help `import bchlib; help(bchlib)` and the module's [tests](tests) for usage examples. diff --git a/setup.py b/setup.py index 1cb468e..ee71f11 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ NAME = 'bchlib' VERSION = '1.0.0' -DESCRIPTION = 'A python wrapper module for the Linux kernel BCH library.', +DESCRIPTION = 'A python wrapper module for the Linux kernel BCH library.' URL = 'https://github.com/jkent/python-bchlib' EMAIL = 'jeff@jkent.net' AUTHOR = 'Jeff Kent' @@ -40,7 +40,6 @@ url=URL, ext_modules=[BCHLIB_EXT], include_package_data=True, - license='GNU GPLv2', classifiers=[ 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', 'Programming Language :: Python', diff --git a/src/bchlib.c b/src/bchlib.c index 8245151..4e102de 100644 --- a/src/bchlib.c +++ b/src/bchlib.c @@ -386,26 +386,33 @@ static PyMemberDef BCH_members[] = { }; static PyMethodDef BCH_methods[] = { - {"encode", (PyCFunction) BCH_encode, METH_VARARGS | METH_KEYWORDS, - "\b\b\b\bencode(data[, ecc]) → ecc\nEncodes 'data' with an " - "optional starting 'ecc'. Returns the calculated\necc."}, - {"decode", (PyCFunction) BCH_decode, METH_VARARGS | METH_KEYWORDS, - "\b\b\b\bdecode(data=None, recv_ecc=None, calc_ecc=None, " - "syn=None) → nerr\nCalculates error locations and returns " - "the number of errors found or\nnegative if decoding failed.\n\n" - "There are four ways that 'decode' can function by providing " - "different\ninput parameters:\n\n 'data' and 'recv_ecc'\n" - " 'recv_ecc' and 'calc_ecc'\n 'calc_ecc' (as recv_ecc XOR " - "calc_ecc)\n 'syn' (a sequence of 2*t values)\n\n'data_len' " - "SHOULD be set before calling this function."}, - {"correct", (PyCFunction) BCH_correct, METH_VARARGS | METH_KEYWORDS, - "\b\b\b\bcorrect(data=None, ecc=None) → None\nCorrects 'data' " - "and 'ecc' if provided. Buffers must not be readonly."}, + {"encode", (PyCFunction) BCH_encode, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b" + "encode(data[, ecc]) → ecc\n" + "Encodes 'data' with an optional starting 'ecc'. Returns the\n" + "calculated ecc."}, + {"decode", (PyCFunction) BCH_decode, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b" + "decode(data=None, recv_ecc=None, calc_ecc=None, syn=None) → nerr\n" + "Calculates error locations and returns the number of errors found\n" + "or negative if decoding failed.\n\n" + + "There are four ways that 'decode' can function by providing\n" + "different input parameters:\n\n" + + " 'data' and 'recv_ecc'\n" + " 'recv_ecc' and 'calc_ecc'\n" + " 'calc_ecc' (as recv_ecc XOR calc_ecc)\n" + " 'syn' (a sequence of 2*t values)\n\n" + + "'data_len' SHOULD be set before calling this function."}, + {"correct", (PyCFunction) BCH_correct, METH_VARARGS | METH_KEYWORDS, "\b\b\b\b" + "correct(data=None, ecc=None) → None\n" + "Corrects 'data' and 'ecc' if provided. Buffers must not be\n" + "readonly."}, {"compute_even_syn", (PyCFunction) BCH_compute_even_syn, - METH_VARARGS | METH_KEYWORDS, - "\b\b\b\bcompute_even_syn(syn) → syn\nComputes even syndromes " - "from odd ones. Takes a sequence of 2*t values\nand returns a " - "tuple of 2*t elements."}, + METH_VARARGS | METH_KEYWORDS, "\b\b\b\b" + "compute_even_syn(syn) → syn\n" + "Computes even syndromes from odd ones. Takes a sequence of\n" + "2*t values and returns a tuple of 2*t elements."}, {NULL} }; @@ -416,14 +423,17 @@ static PyTypeObject BCHType = { .tp_dealloc = (destructor) BCH_dealloc, .tp_getattro = (getattrofunc) BCH_getattr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - .tp_doc = "BCH Encoder/Decoder\n\n" -"__init__(t, poly=None, m=None, swap_bits=False) → bch\n" -" Constructor creates a BCH object with given 't' bit strength. At\n" -" least one of 'poly' and/or 'm' must be provided. If 'poly' is provided\n" -" but 'm' (Galois field order) is not, 'm' will be calculated\n" -" automatically. If 'm' between 5 and 15 inclusive is provided, 'poly'\n" -" will be selected automatically. The 'swap_bits' parameter will reverse\n" -" the bit order within data and syndrome bytes.", + .tp_doc = + "BCH Encoder/Decoder\n\n" + + "__init__(t, poly=None, m=None, swap_bits=False) → bch\n" + " Constructor creates a BCH object with given 't' bit strength. At\n" + " least one of 'poly' and/or 'm' must be provided. If 'poly' is\n" + " provided but 'm' (Galois field order) is not, 'm' will be\n" + " calculated automatically. If 'm' between 5 and 15 inclusive is'\n" + " provided, 'polywill be selected automatically. The 'swap_bits'\n" + " parameter will reverse the bit order within data and syndrome\n" + " bytes.", .tp_methods = BCH_methods, .tp_members = BCH_members, .tp_init = (initproc) BCH_init,