Skip to content

Commit

Permalink
Move _frida package inside the frida package
Browse files Browse the repository at this point in the history
So we only have one top-level package, to avoid confusing IDEs.
  • Loading branch information
oleavr committed Apr 24, 2024
1 parent 03206cf commit 30e9938
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frida/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, Union

try:
import _frida
from . import _frida
except Exception as ex:
print("")
print("***")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions src/meson.build → frida/_frida/meson.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
py_sources = [
'__init__.pyi',
'py.typed',
]
python.install_sources(py_sources, subdir: 'frida' / '_frida', pure: false)

extra_link_args = []
if host_os_family == 'darwin'
extra_link_args += '-Wl,-exported_symbol,_PyInit__frida'
elif host_os_family != 'windows'
extra_link_args += '-Wl,--version-script,' + meson.current_source_dir() / '_frida.version'
extra_link_args += '-Wl,--version-script,' + meson.current_source_dir() / 'extension.version'
endif

extension = python.extension_module('_frida', '_frida.c',
extension = python.extension_module('_frida', 'extension.c',
limited_api: '3.7',
c_args: frida_component_cflags,
link_args: extra_link_args,
dependencies: [python_dep, frida_core_dep, os_deps],
install: true,
subdir: 'frida',
)
File renamed without changes.
2 changes: 1 addition & 1 deletion frida/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
else:
from typing_extensions import NotRequired

import _frida
from . import _frida

_device_manager = None

Expand Down
8 changes: 5 additions & 3 deletions frida/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
frida_sources = [
subdir('_frida')

py_sources = [
'__init__.py',
'core.py',
'py.typed',
]

python.install_sources(frida_sources, subdir: 'frida', pure: false)
python.install_sources(py_sources, subdir: 'frida', pure: false)
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if host_os_family != 'windows'
os_deps += dependency('gio-unix-2.0')
endif

subdir('src')
subdir('frida')

test('frida-python', python,
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def main():
"Topic :: Software Development :: Debuggers",
"Topic :: Software Development :: Libraries :: Python Modules",
],
packages=["frida", "_frida"],
package_data={"frida": ["py.typed"], "_frida": ["py.typed", "__init__.pyi"]},
packages=["frida", "frida._frida"],
package_data={"frida": ["py.typed"], "frida._frida": ["py.typed", "__init__.pyi"]},
ext_modules=[
Extension(
name="_frida",
sources=["src/_frida.c"],
name="frida._frida",
sources=["frida/_frida/extension.c"],
py_limited_api=True,
)
],
Expand Down

0 comments on commit 30e9938

Please sign in to comment.