From b3091f491fc9102cc16d577677139823de7f6bc9 Mon Sep 17 00:00:00 2001 From: innerNULL Date: Sun, 5 Sep 2021 21:35:35 +0800 Subject: [PATCH] [Expt/Fix] Fix py-pkg header files bug. --- .github/workflows/python-package.yml | 2 +- .github/workflows/python-publish.yml | 7 ++++++- setup.py | 6 +++--- test/python/run_test.py | 12 ++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 test/python/run_test.py diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9b39e72..195bda3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -39,4 +39,4 @@ jobs: - name: Test with pytest run: | #pytest - python3 -c "import pyfeather; print(pyfeather)" + python ./test/python/run_test.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 45112e0..183342a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -46,4 +46,9 @@ jobs: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - twine upload dist/*-manylinux*.whl + twine upload dist/*-manylinux*.whl --verbose + - name: Test published wheels on PyPI + run: | + sleep 5m + python -m pip install pyfeather + python ./test/python/run_test.py diff --git a/setup.py b/setup.py index bdb496b..6d09d17 100644 --- a/setup.py +++ b/setup.py @@ -135,12 +135,12 @@ def build_extension(self, ext): setup( name="pyfeather", - version="0.0.2", + version="0.0.4", author="innerNULL", author_email="", description="A project makes feature-hash easier.", - long_description="A feature-hash lib based on cpp at low level.", - python_requires='>=3.7, <3.10', + long_description="See 'https://github.com/innerNULL/feather'.", + #python_requires='>=3.7, <3.10', ext_modules=[CMakeExtension("pyfeather")], cmdclass={"build_ext": CMakeBuild}, zip_safe=False, diff --git a/test/python/run_test.py b/test/python/run_test.py new file mode 100644 index 0000000..25dd21b --- /dev/null +++ b/test/python/run_test.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + + +import pyfeather + + +if __name__ == "__main__": + libsvm_extractor = pyfeather.LibsvmExtractor("./conf/feather.conf", "ctr", False) + + record1 = "{\"fea1\":2, \"fea10\":3.14, \"fea11\":[2.3, 1.4, 3.5, 6.8], \"ctr\":1}" + output1 = libsvm_extractor.Extract(record1) + print("output1: ", output1)