-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning setup #890
Cleaning setup #890
Conversation
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
class CustomInstallCommand(install): | ||
def run(self): | ||
install.run(self) | ||
|
||
|
||
class CustomDevelopCommand(develop): | ||
def run(self): | ||
develop.run(self) | ||
|
||
|
||
class CustomEggInfoCommand(egg_info): | ||
def run(self): | ||
egg_info.run(self) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These commands are just not used (I mean, they does not differ from default ones)
setup_files = ["setup.py", ".dockerignore", "pyproject.toml", "MANIFEST.in"] | ||
all_extra_files = dockerfiles + setup_files | ||
all_extra_files_pathcorrected = [os.path.join("../", item) for item in all_extra_files] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After installement, user receives this files directly in site-packages/
folder. The reason is using ../
in the path; however, that is caused by the fact these files are located in repo root.
Good practice for building a wheel by setup.py
(and, actually, the only possible one) is not to add these files to the wheel. Only files that are required for module should be added. Moreover, any file that should be added to user's site-packages/GANDLF
module should be located in module source library also (./GANDLF/
in our case, not in a repo root).
So, there are two options:
(1) move necessary files to ./GANDLF/
module source folder;
(2) just don't include them to the wheel at all.
I chose the second solution.
setup.py
Outdated
toplevel_package_excludes = [ | ||
"GANDLF.GANDLF", | ||
"anonymize", | ||
"cli", | ||
"compute", | ||
"data", | ||
"grad_clipping", | ||
"losses", | ||
"metrics", | ||
"models", | ||
"optimizers", | ||
"schedulers", | ||
"utils", | ||
"testing*", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not a top-level packages anymore (as they are located inside top-level GANDLF package). However, the testing
is a top-level (together with GANDLF
); thus we need to exclude it from a wheel (right now a wheel installs a testing
module also)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests failing.
FAILED testing/test_full.py::test_generic_config_read - TypeError: affine() got an unexpected keyword argument 'degrees'
Hi! Concerning linter issues - I'll fix it in this PR |
Hey! |
Thanks, folks! |
Proposed Changes
setup.py
places some GANDLF repo files tosite-packages/
of the user's python env. This cleaning helps to keep all gandlf files insite-packages/GANDLF
so keeping user env tidy + removes other unused parts ofsetup.py