Skip to content

Commit

Permalink
Merge pull request #240 from apache/py_readme_cleanup
Browse files Browse the repository at this point in the history
Python cleanup
  • Loading branch information
jmalkin authored Sep 23, 2021
2 parents dfe001c + 486a586 commit a1f5c54
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
43 changes: 40 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,48 @@ APPENDIX B: Additional licenses relevant to this product.
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------
Code Locations
Code Locations:
* https://github.com/apache/datasketches-cpp/blob/master/common/test/catch.hpp
that is adapted from the above.


=============================================================
BSD License
=============================================================
Original source code:
https://github.com/pybind/pybind11/blob/master/LICENSE

Copyright (c) 2016 Wenzel Jakob <[email protected]>, All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------
Code Locations:
Found only in the convenience binaries distributed from PyPI, which rely
on pybind11 code during compilation.


=============================================================
Public Domain
Expand All @@ -297,15 +334,15 @@ APPENDIX B: Additional licenses relevant to this product.
https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp
Placed in the Public Domain by Austin Appleby

Code Locations
Code Locations:
common/include/MurmurHash3.h
that is adapted from the above.
-------------------------------------------------------------
Original source code:
* https://graphics.stanford.edu/~seander/bithacks.html
* Placed in the Public Domain by Sean Eron Anderson

Code Locations
Code Locations:
* common/include/ceiling_power_of_2.hpp
that is adapted from the above.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ envlist = py3
[testenv]
deps = pytest
numpy
pybind11 >= 2.6.0
changedir = python/tests
commands = pytest
"""
19 changes: 14 additions & 5 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Python Wrapper for Apache DataSketches
<img src="https://raw.githubusercontent.com/apache/datasketches-website/master/logos/svg/datasketches-HorizontalColor-TM.svg" width="75%" alt="Apache DataSketchs Logo">

# The Apache DataSketches Library for Python

This is the official version of the [Apache DataSketches](https://datasketches.apache.org) Python library.

Expand All @@ -10,15 +12,15 @@ This package provides a variety of sketches as described below. Wherever a speci

## Building and Installation

Once cloned, the library can be installed by running `python -m pip install .` in the project root directory, which will also install the necessary dependencies, namely [pybind11](https://github.com/pybind/pybind11) and numpy.
Once cloned, the library can be installed by running `python -m pip install .` in the project root directory, which will also install the necessary dependencies, namely numpy and [pybind11[global]](https://github.com/pybind/pybind11).

If you prefer to call the `setup.py` build script directly, you must first install `pybind11[global]`, as well as any other dependencies listed under the build-system section in `pyproject.toml`.

The library is also available (or soon will be) from PyPI via `python -m pip install datasketches`.
The library is also available from PyPI via `python -m pip install datasketches`.

## Usage

Having installed the library, loading the Apache Datasketches library in Python is simple: `import datasketches`.
Having installed the library, loading the Apache Datasketches Library in Python is simple: `import datasketches`.

## Available Sketch Classes

Expand Down Expand Up @@ -66,7 +68,14 @@ The only developer-specific instructions relate to running unit tests.
### Unit tests

The Python unit tests are run with `tox`. To ensure you have all the needed package, from the package base directory run:
```

```bash
python -m pip install --upgrade tox
tox
```

## License

The Apache DataSketches Library is distrubted under an Apache 2.0 License.

There may be precompiled binaries provided as a convenience and distributed through PyPI via [https://pypi.org/project/datasketches/] contain compiled code from [pybind11](https://github.com/pybind/pybind11), which is distributed under a BSD license.
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,19 @@ def build_extension(self, ext):

setup(
name='datasketches',
version='3.2.0',
author='Apache DataSketches Developers',
version='3.2.0.1',
author='Apache Software Foundation',
author_email='[email protected]',
description='A wrapper for the C++ Apache DataSketches library',
description='The Apache DataSketches Library for Python',
license='Apache License 2.0',
url='http://datasketches.apache.org',
long_description=open('python/README.md').read(),
long_description_content_type='text/markdown',
packages=find_packages('python'), # python pacakges only in this dir
package_dir={'':'python'},
# may need to add all source paths for sdist packages w/o MANIFEST.in
ext_modules=[CMakeExtension('datasketches')],
cmdclass={'build_ext': CMakeBuild},
install_requires=['numpy', 'pybind11 >= 2.6.0'],
install_requires=['numpy'],
zip_safe=False
)

0 comments on commit a1f5c54

Please sign in to comment.