diff --git a/.github/workflows/build-pypi-package.yml b/.github/workflows/build-pypi-package.yml index 19d76f1..cc49db4 100644 --- a/.github/workflows/build-pypi-package.yml +++ b/.github/workflows/build-pypi-package.yml @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 8c67dc1..f6ba79f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" \ No newline at end of file diff --git a/setup.py b/setup.py index 0b5da6f..f2037bb 100644 --- a/setup.py +++ b/setup.py @@ -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"