aequitas icon indicating copy to clipboard operation
aequitas copied to clipboard

Separated setups

Open sgpjesus opened this issue 3 years ago • 1 comments

Fixes #108

setup.py supports now a new argument -l (or -lite). Requirements are separated, and only the required files are copied when creating a wheel.

This MR changes the way aequitas has its setup done:

  1. It cleans previous builds from the dist/ directory.
  2. It allows for the argument to create a lite wheel in the setup, removing the cli and webapp from installed packages (and reducing dependencies).
  3. It changes the manage.py file, to accommodate the changes. The command build has a flag for lite instalation ; the command upload now includes an argument for the repository to upload to (pypior testpypi, default is pypi; a new command release makes the operations of the command build and upload.

Additionally, the previously refactored Group class has a method to handle confusion matrix data (instead of scores and labels).

sgpjesus avatar May 28 '21 11:05 sgpjesus

Hello! Thanks so much for the pull request. And sorry it's now been quite a while since you opened it….

In short, if this is still of interest:

  • setuptools (and other Python packaging systems) already support the functionality you've added to the setup.py script. These are sometimes called "extras" or "optional dependencies." Indeed, you limit the library's requirements to those that are necessary for its "core" functionality – these are installed with pip install aequitas. The "heavier" requirements necessary for your "extra" – let's call it fancy – are then only installed when you say pip install aequitas[fancy]. This is documented a few places but for example here. The upshot is that nothing more is required than some configuration in the setup.py (or setup.cfg).
  • FYI: This sort of customization of the setup.py – whether directly to the script or via setuptools's offered hooks – is now heavily deprecated by the Python packaging ecosystem. For the sake of reproducible, reliable and quick installations, the setup.py itself as a tool for scripted installation is deprecated, and build tools are now heavily focused on wheels. It is possible to customize library's builds, of course; but, I'd say there's much less of that now than there once was.
  • I'd judge from your summary that it was intended to include changes unrelated to "separated setups"; I'd just recommend that you try to keep changesets, branches and pull requests distinct and as focused on a single issue as possible.

Anyway, thanks again, and if you'd like to continue to pursue these issues, let us know!

jesteria avatar Aug 16 '22 20:08 jesteria

@jesteria Thank you for the comment! Regarding this, my main idea is to separate the different packages you have in the project, and I think the most logical separation is between aequitas and the other interfaces aequitas_cli and aequitas_webapp. I will try to figure out myself on how we can adapt the python setup file for this.

sgpjesus avatar Dec 14 '22 09:12 sgpjesus