Skip to content

Commit 3515961

Browse files
authored
fix broken Windows build (#12)
* ad build-test workflow GitHub action * version bump
1 parent 46d987f commit 3515961

8 files changed

Lines changed: 67 additions & 28 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is a partial whorkflow. Use wheels.yml for more
2+
# complete workflow.
3+
name: Build and Test
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
- reopened
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [macos-10.15, windows-2019, ubuntu-latest]
20+
python-version: [3.6, 3.7, 3.8, 3.9]
21+
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
architecture: x64
30+
- name: Install dependencies
31+
run: |
32+
pip install setuptools wheel
33+
pip install -r requirements.txt
34+
pip install .
35+
- name: Test with pytest
36+
run: python -m pytest

README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ To use this package in your program, simply type
3434
3535
3636
After that, you should be able to import the module and do things with it (see
37-
Example Usage below).
37+
usage example below).
3838

3939
Usage Examples
4040
--------------
4141

42-
Stateless Hashing
42+
Stateless hashing
4343
~~~~~~~~~~~~~~~~~
4444

4545
This package provides Python interfaces to 64- and 128-bit implementations of
4646
MetroHash algorithm. For stateless hashing, it exports ``metrohash64`` and
47-
``metrohash128`` functions. Both take a value to be hashed (either string or
48-
unicode) and an optional ``seed`` parameter:
47+
``metrohash128`` functions. Both take a value to be hashed and an optional
48+
``seed`` parameter:
4949

5050
.. code-block:: python
5151
@@ -57,7 +57,7 @@ unicode) and an optional ``seed`` parameter:
5757
182995299641628952910564950850867298725
5858
5959
60-
Incremental Hashing
60+
Incremental hashing
6161
~~~~~~~~~~~~~~~~~~~
6262

6363
For incremental hashing, use ``MetroHash64`` and ``MetroHash128`` classes.
@@ -82,7 +82,7 @@ Note that the resulting hash value above is the same as in:
8282
>>> mh.intdigest()
8383
7851180100622203313
8484
85-
Buffer Protocol Support
85+
Buffer protocol support
8686
~~~~~~~~~~~~~~~~~~~~~~~
8787

8888
The methods in this module support Python `Buffer Protocol
@@ -129,8 +129,8 @@ extensions, see `CityHash <https://github.com/escherba/python-cityhash>`__ and
129129

130130
Authors
131131
-------
132-
The original MetroHash algorithm was designed by J. Andrew Rogers. The Python
133-
bindings in this package were written by Eugene Scherba.
132+
The MetroHash algorithm and C++ implementation is due to J. Andrew Rogers. The
133+
Python bindings for it were written by Eugene Scherba.
134134

135135
License
136136
-------

pip-freeze.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ipdb==0.13.9
1010
ipython==7.30.1
1111
jedi==0.18.1
1212
matplotlib-inline==0.1.3
13-
-e git+https://github.com/escherba/python-metrohash@58720ab4383131ba9942cf728f237f0747f5286d#egg=metrohash
13+
-e git+https://github.com/escherba/python-metrohash@2e8b2c0ea0712339c65cda0c47649f9f1321243a#egg=metrohash
1414
numpy==1.21.5
1515
packaging==21.3
1616
parso==0.8.3
@@ -21,7 +21,7 @@ pluggy==1.0.0
2121
prompt-toolkit==3.0.24
2222
ptyprocess==0.7.0
2323
py==1.11.0
24-
Pygments==2.10.0
24+
Pygments==2.11.0
2525
pyparsing==3.0.6
2626
pytest==6.2.5
2727
six==1.16.0
@@ -30,4 +30,4 @@ traitlets==5.1.1
3030
typing_extensions==4.0.1
3131
virtualenv==20.11.2
3232
wcwidth==0.2.5
33-
zipp==3.6.0
33+
zipp==3.7.0

python.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ env: env/bin/activate ## set up a virtual environment
8181
env/bin/activate: setup.py requirements.txt
8282
test -f $@ || virtualenv $(VENV_OPTS) env
8383
export SETUPTOOLS_USE_DISTUTILS=stdlib; $(PYENV) curl https://bootstrap.pypa.io/ez_setup.py | $(INTERPRETER)
84-
$(PIP) install -U pip
84+
$(PIP) install -U pip wheel
8585
$(PIP) install -r requirements.txt
8686
$(PIP) install -e .
8787
$(PIP) freeze > pip-freeze.txt

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ numpy
55
pytest
66
setuptools
77
virtualenv
8-
wheel

setup.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
import os
34
import warnings
45
from os.path import join, dirname
56
from setuptools import setup
@@ -29,11 +30,14 @@ def is_pure(self):
2930
return False
3031

3132

32-
CXXFLAGS = """
33-
-O3
34-
-Wno-unused-value
35-
-Wno-unused-function
36-
""".split()
33+
CXXFLAGS = ["-O3"]
34+
35+
if os.name != "nt":
36+
CXXFLAGS.extend([
37+
"-Wno-unused-value",
38+
"-Wno-unused-function",
39+
])
40+
3741

3842
if HAVE_SSE42:
3943
warnings.warn("Compiling with SSE4.2 enabled")
@@ -82,7 +86,7 @@ def is_pure(self):
8286
)
8387

8488

85-
VERSION = '0.1.0.post6'
89+
VERSION = '0.1.1'
8690
URL = "https://github.com/escherba/python-metrohash"
8791

8892

src/metrohash.cpp

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/metrohash.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Python wrapper for MetroHash, a fast non-cryptographic hashing algorithm
1010

1111
__author__ = "Eugene Scherba"
1212
__email__ = "escherba+metrohash@gmail.com"
13-
__version__ = "0.1.0.post6"
13+
__version__ = "0.1.1"
1414
__all__ = [
1515
"metrohash64",
1616
"metrohash128",

0 commit comments

Comments
 (0)