py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.16k stars 936 forks source link

Compatability with networkx is broken #1055

Open adam2392 opened 1 year ago

adam2392 commented 1 year ago

Networkx main has dropped support for Python3.8 and 3.9. We should consider following the Scientific-Python's community spec: https://github.com/networkx/networkx/pull/7028

Reasoning:

This makes it very hard to support both dowhy and networkx related features using Python packaging like poetry because:

python>=3.8, <3.12 is incompatible with python>=3.10, <3.12

Networkx is core for graph-related functionality in pywhy-graphs too, so tight-integration with networkx:main is desirable. Moreover dowhy relies on graph-related functionality since it is a package for graph-based causal inference tasks.

For that matter, major SciPython package like numpy and scipy have dropped support for Python3.8

emrekiciman commented 1 year ago

@adam2392 Thanks for bringing up this issue and the PR to drop python 3.8 support.

bloebp commented 1 year ago

I would definitely wait for dropping 3.8 support and restrict the networkx version. Even 3.8 is not that commonly used yet. So, taking out that support would probably break the dependency for many people.

adam2392 commented 1 year ago

I would definitely wait for dropping 3.8 support and restrict the networkx version. Even 3.8 is not that commonly used yet. So, taking out that support would probably break the dependency for many people.

I'm actually surprised by that because Python 3.7 lost support earlier this year already for a few months, so if a new bug/security-issue is found, it won't even be fixed, which is scary to me.

I'm just wondering along the lines: "is there a way to push our users towards a more healthy/less-risky usage of Python?"

emrekiciman commented 1 year ago

Yea, here's the official timeline of support for python versions. 3.8 is already in security-fix-only mode and is going to end-of-life in about 11 months.

https://devguide.python.org/versions/

I agree that keeping track with networkx and other major dependencies would be good. Do we know if Numpy, Pandas or other ML libraries that EconML and causal-learn depends on switching over on a schedule too?

adam2392 commented 1 year ago

I think numpy, pandas, scipy have all removed support for Python3.8 at this point on main. I think scikit-learn is in the process as well too.

Their general strategy is support older versions of X (e.g. Numpy) that have Python3.8 compatibility only for critical bug-fixes, but otw, all new features must be Python3.9+ compatible.

Since Python3.8 is technically still supported in version 0.10.x, and if v0.11.x is on a release schedule that overlaps w/ Python3.8 eol, it seems reasonable to deprecate python3.8 support in v0.11.xdev, while still maintaining support for 3.8 via v0.10.x and below. Up to you all! Just wanted to bring it some attention because this issue came up in pywhy-graphs, because I maintain extremely tight integration w/ networkx.

bloebp commented 1 year ago

Ok, we might aim at 0.11 release in December.

emrekiciman commented 11 months ago

Now that we are past the 0.11 release, do we want to revisit python 3.8 support in main? @adam2392 @bloebp @amit-sharma

bloebp commented 11 months ago

Yes, we can drop 3.8 support for 0.12+