NeuroBench / neurobench

Benchmark harness and baseline results for the NeuroBench algorithm track.
https://neurobench.readthedocs.io
Apache License 2.0
61 stars 12 forks source link

Which build tool to use? #2

Closed V0XNIHILI closed 1 year ago

V0XNIHILI commented 1 year ago

Options:

Needs to be expanded!

jeremyforest commented 1 year ago

vote with a thumb up for the option you prefer below (bonus point for explanation and discussion !)

jeremyforest commented 1 year ago

pip

jeremyforest commented 1 year ago

poetry

jeremyforest commented 1 year ago

conda

ghost commented 1 year ago

A couple points to clarify, then an argument for Poetry:

  1. The term "Build Tool" when referring to Python gets a little complicated because there's a lot of different things that goes into managing Python packages.
  2. Pip is a package manager that allows you to install, upgrade, and manage Python packages and their dependencies. It is primarily used for installing pre-built packages that have already been created and distributed.
  3. Pip is not a package builder and does not have built-in functionality for creating packages from source code. You primarily use it in conjunction with a package like setuptools to package and deploy the projects.
  4. Both Pip and Poetry support the modern pyproject.toml file defined in PEP 518 for building and installing packages. A package built with Poetry is still installable with Pip, just like a package built with setuptools (which also supports building from pyproject.toml).

Argument for Poetry:

  1. Poetry includes functionality for managing dependencies, generating lockfiles, and creating distributable package files in the form of wheels or source distributions. This simplifies dependency management a ton as it uses the lockfile to ensure that all team members working on a project are using the same package versions. This can be particularly helpful when working with larger or more complex projects.
  2. Poetry also provides built-in virtual environment management, which allows you to create and manage isolated Python environments for your projects.
  3. Poetry's dependency resolver is known to be more reliable than Pip's, which can sometimes struggle with resolving complex dependency chains. This is particularly critical if we are interested in NeuroBench supporting some of the weirder platforms used in edge hardware.
  4. Compared to conda-build, Poetry only requires the pyproject.toml file where conda-build requires a bunch of additional meta files like meta.yaml, build.sh, build.bat, etc.
  5. The process for adding a dependency, building and publishing with poetry is 3 lines:
    poetry add <dependency>
    poetry build
    poetry publish