Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore missing rnalib #10

Merged
merged 1 commit into from
Nov 19, 2024
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
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
Loading