-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "build: replace poetry with setup.py (#95)"
This reverts commit e38b172.
- Loading branch information
1 parent
2496322
commit 3383ff0
Showing
8 changed files
with
84 additions
and
73 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
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
from Cython.Build import cythonize | ||
from setuptools.command.build_ext import build_ext | ||
|
||
|
||
def build(setup_kwargs): | ||
setup_kwargs.update( | ||
{ | ||
"cmdclass": {"build_ext": build_ext}, | ||
"ext_modules": cythonize( | ||
"diamond_miner/**/*.pyx", | ||
compiler_directives={"binding": True, "embedsignature": True}, | ||
language_level=3, | ||
), | ||
} | ||
) |
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 |
---|---|---|
|
@@ -6,29 +6,25 @@ This library is developed on GitHub in the [`dioptra-io/diamond-miner`](https:// | |
git clone [email protected]:dioptra-io/diamond-miner.git | ||
cd diamond-miner/ | ||
|
||
# Create and enter a virtual environment | ||
python -m venv venv | ||
source venv/bin/activate | ||
|
||
# Compile the Cython code and install the dependencies (once) | ||
pip install -e . | ||
poetry install | ||
|
||
# Install the pre-commit hooks (once) | ||
pre-commit install | ||
poetry run pre-commit install | ||
|
||
# Edit some files... | ||
# Run pip install again if you have edited Cython files (`.pyx`) | ||
# Run poetry install again if you have edited Cython files (`.pyx`) | ||
|
||
# Run the tests | ||
pytest | ||
poetry run pytest | ||
|
||
# Preview the documentation | ||
mkdocs serve --watch diamond_miner --watch docs | ||
poetry run mkdocs serve --watch diamond_miner --watch docs | ||
|
||
# Commit... | ||
|
||
# Tag a new version | ||
bumpversion patch # or minor/major | ||
poetry run bumpversion patch # or minor/major | ||
``` | ||
|
||
## Test data | ||
|
@@ -37,7 +33,7 @@ Most tests require a running instance of ClickHouse with pre-populated tables. | |
To start a ClickHouse server and insert the test data: | ||
```bash | ||
docker run --rm -d -p 8123:8123 clickhouse/clickhouse-server:22.6 | ||
python tests/data/insert.py | ||
poetry run tests/data/insert.py | ||
``` | ||
|
||
To use a different server, set the `DIAMOND_MINER_TEST_DATABASE_URL` environment variable (`http://localhost:8123` by default). |
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,46 @@ | ||
[build-system] | ||
requires = ["setuptools", "Cython"] | ||
build-backend = "setuptools.build_meta" | ||
[tool.poetry] | ||
name = "diamond-miner" | ||
version = "1.0.5" | ||
description = "High-speed, Internet-scale, load-balanced paths discovery." | ||
license = "MIT" | ||
authors = [ | ||
"Kevin Vermeulen <[email protected]>", | ||
"Matthieu Gouel <[email protected]>", | ||
"Maxime Mouchet <[email protected]>" | ||
] | ||
readme = "README.md" | ||
homepage = "https://github.com/dioptra-io/diamond-miner" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: POSIX :: Linux", | ||
"Topic :: Internet", | ||
"Typing :: Typed" | ||
] | ||
|
||
[tool.poetry.build] | ||
# https://github.com/python-poetry/poetry/issues/7470 | ||
script = "build_ext.py" | ||
generate-setup-file = true | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10,<4.0" | ||
pych-client = "^0.3.1" | ||
pygfc = "^1.0.5" | ||
zstandard = ">=0.15.2,<0.19.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
bumpversion = "^0.6.0" | ||
coverage = {extras = ["toml"], version = "^7.1.0"} | ||
Cython = "^0.29.33" | ||
hypothesis = "^6.68.2" | ||
mkdocs-bibtex = "^2.8.13" | ||
mkdocs-material = "^9.0.13" | ||
mkdocstrings = {extras = ["python"], version = "^0.20.0"} | ||
mypy = "^1.0.1" | ||
pytest = "^7.2.1" | ||
pytest-cov = "^4.0.0" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--capture=no --doctest-modules --ignore=examples --log-cli-level=info --strict-markers --verbosity=2" | ||
|
@@ -40,3 +80,10 @@ archs = ["x86_64", "aarch64"] | |
|
||
[tool.cibuildwheel.macos] | ||
archs = ["universal2"] | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0", "setuptools>=40.6.0", "Cython>=0.29.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[project] | ||
requires-python = ">=3.10" |
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,3 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
import logging | ||
import re | ||
from collections.abc import Sequence | ||
|