Skip to content

Commit

Permalink
ignore missing rnalib
Browse files Browse the repository at this point in the history
  • Loading branch information
domonik committed Nov 19, 2024
1 parent eadf1ad commit 4f44a58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-pypi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist
run:
export IGNORE_MISSING_RNALIB=1
python3 -m build --sdist
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.19.0", "Cython>=0.29.30", "versioneer-518", "pybind11"]
requires = ["setuptools", "wheel", "numpy>=1.19.0", "Cython>=0.29.30", "versioneer-518", "pybind11", "viennarna"]
build-backend = "setuptools.build_meta"
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@
python_l = f"python{svi[0]}.{svi[1]}"

RNALIB = os.path.join(prefix, "lib", "libRNA.a")

IGNORE_MISSING_RNALIB = bool(os.environ.get('IGNORE_MISSING_RNALIB', 0))
if not os.path.exists(RNALIB):
raise FileNotFoundError(f"Not able to find ViennaRNA RNAlib installation under {RNALIB}. This version of RNAdist requires ViennaRNA "
"to be installed. You can easily install it using Conda:\n"
"conda install -c bioconda viennarna"
)
message = f"Not able to find ViennaRNA RNAlib installation under {RNALIB}. This version of RNAdist requires ViennaRNA "
"to be installed. You can easily install it using Conda:\n"
"conda install -c bioconda viennarna"
if IGNORE_MISSING_RNALIB:
print(message)
print("While you can run this script you wont be able to install the package like this")
else:
raise FileNotFoundError(message)
if not os.path.exists(os.path.join(prefix, "lib", python_l, "site-packages", "RNA")):
raise ImportError("Not able to find ViennaRNA python package in your current environment."
"Please install it e.g. via Conda\n"
Expand Down

0 comments on commit 4f44a58

Please sign in to comment.