Skip to content

Commit

Permalink
Refactor: update module import paths and version bump
Browse files Browse the repository at this point in the history
- Changed import path from `h3result.cffi` to `h3result._cffi` in
`build_ext.py`, `error.py`, `h3result.py`, and `read_h3result.py`.
- Added import of `_cffi_backend` in `__init__.py` to ensure compatibility
with PyInstaller.
- Updated `cffi` dependency version in `pyproject.toml` to "^1.17".
- Bumped package version to "1.0.2" in `pyproject.toml`.

These changes were made to resolve potential import issues and ensure the
package is up-to-date with dependency requirements. Import path adjustments
improve modular access and compatibility, while the version change indicates
enhancements without breaking changes.
  • Loading branch information
horta committed Nov 12, 2024
1 parent d1e4361 commit 08eab95
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion h3result-py/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build_and_install(root: Path, prefix: str, prj_dir: str, git_url: str):

ffibuilder.cdef(open(PKG / "interface.h", "r").read())
ffibuilder.set_source(
"h3result.cffi",
"h3result._cffi",
"""
#include "h3r_result.h"
""",
Expand Down
2 changes: 2 additions & 0 deletions h3result-py/h3result/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Let PyInstaller and others know that we need cffi_backend.
import _cffi_backend # noqa: F401
2 changes: 1 addition & 1 deletion h3result-py/h3result/error.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from h3result.cffi import ffi, lib
from h3result._cffi import ffi, lib

__all__ = ["H3ResultError"]

Expand Down
2 changes: 1 addition & 1 deletion h3result-py/h3result/h3result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from h3result.cffi import ffi, lib
from h3result._cffi import ffi, lib
from h3result.error import H3ResultError

__all__ = ["H3Result"]
Expand Down
2 changes: 1 addition & 1 deletion h3result-py/h3result/read_h3result.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from pathlib import Path

from h3result.cffi import ffi
from h3result._cffi import ffi
from h3result.h3result import H3Result
from h3result.path_like import PathLike

Expand Down
4 changes: 2 additions & 2 deletions h3result-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "h3result"
version = "1.0.1"
version = "1.0.2"
description = "Python wrapper for h3result library."
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
Expand All @@ -14,7 +14,7 @@ include = [
]

[tool.poetry.dependencies]
cffi = "^1.16"
cffi = "^1.17"
python = "^3.9"

[tool.poetry.build]
Expand Down

0 comments on commit 08eab95

Please sign in to comment.