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
Installation of plum-dispath as a requirement via setup.py #8
Comments
I don't think it can be that...
The problem is with
I think it's not picking up the Cython dependency correctly. EDIT: I am 99% positive about that. I had the same error when submitting the conda-forge recipe until I realised that plum depends on Cython, but that is not a declared dependency. |
Thanks for the explanation. |
EDIT: plum does indeed declare the dependency on Cython in it's pyproject.toml file. So maybe it's not that.. |
Hey @InnocentBug, thanks for opening an issue! I have successfully used |
Here's a minimal example that works for me:
from setuptools import find_packages, setup
requirements = ["plum-dispatch>=1"]
setup(
packages=find_packages(),
python_requires=">=3.6",
install_requires=requirements,
)
[metadata]
name = test
# empty file Create and activate a new virtual environment. Then |
Thanks for the quick response. I think I narrowed the problem a bit down. I prepared a minimum reproducer to demonstrate this. The first test installs via The test are run in a Ubuntu20.04 environment of the default github runners. |
I think what goes wrong is that Could you see if |
Preinstalling cython works indeed. |
I'm a bit hesitant to include My take on the matter is that I'm sorry for the trouble! The standard way to do package management in Python is a bit of a mess. |
For me, personally, of course I can use Not sure if it is a work around for everyone. |
If you really wanted to make this work, you could manually ensure that
from setuptools import find_packages, setup
import os
requirements = ["plum-dispatch>=1"]
os.system("pip install Cython")
setup(
packages=find_packages(),
python_requires=">=3.6",
install_requires=requirements,
) It might work for you, but I wouldn't recommend doing this. (E.g., are you calling the right |
Here's a more robust way of doing the same thing: from setuptools import find_packages, setup
import pkg_resources
import subprocess
import sys
if "Cython" not in {pkg.key for pkg in pkg_resources.working_set}:
python = sys.executable
subprocess.check_call([sys.executable, "-m", "pip", "install", "Cython"])
requirements = ["plum-dispatch>=1"]
setup(
packages=find_packages(),
python_requires=">=3.6",
install_requires=requirements,
) You could even consider uninstalling |
Hmm, yeah that might be an option, I have to talk to the other developers. Thanks for your help. |
No problem at all! I'll close the issue then for now. Please reopen the issue if you can't manage find a satisfactory solution. For example, here's another alternative: in Plum's |
Just as a follow up. |
Glad to hear you found a satisfactory solution! |
We are having trouble to use plum-dispatch as a dependency in my own project.
We include
plum-dispatch
as a requirement in oursetup.py
, but unfortunately the automatic installation fails withI am no expert with setuptools, but it seems to me as if
license_file
instead oflicense_files
in the setup.cfg is causing issues.Installing
plum-dispatch
before hand via pippip install plum-dispatch
is a work around without problems though.The text was updated successfully, but these errors were encountered: