-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
191 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-case-conflict | ||
- id: check-added-large-files | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: ["--fix=no"] | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
args: ["--markdown-linebreak-ext=md"] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: 'v2.29.1' | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py36-plus"] | ||
- repo: https://github.com/psf/black | ||
rev: '21.11b1' | ||
hooks: | ||
- id: black | ||
language_version: python3 # Should be a command that runs python3.6+ | ||
- repo: https://github.com/PyCQA/isort | ||
rev: '5.10.1' | ||
hooks: | ||
- id: isort | ||
language_version: python3 | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "Cython"] | ||
|
||
[tool.black] | ||
line-length = 120 | ||
|
||
[tool.isort] | ||
indent = "tab" | ||
profile = "black" | ||
src_paths = ["."] | ||
line_length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,60 @@ | ||
import platform | ||
import sys | ||
from io import open | ||
|
||
from Cython.Build import cythonize | ||
import platform | ||
from setuptools import Extension, setup | ||
|
||
EXT_SOURCES = [ | ||
"MetroHash/src/metrohash64.cpp", | ||
"MetroHash/src/metrohash128.cpp", | ||
"MetroHash/src/metrohash64.cpp", | ||
"MetroHash/src/metrohash128.cpp", | ||
] | ||
|
||
INT_SOURCES = [ | ||
"metrohash.pyx" | ||
] | ||
INT_SOURCES = ["metrohash.pyx"] | ||
|
||
if sys.platform == "win32": | ||
cflags = ["/O2", "/arch:AVX2"] | ||
cflags = ["/O2", "/arch:AVX2"] | ||
else: | ||
if platform.machine().lower() in ("x86_64", "amd64"): | ||
cflags = ["-O3", "-msse4.2"] | ||
else: | ||
cflags = ["-O3", "-march=native"] | ||
|
||
extensions = [Extension( | ||
"metrohash", | ||
sources=EXT_SOURCES + INT_SOURCES, | ||
extra_compile_args=cflags, | ||
include_dirs=["MetroHash/src"], | ||
language="c++" | ||
)] | ||
if platform.machine().lower() in ("x86_64", "amd64"): | ||
cflags = ["-O3", "-msse4.2"] | ||
else: | ||
cflags = ["-O3", "-march=native"] | ||
|
||
extensions = [ | ||
Extension( | ||
"metrohash", | ||
sources=EXT_SOURCES + INT_SOURCES, | ||
extra_compile_args=cflags, | ||
include_dirs=["MetroHash/src"], | ||
language="c++", | ||
) | ||
] | ||
|
||
with open("README.md", "r", encoding="utf-8") as fr: | ||
long_description = fr.read() | ||
with open("README.md", encoding="utf-8") as fr: | ||
long_description = fr.read() | ||
|
||
setup( | ||
author="Dobatymo", | ||
name="metrohash-python", | ||
version="1.1.3.3", | ||
url="https://github.com/Dobatymo/metrohash-python", | ||
description="Python bindings for MetroHash", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: ISC License (ISCL)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: C++", | ||
"Programming Language :: Cython", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Internet", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Utilities" | ||
], | ||
|
||
ext_modules=cythonize(extensions), | ||
python_requires=">=2.7", | ||
use_2to3=False, | ||
zip_safe=False, | ||
author="Dobatymo", | ||
name="metrohash-python", | ||
version="1.1.3.3", | ||
url="https://github.com/Dobatymo/metrohash-python", | ||
description="Python bindings for MetroHash", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: ISC License (ISCL)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: C++", | ||
"Programming Language :: Cython", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Internet", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Utilities", | ||
], | ||
ext_modules=cythonize(extensions), | ||
python_requires=">=3.6", | ||
use_2to3=False, | ||
zip_safe=False, | ||
) |
Oops, something went wrong.