Skip to content

Commit

Permalink
Merge pull request #890 from VukW/setup-clean
Browse files Browse the repository at this point in the history
Cleaning setup
  • Loading branch information
VukW authored Jul 1, 2024
2 parents b203928 + c312e24 commit 1715c1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 45 deletions.
3 changes: 2 additions & 1 deletion GANDLF/data/augmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ def get_augmentation_transforms(

if augmentation_type_lower in global_augs_dict:
current_augmentations.append(
global_augs_dict[augmentation_type_lower](**augmentation_params)
global_augs_dict[augmentation_type_lower](augmentation_params)
)
else:
warn(
f"Augmentation {augmentation_type} not found in the global augmentation dictionary.",
UserWarning,
)

return current_augmentations
49 changes: 5 additions & 44 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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]
# 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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
)

0 comments on commit 1715c1d

Please sign in to comment.