Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with not building from sdist #91

Merged
merged 15 commits into from
Sep 22, 2024
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
python -m pip install --upgrade pip
pip install setuptools build
pip install .
pip install ".[test,type]"
- name: Test with pytest
run: python -m pytest
- name: Test type hints with mypy
run: mypy --strict tests
- name: Test building from the source distribution
shell: bash
run: |
pip uninstall -y mmh3
python -m build --sdist
python -m pip install dist/*.tar.gz
python -m pytest
mypy --strict tests
8 changes: 8 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools build
python -m build --sdist
- name: Test building from the source distribution
shell: bash
run: |
pip install ".[test,type]"
pip uninstall -y mmh3
python -m pip install dist/*.tar.gz
python -m pytest
mypy --strict tests
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ This project has adhered to
[Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html)
since version 3.0.0.

## [5.0.1] - 2024-09-22

### Fixed

- Fix the issue that the package cannot be built from the source distribution
([#90](https://github.com/hajimes/mmh3/issues/90)).

## [5.0.0] - 2024-09-18

### Added
Expand Down Expand Up @@ -260,6 +267,7 @@ only.
[Softpedia collected mmh3 1.0 on April 27, 2011](https://web.archive.org/web/20110430172027/https://linux.softpedia.com/get/Programming/Libraries/mmh3-68314.shtml),
it must have been uploaded to PyPI on or slightly before this date.

[5.0.1]: https://github.com/hajimes/mmh3/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/hajimes/mmh3/compare/v4.1.0...v5.0.0
[4.1.0]: https://github.com/hajimes/mmh3/compare/v4.0.1...v4.1.0
[4.0.1]: https://github.com/hajimes/mmh3/compare/v4.0.0...v4.0.1
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
[![PyPi Version](https://img.shields.io/pypi/v/mmh3.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.org/project/mmh3/)
[![Python Versions](https://img.shields.io/pypi/pyversions/mmh3.svg)](https://pypi.org/project/mmh3/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit/)
[![Total Downloads](https://static.pepy.tech/badge/mmh3)](https://pepy.tech/project/mmh3?versions=*&versions=4.*&versions=3.*&versions=2.*)
[![Recent Downloads](https://static.pepy.tech/badge/mmh3/month)](https://pepy.tech/project/mmh3?versions=*&versions=4.*&versions=3.*&versions=2.*)
[![Total Downloads](https://static.pepy.tech/badge/mmh3)](https://www.pepy.tech/projects/mmh3?versions=*&versions=5.*&versions=4.*&versions=3.*&versions=2.*)
[![Recent Downloads](https://static.pepy.tech/badge/mmh3/month)](https://www.pepy.tech/projects/mmh3?versions=*&versions=5.*&versions=4.*&versions=3.*&versions=2.*)

`mmh3` is a Python extension for
[MurmurHash (MurmurHash3)](https://en.wikipedia.org/wiki/MurmurHash), a set of
Expand Down Expand Up @@ -80,6 +80,13 @@ in the API Reference for more information.
See [Changelog](https://mmh3.readthedocs.io/en/latest/changelog.html) for the
complete changelog.

### [5.0.1] - 2024-09-22

#### Fixed

- Fix the issue that the package cannot be built from the source distribution
([#90](https://github.com/hajimes/mmh3/issues/90)).

### [5.0.0] - 2024-09-18

#### Added
Expand Down Expand Up @@ -159,8 +166,9 @@ By default, `mmh3` returns **signed** values for the 32-bit and 64-bit versions
and **unsigned** values for `hash128` due to historical reasons. To get the
desired result, use the `signed` keyword argument.

Starting from version 4.0.0, `mmh3` returns the same values on big-endian
platforms as it does on little-endian ones, whereas the original C++ library is
Starting from version 4.0.0, **`mmh3` is endian-neutral**, meaning that its
hash functions return the same values on big-endian platforms as they do on
little-endian ones. In contrast, the original C++ library by Appleby is
endian-sensitive. If you need results that comply with the original library on
big-endian systems, please use version 3.\*.

Expand Down Expand Up @@ -240,5 +248,6 @@ is useful for OSINT and cybersecurity activities.
- <https://github.com/ifduyue/python-xxhash>: Python bindings for xxHash (Yue
Du)

[5.0.1]: https://github.com/hajimes/mmh3/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/hajimes/mmh3/compare/v4.1.0...v5.0.0
[4.1.0]: https://github.com/hajimes/mmh3/compare/v4.0.1...v4.1.0
2 changes: 2 additions & 0 deletions docs/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ bug reports, feature suggestions, and other contributions:
[#25](https://github.com/hajimes/mmh3/issues/25).
- [Jacques Dark](https://github.com/jqdark),
[#12](https://github.com/hajimes/mmh3/issues/12).
- [Matej Spiller Muys](https://github.com/matejsp),
[#90](https://github.com/hajimes/mmh3/issues/90).
- [Niklas Semmler](https://github.com/niklassemmler),
[#7](https://github.com/hajimes/mmh3/issues/7).
- [Ryan](https://github.com/ryanfwy),
Expand Down
7 changes: 7 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ functions particularly useful:
a `bytes` object, similar to the `hashlib` module in the Python Standard
Library. It performs faster than the 32-bit variant on 64-bit machines.

Note that **`mmh3` is endian-neutral**, while the original C++ library is
endian-sensitive (see also
[Known Issues](https://github.com/hajimes/mmh3#known-issues)).
This feature of `mmh3` is essential when portability across different
architectures is required, such as when calculating hash footprints for web
services.

## Basic Hash Functions

The following functions are used to hash immutable types, specifically
Expand Down
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mmh3"
version = "5.0.0"
version = "5.0.1-rc.1"
description = "Python extension for MurmurHash (MurmurHash3), a set of fast and robust hash functions."
readme = "README.md"
license = {file = "LICENSE"}
Expand Down Expand Up @@ -65,14 +65,18 @@ Repository = "https://github.com/hajimes/mmh3"
Changelog = "https://github.com/hajimes/mmh3/blob/master/CHANGELOG.md"
"Bug Tracker" = "https://github.com/hajimes/mmh3/issues"

[tool.isort]
profile = "black"
src_paths = ["src/mmh3/__init__.pyi", "util", "tests", "benchmark", "docs"]

[tool.setuptools]
include-package-data = true
ext-modules = [
{name = "mmh3", sources=["./src/mmh3/mmh3module.c", "./src/mmh3/murmurhash3.c"]}
{name = "mmh3", sources = ["./src/mmh3/mmh3module.c", "./src/mmh3/murmurhash3.c"]}
]

[tool.isort]
profile = "black"
src_paths = ["src/mmh3/__init__.pyi", "util", "tests", "benchmark", "docs"]
[tool.setuptools.package-data]
mmh3 = ["*.h"]

[tool.pylint]
ignore-paths = [
Expand Down
Loading