build: improve packaging #249
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR to make to make packaging a little nicer, in line with how packaging works in
unstructured. In particular, support for extras is added.This consists of:
sg.infor dependencies related tosupergradients. This file has beenpip-compiled with outputsg.txt.pip-compiled.constraints.into add anumpyconstraint that is required for compliance withsupergradients. Dependencies that precedesg.inneed to know about this to avoid conflicts.constraints.inis added as a constraints file for all other dependency files.maketargets are added for installingsupergradientsdependencies.supergradientsdependencies.supergradientsextra is added tosetup.pyandMANIFEST.inso it can be picked up by PyPi.supergradientsdependencies are not guaranteed to be installed, the way imports are handled in thesuper_gradients.pymodel file has been changed so imports are only attempted in the model constructor, in a module-level global variable. The constructor was used instead of doing the import ininitializedue to an error that occurred during import when initiated frominitialize.Testing
From a fresh
pyenvenvironment, and from the base folder ofunstructured-inference:(There should be no output, as
supergradientsshould not be installed.)Now:
(Output should show
super-gradientsis installed.)