update readme and setup.py
This commit is contained in:
parent
cf2195e383
commit
ab449ca78b
4 changed files with 47 additions and 64 deletions
27
README.md
Normal file
27
README.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
## lbry-rocksdb
|
||||
|
||||
### Note
|
||||
The `python-rocksdb` and `pyrocksdb` packages haven't been updated in a long time - this repo is a fork of python-rocksdb with many of the PRs to it merged, and with [bunch of updates and improvements](https://github.com/iFA88/python-rocksdb) from @iFA88 and @mosquito.
|
||||
|
||||
|
||||
### Install from pip
|
||||
pip install lbry-rocksdb
|
||||
|
||||
|
||||
### Install for development / from source
|
||||
sudo apt install build-essential binutils
|
||||
git clone https://github.com/lbryio/lbry-rocksdb.git
|
||||
cd lbry-rocksdb
|
||||
git submodule update --init --recursive
|
||||
git pull --recurse-submodules
|
||||
make clean && make
|
||||
pip install -e .
|
||||
python -m unittest discover . -v
|
||||
|
||||
|
||||
### Quick Usage Guide
|
||||
>>> import rocksdb
|
||||
>>> db = rocksdb.DB("test.db", rocksdb.Options(create_if_missing=True))
|
||||
>>> db.put(b'a', b'data')
|
||||
>>> print db.get(b'a')
|
||||
b'data'
|
55
README.rst
55
README.rst
|
@ -1,55 +0,0 @@
|
|||
Note
|
||||
=========
|
||||
The original pyrocksdb (https://pypi.python.org/pypi/pyrocksdb/0.4) has not been updated for long time. I update pyrocksdb to support the latest rocksdb. Please open issues in github if you have any problem.
|
||||
|
||||
News (2021/08/26 iFA)
|
||||
=========
|
||||
Thanks for @mosquito (https://github.com/mosquito) who coded a github workflow to build static lib automatically.
|
||||
Python version which lower than 3.7 is not supported anymore.
|
||||
|
||||
News (2020/09/03 iFA)
|
||||
=========
|
||||
Python version which lower than 3.0 is not supported anymore.
|
||||
|
||||
pyrocksdb
|
||||
=========
|
||||
|
||||
Python bindings for RocksDB.
|
||||
See http://python-rocksdb.readthedocs.io/en/latest/ for a more comprehensive install and usage description.
|
||||
|
||||
|
||||
Quick Install
|
||||
-------------
|
||||
|
||||
Quick install for debian/ubuntu like linux distributions.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ apt-get install build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev
|
||||
$ git clone https://github.com/facebook/rocksdb.git
|
||||
$ cd rocksdb
|
||||
$ mkdir build && cd build
|
||||
$ cmake ..
|
||||
$ make
|
||||
$ cd ..
|
||||
$ export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+:}`pwd`/include/
|
||||
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}`pwd`/build/
|
||||
$ export LIBRARY_PATH=${LIBRARY_PATH}${LIBRARY_PATH:+:}`pwd`/build/
|
||||
|
||||
$ apt-get install python-virtualenv python-dev
|
||||
$ virtualenv pyrocks_test
|
||||
$ cd pyrocks_test
|
||||
$ . bin/active
|
||||
$ pip install python-rocksdb
|
||||
|
||||
|
||||
Quick Usage Guide
|
||||
-----------------
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
>>> import rocksdb
|
||||
>>> db = rocksdb.DB("test.db", rocksdb.Options(create_if_missing=True))
|
||||
>>> db.put(b'a', b'data')
|
||||
>>> print db.get(b'a')
|
||||
b'data'
|
|
@ -1 +1,4 @@
|
|||
from ._rocksdb import *
|
||||
|
||||
ROCKSDB_VERSION = '6.25.3' # 0103296f39ec3fd89b4cdda9687c63fde90eec24
|
||||
__version__ = "0.8.1"
|
||||
|
|
26
setup.py
26
setup.py
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
import platform
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
@ -14,6 +15,10 @@ except ImportError:
|
|||
else:
|
||||
SOURCES = ['rocksdb/_rocksdb.pyx']
|
||||
|
||||
with open(os.path.join(os.path.dirname(__file__), 'rocksdb', '__init__.py'), 'r') as init_file:
|
||||
version_line = [l for l in init_file.readlines() if l.startswith('__version__ = "')][0]
|
||||
version = version_line.split('__version__ = "')[1][:-2]
|
||||
|
||||
EXTRA_COMPILE_ARGS = [
|
||||
'-std=c++11',
|
||||
'-fPIC',
|
||||
|
@ -60,17 +65,21 @@ if all(map(os.path.exists, STATIC_LIBRARIES)):
|
|||
os.path.join("src", "rocksdb", "lz4-1.9.3", "lib"),
|
||||
os.path.join("src", "rocksdb", "include"),
|
||||
]
|
||||
|
||||
print("✔️ all static libraries exist in expected locations")
|
||||
else:
|
||||
print('✘ missing static library files')
|
||||
sys.exit(1)
|
||||
|
||||
setup(
|
||||
name="python-rocksdb",
|
||||
version='0.7.0',
|
||||
name="lbry-rocksdb",
|
||||
version=version,
|
||||
keywords=['rocksdb', 'static', 'build'],
|
||||
description="Python bindings for RocksDB",
|
||||
long_description=open("README.rst").read(),
|
||||
author='Ming Hsuan Tu',
|
||||
author_email="qrnnis2623891@gmail.com",
|
||||
url="https://github.com/twmht/python-rocksdb",
|
||||
long_description=open("README.md").read(),
|
||||
long_description_content_type='text/markdown',
|
||||
author='Jack Robison',
|
||||
author_email="jackrobison@lbry.com",
|
||||
url="https://github.com/lbryio/lbry-rocksdb",
|
||||
license='BSD License',
|
||||
python_requires=">=3.7.0",
|
||||
setup_requires=['setuptools>=25', 'Cython>=0.20'],
|
||||
|
@ -88,8 +97,7 @@ setup(
|
|||
extra_link_args=EXTRA_LINK_ARGS,
|
||||
)]),
|
||||
extras_require={
|
||||
"doc": ['sphinx_rtd_theme', 'sphinx'],
|
||||
"test": ['pytest'],
|
||||
"doc": ['sphinx_rtd_theme', 'sphinx']
|
||||
},
|
||||
include_package_data=False,
|
||||
zip_safe=False,
|
||||
|
|
Loading…
Reference in a new issue