Skip to content

Commit

Permalink
pyproject: fix poetry build
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmouchet committed Sep 30, 2023
1 parent bb8affd commit e4cee70
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 70 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ jobs:
python-version: "3.x"
- uses: dioptra-io/setup-poetry-action@v1
- name: Install package
run: poetry install
run: |
python -m venv venv
source venv/bin/activate
pip install .[dev]
- name: Insert test data
run: poetry run tests/data/insert.py
run: python tests/data/insert.py
- name: Run tests
run: poetry run pytest --cov=diamond_miner --cov-report=xml
run: pytest --cov=diamond_miner --cov-report=xml
- uses: codecov/codecov-action@v3

mkdocs:
Expand All @@ -32,11 +35,14 @@ jobs:
python-version: "3.x"
- uses: dioptra-io/setup-poetry-action@v1
- name: Install package
run: poetry install
run: |
python -m venv venv
source venv/bin/activate
pip install .[dev]
- name: Build documentation
run: poetry run mkdocs build --strict
run: mkdocs build --strict
- name: Publish documentation
run: poetry run mkdocs gh-deploy --force --no-history --strict
run: mkdocs gh-deploy --force --no-history --strict
if: ${{ startsWith(github.ref, 'refs/tags/v') }}

pypi:
Expand All @@ -57,6 +63,11 @@ jobs:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
# Ideally we'd specify this in the [project] section of pyproject.toml,
# but this causes issues with poetry.
# See https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
with:
output-dir: dist
- name: Upload artifacts
Expand Down
15 changes: 0 additions & 15 deletions build_ext.py

This file was deleted.

52 changes: 3 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,6 @@
[tool.poetry]
name = "diamond-miner"
version = "1.0.3"
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"
[build-system]
requires = ["setuptools", "Cython"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "--capture=no --doctest-modules --ignore=examples --log-cli-level=info --strict-markers --verbosity=2"
Expand Down Expand Up @@ -81,9 +41,3 @@ 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"
46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from Cython.Build import cythonize
from setuptools import setup

setup(
name="diamond-miner",
version="1.0.3",
description="High-speed, Internet-scale, load-balanced paths discovery.",
author="Kevin Vermeulen, Matthieu Gouel, Maxime Mouchet",
url="https://github.com/dioptra-io/diamond-miner",
license="MIT",
ext_modules=
cythonize(
"diamond_miner/**/*.pyx",
compiler_directives={"binding": True, "embedsignature": True},
language_level=3,
),
python_requires=">=3.10",
install_requires=[
"pych-client~=0.3.1",
"pygfc~=1.0.5",
"zstandard>=0.15.2,<0.19.0"
],
extra_require={
"dev": [
"bumpversion~=0.6.0",
"coverage[toml]~=7.1.0",
"hypothesis~=6.68.2",
"mkdocs-bibtex~=2.8.13",
"mkdocs-material~=9.0.13",
"mkdocstrings[python]~=0.20.0",
"mypy~=1.0.1",
"pytest~=7.2.1",
"pytest-cov~=4.0.0"
]
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Topic :: Internet",
"Typing :: Typed"
]

)

0 comments on commit e4cee70

Please sign in to comment.