-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,6 @@ | |
|
||
import sys, re, os | ||
from setuptools import setup, find_packages | ||
from setuptools.command.install import install | ||
from setuptools.command.develop import develop | ||
from setuptools.command.egg_info import egg_info | ||
|
||
try: | ||
with open("README.md") as readme_file: | ||
|
@@ -17,21 +14,6 @@ | |
sys.stderr.write("Warning: Could not open '%s' due %s\n" % ("README.md", error)) | ||
|
||
|
||
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) | ||
|
||
|
||
try: | ||
filepath = "GANDLF/version.py" | ||
version_file = open(filepath) | ||
|
@@ -47,26 +29,10 @@ def run(self): | |
for item in os.listdir(os.path.dirname(os.path.abspath(__file__))) | ||
if (os.path.isfile(item) and item.startswith("Dockerfile-")) | ||
] | ||
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] | ||
Comment on lines
-50
to
-52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After installement, user receives this files directly in Good practice for building a wheel by So, there are two options: I chose the second solution. |
||
# find_packages should only ever find these as subpackages of gandlf, not as top-level packages | ||
# generate this dynamically? | ||
# GANDLF.GANDLF is needed to prevent recursion madness in deployments | ||
toplevel_package_excludes = [ | ||
"GANDLF.GANDLF", | ||
"anonymize", | ||
"cli", | ||
"compute", | ||
"data", | ||
"grad_clipping", | ||
"losses", | ||
"metrics", | ||
"models", | ||
"optimizers", | ||
"schedulers", | ||
"utils", | ||
] | ||
|
||
# Any extra files should be located at `GANDLF` module folder (not in repo root) | ||
extra_files = [] | ||
toplevel_package_excludes = ["testing*"] | ||
|
||
# specifying version for `black` separately because it is also used to [check for lint](https://github.com/mlcommons/GaNDLF/blob/master/.github/workflows/black.yml) | ||
black_version = "23.11.0" | ||
|
@@ -127,11 +93,6 @@ def run(self): | |
where=os.path.dirname(os.path.abspath(__file__)), | ||
exclude=toplevel_package_excludes, | ||
), | ||
cmdclass={ | ||
"install": CustomInstallCommand, | ||
"develop": CustomDevelopCommand, | ||
"egg_info": CustomEggInfoCommand, | ||
}, | ||
entry_points={ | ||
"console_scripts": [ | ||
"gandlf=GANDLF.entrypoints.cli_tool:gandlf", | ||
|
@@ -171,7 +132,7 @@ def run(self): | |
long_description=readme, | ||
long_description_content_type="text/markdown", | ||
include_package_data=True, | ||
package_data={"GANDLF": all_extra_files_pathcorrected}, | ||
package_data={"GANDLF": extra_files}, | ||
keywords="semantic, segmentation, regression, classification, data-augmentation, medical-imaging, clinical-workflows, deep-learning, pytorch", | ||
zip_safe=False, | ||
) |
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)