aequitas
aequitas copied to clipboard
Separated setups
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:
- It cleans previous builds from the
dist/
directory. - It allows for the argument to create a
lite
wheel in the setup, removing the cli and webapp from installed packages (and reducing dependencies). - It changes the
manage.py
file, to accommodate the changes. The commandbuild
has a flag forlite
instalation ; the commandupload
now includes an argument for the repository to upload to (pypi
ortestpypi
, default ispypi
; a new commandrelease
makes the operations of the commandbuild
andupload
.
Additionally, the previously refactored Group
class has a method to handle confusion matrix data (instead of scores and labels).
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 withpip install aequitas
. The "heavier" requirements necessary for your "extra" – let's call itfancy
– are then only installed when you saypip 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 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.