From a881a0a36bfe5065addef04540483fc8d315659b Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Mon, 11 Apr 2022 23:05:20 -0700 Subject: [PATCH] Add more helpful error when importing without libomp installed Also use non-shallow clones in ci --- .github/workflows/python-package.yml | 14 +++----------- CHANGELOG.md | 12 ++++++++++++ quicktex/__init__.py | 10 ++++++++-- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ee43eab..ec5435d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -13,9 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - # Whether to checkout submodules: `true` to checkout submodules or `recursive` to - # recursively checkout submodules. - submodules: 'true' + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v3.1.1 @@ -58,9 +56,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - # Whether to checkout submodules: `true` to checkout submodules or `recursive` to - # recursively checkout submodules. - submodules: 'true' + fetch-depth: 0 - name: Install libomp if: runner.os == 'macOS' @@ -97,11 +93,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - # Whether to checkout submodules: `true` to checkout submodules or `recursive` to - # recursively checkout submodules. - submodules: 'true' + - uses: actions/checkout@v3 # just need the changelog - name: Set up Python uses: actions/setup-python@v3.1.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index bcee098..ca09d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file +## Unreleased + +### Fixed + +- Fixed quicktex not compiling for python 3.10 on Windows + +### Changed + +- Reworked CI job, adding wheels for ARM macOS, ARM Linux, and x86 musl Linux. +- Added a more useful error message when importing quicktex on macOS when libomp.dylib isnt installed + + ## 0.1.2 - 2022-03-27 ### Fixed diff --git a/quicktex/__init__.py b/quicktex/__init__.py index 8b3f88f..8091bd6 100644 --- a/quicktex/__init__.py +++ b/quicktex/__init__.py @@ -1,2 +1,8 @@ -from _quicktex import * -from _quicktex import __version__ +try: + from _quicktex import * + from _quicktex import __version__ +except ImportError as e: + if 'libomp.dylib' in e.msg: + print('\033[41m\033[01mERROR: LIBOMP NOT FOUND! PLEASE INSTALL IT WITH \033[04m`brew install libomp`\033[0m') + print('original error message:') + raise e