Skip to content

Commit 312a606

Browse files
Copilotmrecachinas
andcommitted
Complete migration from setup.py to pyproject.toml
Co-authored-by: mrecachinas <924243+mrecachinas@users.noreply.github.com>
1 parent 4563301 commit 312a606

3 files changed

Lines changed: 48 additions & 24 deletions

File tree

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,17 @@ or to install from source
8383

8484
git clone https://github.com/mrecachinas/hexhamming
8585
cd hexhamming
86-
python setup.py install # or pip install .
86+
pip install .
8787

8888
If you want to contribute to hexhamming, you should install the dev
8989
dependencies
9090

91+
::
92+
93+
pip install -e ".[dev]"
94+
95+
Alternatively, you can still use the legacy method:
96+
9197
::
9298

9399
pip install -r requirements-dev.txt

pyproject.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "hexhamming"
7+
dynamic = ["version"]
8+
description = "Fast Hamming distance calculation for hexadecimal strings"
9+
readme = "README.rst"
10+
license = {text = "MIT"}
11+
authors = [
12+
{name = "Michael Recachinas", email = "m.recachinas@gmail.com"}
13+
]
14+
keywords = ["hamming", "distance", "simd"]
15+
classifiers = [
16+
"Operating System :: MacOS :: MacOS X",
17+
"Operating System :: POSIX :: Linux",
18+
"Operating System :: Microsoft :: Windows",
19+
"Programming Language :: C"
20+
]
21+
requires-python = ">=3.6"
22+
23+
[project.urls]
24+
Repository = "https://github.com/mrecachinas/hexhamming.git"
25+
26+
[project.optional-dependencies]
27+
dev = [
28+
"black",
29+
"pytest",
30+
"pytest-benchmark"
31+
]
32+
33+
[tool.setuptools]
34+
zip-safe = false
35+
36+
[tool.setuptools.packages.find]
37+
include = ["hexhamming*"]
38+
39+
[tool.pytest.ini_options]
40+
testpaths = ["test"]

setup.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ def get_version():
1111
return search(r'_version.*"(.*)";', f.read(), IGNORECASE).groups()[0]
1212

1313

14-
with open("./README.rst", "r") as readme_file:
15-
long_description = readme_file.read()
16-
17-
with open("requirements-dev.txt", "r", encoding="utf-8") as fh:
18-
test_requirements = [line.rstrip() for line in fh.readlines()]
19-
14+
# Platform-specific compiler optimization flags
2015
extra_compile_args = []
2116
if system().lower() == "darwin" and (machine().lower() == "arm64" or
2217
environ.get("CIBW_ARCHS_MACOS", "") == "arm64"):
@@ -28,14 +23,7 @@ def get_version():
2823
extra_compile_args.append("-march=native")
2924

3025
setup(
31-
name="hexhamming",
3226
version=get_version(),
33-
description="Fast Hamming distance calculation for hexadecimal strings",
34-
url="https://github.com/mrecachinas/hexhamming.git",
35-
long_description=long_description,
36-
long_description_content_type="text/x-rst",
37-
test_suite="test",
38-
tests_require=test_requirements,
3927
ext_modules=[
4028
Extension(
4129
name="hexhamming",
@@ -44,14 +32,4 @@ def get_version():
4432
language="c++11",
4533
)
4634
],
47-
author="Michael Recachinas",
48-
author_email="m.recachinas@gmail.com",
49-
classifiers=[
50-
"Operating System :: MacOS :: MacOS X",
51-
"Operating System :: POSIX :: Linux",
52-
"Operating System :: Microsoft :: Windows",
53-
"Programming Language :: C"
54-
],
55-
keywords="hamming distance simd",
56-
zip_safe=False,
5735
)

0 commit comments

Comments
 (0)