CovertLab / arrow

Stochastic simulations in python
MIT License
3 stars 1 forks source link

Name conflict with Jupyter dependency #51

Closed thalassemia closed 1 year ago

thalassemia commented 1 year ago

To install Jupyter, the following chain of dependencies is pulled in:

jupyter --> notebook --> nbclassic --> jupyter-server --> jupyter-events --> jsonschema[format-nongpl] --> isoduration --> arrow

I've linked the repo for the conflicting arrow package.

Any suggestions are welcome!

1fish2 commented 1 year ago

Ugh.

Workarounds that I can think of:

  1. Rename the stochastic-arrow library so we'd do from stochastic_arrow import StochasticSystem, then update wcEcoli and vivarium-ecoli.
  2. Workaround the site-packages conflict somehow in a predictable way, then manipulate python's sys.path before importing one of them. (This can only lead to greif.)
  3. Don't use Jupyter and stochastic_arrow together :)

Unless anyone (including @prismofeverything @U8NWXD @eagmon) has a better idea, it's gotta be # 1 .

@thalassemia do you want to be one of the PyPI package maintainers for this library?

prismofeverything commented 1 year ago

I'm all for #1.... should have changed the directory name along with the package name when we found out there was already another package named arrow --- lesson learned!

Got to love the wild west of global namespaces. More fun to be early really, pypi is getting crowded.

On Tue, Jun 27, 2023 at 7:53 PM Jerry Morrison @.***> wrote:

Ugh.

  • This new arrow pip is (yet another) date-time package.

  • pip install numpy; pip install jupyter stochastic-arrow doesn't complain, but arrow won over stochastic_arrow for the arrow/ library directory:

    $ cd /usr/local/var/pyenv/versions/jupyter-conflict/lib/python3.11/site-packages $ ll -d arrow drwxr-xr-x 17 jerry admin 544B Jun 27 19:12 arrow/ drwxr-xr-x 8 jerry admin 256B Jun 27 19:12 arrow-1.2.3.dist-info/ drwxr-xr-x 9 jerry admin 288B Jun 27 19:12 stochastic_arrow-0.5.2.dist-info/

  • import arrow now imports the date-time package.

  • The stochastic-arrow installation is broken.

Workarounds that I can think of:

  1. Rename the stochastic-arrow library so we'd do from stochastic_arrow import StochasticSystem, then update wcEcoli and vivarium-ecoli.
  2. Workaround the site-packages conflict somehow and some predictable way, then manipulate python's sys.path before importing one of them. (This can only lead to greif.)
  3. Don't use Jupyter and stochastic_arrow together :)

Unless anyone (including @prismofeverything https://github.com/prismofeverything @U8NWXD https://github.com/U8NWXD @eagmon https://github.com/eagmon) has a better idea, it's gotta be # 1 .

@thalassemia https://github.com/thalassemia do you want to be one of the PyPI package maintainers for this library?

— Reply to this email directly, view it on GitHub https://github.com/CovertLab/arrow/issues/51#issuecomment-1610595127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACG54Z4LBKHMRP7FEAQZLXNOMDJANCNFSM6AAAAAAZWG7AHU . You are receiving this because you were mentioned.Message ID: @.***>

1fish2 commented 1 year ago

Indeed, let's rename just the directory (module) to stochastic_arrow and keep the package name stochastic-arrow (although in retrospect I think PyPI should require them to match), or nest the module, stochastic_arrow.arrow.

thalassemia commented 1 year ago

I noticed that test_flagella fails locally both on master and my PR. Is this expected behavior?

Also, I'm hoping I won't need to touch this package beyond this and am fine with not taking on the extra responsibility of being a maintainer ;)

1fish2 commented 1 year ago

Yes, we discussed test_flagella failing in PR 47 and in PR 49. It needs debugging. What change broke it?

IIRC, the memory leak test is not solid.

1fish2 commented 1 year ago

When we move to Mojo🔥, we won't need Cython :)

thalassemia commented 1 year ago

Looking through the Git history, test_flagella was added in c91d6fe, which seems intended to provide more information during a simulation failure. I think the test failing is intentional. I renamed it fail_test_flagella in my PR so pytest does not automatically run it.

1fish2 commented 1 year ago

Ah. You created the GitHub release. I'll build and push to PyPI.

1fish2 commented 1 year ago

There it is: https://pypi.org/project/stochastic-arrow/1.0.0/

I guess I'll update wcEcoli.