Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Nuget-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:

- name: '🚧 Linux ppc64le build'
if: contains(matrix.config.arch, 'ppc64le')
uses: uraimo/run-on-arch-action@v2
uses: uraimo/run-on-arch-action@v3
with:
arch: ${{ matrix.config.arch }}
distro: ${{ matrix.config.distro }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-uc2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ jobs:

- name: '🚧 Linux ppc64le build'
if: contains(matrix.config.arch, 'ppc64le')
uses: uraimo/run-on-arch-action@v2
uses: uraimo/run-on-arch-action@v3
with:
arch: ${{ matrix.config.arch }}
distro: ${{ matrix.config.distro }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-wheels-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,9 @@ jobs:

- name: Build SDist
run: |
cd bindings/python
python3 -m pip install -U pip build
python3 -m build --sdist
python3 -m pip install dist/*.tar.gz
cd ~
python3 -m build --sdist bindings/python
python3 -m pip install bindings/python/dist/*.tar.gz
python3 -c 'import unicorn; print(f"Unicorn version installed from sdist: {unicorn.__version__}")'

- uses: actions/upload-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ build-backend = "setuptools.build_meta"
name = "unicorn"
dynamic = ["version"]
requires-python = ">= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*, != 3.5.*, != 3.6.*"
dependencies = [
"importlib_resources; python_version < '3.9'"
]
authors = [
{ name = "Nguyen Anh Quynh", email = "[email protected]" },
]
Expand Down
12 changes: 5 additions & 7 deletions bindings/python/unicorn/unicorn_py3/unicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,17 @@ def _load_lib(path: Path, lib_name: str):

# Loading attempts, in order
# - user-provided environment variable
# - pkg_resources can get us the path to the local libraries
# - importlib.resources/importlib_resources can get us the path to the local libraries
# - we can get the path to the local libraries by parsing our filename
# - global load
# - python's lib directory

if sys.version_info.minor >= 12:
from importlib import resources

canonicals = resources.files('unicorn') / 'lib'
if sys.version_info >= (3, 9):
import importlib.resources as resources
else:
import pkg_resources
import importlib_resources as resources

canonicals = pkg_resources.resource_filename('unicorn', 'lib')
canonicals = resources.files('unicorn') / 'lib'

lib_locations = [
os.getenv('LIBUNICORN_PATH'),
Expand Down
Loading