networkx / nx-parallel

A networkx backend that uses joblib to run graph algorithms in parallel.
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

BUG : included `_nx_parallel` in packages #54

Closed Schefflera-Arboricola closed 8 months ago

Schefflera-Arboricola commented 8 months ago

After merging this recent PR, the following error was showing up at 2 places in this recent build (ref. ss)

/home/circleci/project/networkx/utils/backends.py:143: RuntimeWarning: Error encountered when loading info for backend parallel: No module named '_nx_parallel'
  backend_info = _get_backends("networkx.backend_info", load_and_call=True)
Screenshot 2024-03-19 at 8 52 16 PM Screenshot 2024-03-19 at 8 52 27 PM

and earlier this was showing up at the same places

/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/networkx/utils/backends.py:143: RuntimeWarning: Error encountered when loading info for backend parallel: partially initialized module 'networkx' has no attribute '_dispatchable' (most likely due to a circular import)
  backend_info = _get_backends("networkx.backend_info", load_and_call=True)

ref. https://networkx.org/documentation/latest/search.html?q=RuntimeWarning

I have explicitly mentioned _nx_parallel in packages in pyproject.toml in this PR (ref. https://hatch.pypa.io/latest/config/build/#packages)

And now _nx_parallel is appearing in the wheel(locally):

(venv) (base) aditi@Aditis-MacBook-Air nx-parallel % hatch build
────────────────────────────────────────────────────────────────────────── sdist ──────────────────────────────────────────────────────────────────────────
dist/nx_parallel-0.2rc0.dev0.tar.gz
────────────────────────────────────────────────────────────────────────── wheel ──────────────────────────────────────────────────────────────────────────
dist/nx_parallel-0.2rc0.dev0-py3-none-any.whl
(venv) (base) aditi@Aditis-MacBook-Air nx-parallel % cd dist
(venv) (base) aditi@Aditis-MacBook-Air dist % ls
nx_parallel-0.2rc0.dev0-py3-none-any.whl    nx_parallel-0.2rc0.dev0.tar.gz
(venv) (base) aditi@Aditis-MacBook-Air dist % unzip nx_parallel-0.2rc0.dev0-py3-none-any.whl

Archive:  nx_parallel-0.2rc0.dev0-py3-none-any.whl
  inflating: _nx_parallel/__init__.py  
  inflating: nx_parallel/__init__.py  
  inflating: nx_parallel/interface.py  
  inflating: nx_parallel/algorithms/__init__.py  
  inflating: nx_parallel/algorithms/cluster.py  
  inflating: nx_parallel/algorithms/efficiency_measures.py  
  inflating: nx_parallel/algorithms/isolate.py  
  inflating: nx_parallel/algorithms/tournament.py  
  inflating: nx_parallel/algorithms/vitality.py  
  inflating: nx_parallel/algorithms/bipartite/__init__.py  
  inflating: nx_parallel/algorithms/bipartite/redundancy.py  
  inflating: nx_parallel/algorithms/centrality/__init__.py  
  inflating: nx_parallel/algorithms/centrality/betweenness.py  
  inflating: nx_parallel/algorithms/shortest_paths/__init__.py  
  inflating: nx_parallel/algorithms/shortest_paths/weighted.py  
  inflating: nx_parallel/utils/__init__.py  
  inflating: nx_parallel/utils/chunk.py  
  inflating: nx_parallel-0.2rc0.dev0.dist-info/METADATA  
  inflating: nx_parallel-0.2rc0.dev0.dist-info/WHEEL  
  inflating: nx_parallel-0.2rc0.dev0.dist-info/entry_points.txt  
  inflating: nx_parallel-0.2rc0.dev0.dist-info/RECORD  

Also, I tried building the networkx docs locally using this PR's branch of my forked nx-parallel repo and this branch of my forked networkx repo. And the ModuleNotFound error was not showing up(ref. ss):

Screenshot 2024-03-17 at 9 07 26 PM Screenshot 2024-03-17 at 9 07 36 PM

but I wasn't able to see nx-parallel info in the "additional backend implementation" box locally(ref. ss) :

Screenshot 2024-03-18 at 8 42 31 AM

Thank you :)