Skip to content

Commit

Permalink
Merge branch 'setup-clean' into logging-config-place
Browse files Browse the repository at this point in the history
  • Loading branch information
VukW committed Jun 29, 2024
2 parents 5947420 + dcc40c7 commit e9bcc72
Showing 1 changed file with 5 additions and 42 deletions.
47 changes: 5 additions & 42 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,25 +29,11 @@ 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

# Any extra files should be located at `GANDLF` module folder (not in repo root)
extra_files = []
toplevel_package_excludes = [
"GANDLF.GANDLF",
"anonymize",
"cli",
"compute",
"data",
"grad_clipping",
"losses",
"metrics",
"models",
"optimizers",
"schedulers",
"utils",
"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)
Expand Down Expand Up @@ -127,11 +95,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 +134,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 e9bcc72

Please sign in to comment.