aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
412 stars 184 forks source link

Identify minimal set of required dependencies, possibly moving e.g. PSQL ones to optional ones #6413

Closed giovannipizzi closed 1 month ago

giovannipizzi commented 1 month ago

Now with verdi presto, users might run without PSQL or RabbitMQ. Does it make sense to have a shorter list or required dependencies, to make installation faster/easier? And have some optional dependency group like pip install aiida-core[production] or similar, that installs what we install now, including e.g. the PSQL libraries etc.? This of course requires to be documented. Opinions welcome (and could be a good occasion to revisit the various dependencies and decide which are really required).

sphuber commented 1 month ago

Not sure there is much that can be removed. Since PSQL and RabbitMQ are often installed as a system service or through conda, there is not actually a dependency installed through the Python package system. If you look at the list in pyproject.toml the following are related to the database connections:

  'alembic~=1.2',,
  'psycopg2-binary~=2.8',
  'sqlalchemy~=2.0',

but these are also used by the SQLite based databases. So we shouldn't make these optional.

Considering the broker/daemon there would be:

  'aio-pika~=6.6',
  'circus~=0.18.0',
  'kiwipy[rmq]~=0.7.7',

But I am not sure if we can refactor the code such that these libraries would not be needed whatsoever when running without a broker. I don't think it would be worth too much time in any case just to save the user from installing these couple of dependencies. It would just overcomplicate things for very little gain.

giovannipizzi commented 1 month ago

OK thanks for checking - I think then it's OK to keep as is (probably only psycopg2-binary is the unneeded one, but being the binary version, I think it's OK and it should not make installation more complex