Skip to content

Commit 67b02ff

Browse files
committed
add C++11 support
1 parent b224dc2 commit 67b02ff

File tree

9 files changed

+659
-446
lines changed

9 files changed

+659
-446
lines changed

.github/workflows/pythonbuild.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,36 @@ jobs:
7676
with:
7777
path: ./wheelhouse/*.whl
7878

79+
build_wheels_manylinux1:
80+
needs: [test_python]
81+
name: Build wheel with manylinux1
82+
runs-on: ubuntu-18.04
83+
strategy:
84+
fail-fast: false
85+
env:
86+
CIBW_BUILD: cp*
87+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
88+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
89+
90+
steps:
91+
- uses: actions/checkout@v1
92+
with:
93+
submodules: 'true'
94+
95+
- uses: actions/setup-python@v1
96+
name: Install Python
97+
with:
98+
python-version: '3.7'
99+
100+
- name: Install cibuildwheel
101+
run: |
102+
python -m pip install git+https://github.com/joerick/cibuildwheel.git@f6eaa9f
103+
- name: Build wheels
104+
run: |
105+
python -m cibuildwheel --output-dir wheelhouse
106+
- uses: actions/upload-artifact@v2
107+
with:
108+
path: ./wheelhouse/*.whl
79109

80110
build_wheels_python27_windows_64:
81111
needs: [test_python]
@@ -173,7 +203,7 @@ jobs:
173203

174204
deploy-wheels:
175205
if: github.event_name == 'release' && github.event.action == 'published'
176-
needs: [build_wheels, build_wheels_python27_windows_64, build_wheels_python27_windows_32, build_sdist]
206+
needs: [build_wheels, build_wheels_manylinux1, build_wheels_python27_windows_64, build_wheels_python27_windows_32, build_sdist]
177207
name: deploy wheels to pypi
178208
runs-on: ubuntu-18.04
179209

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.13.2
1+
0.13.3

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
class BuildExt(build_ext):
1717
"""A custom build extension for adding compiler-specific options."""
1818
c_opts = {
19-
'msvc': ['/EHsc', '/O2', '/std:c++14'],
20-
'unix': ['-O3', '-std=c++14', '-Wextra', '-Wall'],
19+
'msvc': ['/EHsc', '/O2', '/std:c++11'],
20+
'unix': ['-O3', '-std=c++11', '-Wextra', '-Wall'],
2121
}
2222
l_opts = {
2323
'msvc': [],

src/py2_utils.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/* Copyright © 2020 Max Bachmann */
33

44
#define PY_SSIZE_T_CLEAN
5-
#include <Python.h>
65
#include "details/types.hpp"
6+
#include <Python.h>
77
#include <variant/variant.hpp>
88

99
bool valid_str(PyObject* str, const char* name)
@@ -23,7 +23,7 @@ bool valid_str(PyObject* str, const char* name)
2323

2424
using python_string =
2525
mpark::variant<std::basic_string<uint8_t>, std::basic_string<Py_UNICODE>,
26-
rapidfuzz::basic_string_view<uint8_t>, rapidfuzz::basic_string_view<Py_UNICODE>>;
26+
rapidfuzz::basic_string_view<uint8_t>, rapidfuzz::basic_string_view<Py_UNICODE>>;
2727

2828
using python_string_view =
2929
mpark::variant<rapidfuzz::basic_string_view<uint8_t>, rapidfuzz::basic_string_view<Py_UNICODE>>;
@@ -56,7 +56,6 @@ python_string_view decode_python_string_view(PyObject* py_str)
5656
}
5757
}
5858

59-
6059
PyObject* encode_python_string(rapidfuzz::basic_string_view<uint8_t> str)
6160
{
6261
return PyString_FromStringAndSize(reinterpret_cast<const char*>(str.data()), str.size());

src/py3_utils.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/* Copyright © 2020 Max Bachmann */
33

44
#define PY_SSIZE_T_CLEAN
5-
#include <Python.h>
65
#include "details/types.hpp"
6+
#include <Python.h>
77
#include <variant/variant.hpp>
88

99
bool valid_str(PyObject* str, const char* name)
@@ -15,7 +15,7 @@ bool valid_str(PyObject* str, const char* name)
1515

1616
// PEP 623 deprecates legacy strings and therefor
1717
// deprecates e.g. PyUnicode_READY in Python 3.10
18-
#if PY_VERSION_HEX < PYTHON_VERSION(3,10,0)
18+
#if PY_VERSION_HEX < PYTHON_VERSION(3, 10, 0)
1919
if (PyUnicode_READY(str)) {
2020
return false;
2121
}
@@ -33,9 +33,9 @@ bool valid_str(PyObject* str, const char* name)
3333
}
3434

3535
using python_string =
36-
mpark::variant<std::basic_string<uint8_t>, std::basic_string<uint16_t>, std::basic_string<uint32_t>,
37-
rapidfuzz::basic_string_view<uint8_t>, rapidfuzz::basic_string_view<uint16_t>,
38-
rapidfuzz::basic_string_view<uint32_t>>;
36+
mpark::variant<std::basic_string<uint8_t>, std::basic_string<uint16_t>,
37+
std::basic_string<uint32_t>, rapidfuzz::basic_string_view<uint8_t>,
38+
rapidfuzz::basic_string_view<uint16_t>, rapidfuzz::basic_string_view<uint32_t>>;
3939

4040
using python_string_view =
4141
mpark::variant<rapidfuzz::basic_string_view<uint8_t>, rapidfuzz::basic_string_view<uint16_t>,

0 commit comments

Comments
 (0)