From db5e911781047e5dbba0adabde114cd18fe42a26 Mon Sep 17 00:00:00 2001 From: Thomas BAUDIER Date: Tue, 28 Jan 2025 10:54:19 +0100 Subject: [PATCH] Use pyproject instead of setup.py setuptools was removed, so I need to use pyproject --- .../bin/gt_affine_transform.py | 0 .../bin/gt_dicom_info.py | 0 .../bin/gt_dicom_rt_pbs2gate.py | 0 .../bin/gt_dicom_rt_struct_to_image.py | 0 .../bin/gt_digi_mac_converter.py | 0 bin/gt_dvh => gatetools/bin/gt_dvh.py | 0 .../bin/gt_gamma_index.py | 0 .../bin/gt_gate_info.py | 0 .../bin/gt_hausdorff.py | 0 .../bin/gt_image_arithm.py | 0 .../bin/gt_image_convert.py | 0 .../bin/gt_image_crop.py | 0 .../bin/gt_image_gauss.py | 0 .../bin/gt_image_resize.py | 0 .../bin/gt_image_statistics.py | 0 .../bin/gt_image_to_dicom_rt_struct.py | 0 .../bin/gt_image_uncertainty.py | 0 .../bin/gt_merge_root.py | 0 .../bin/gt_morpho_math.py | 0 {bin => gatetools/bin}/gt_pet_necr.py | 0 .../bin/gt_phsp_compare.py | 0 .../bin/gt_phsp_convert.py | 0 .../bin/gt_phsp_info.py | 0 .../bin/gt_phsp_merge.py | 0 .../bin/gt_phsp_peaks.py | 0 .../bin/gt_phsp_plot.py | 0 .../bin/gt_write_dicom.py | 0 pyproject.toml | 90 +++++++++++++++++ setup.py | 98 ------------------- 29 files changed, 90 insertions(+), 98 deletions(-) rename bin/gt_affine_transform => gatetools/bin/gt_affine_transform.py (100%) rename bin/gt_dicom_info => gatetools/bin/gt_dicom_info.py (100%) rename bin/gt_dicom_rt_pbs2gate => gatetools/bin/gt_dicom_rt_pbs2gate.py (100%) rename bin/gt_dicom_rt_struct_to_image => gatetools/bin/gt_dicom_rt_struct_to_image.py (100%) rename bin/gt_digi_mac_converter => gatetools/bin/gt_digi_mac_converter.py (100%) rename bin/gt_dvh => gatetools/bin/gt_dvh.py (100%) rename bin/gt_gamma_index => gatetools/bin/gt_gamma_index.py (100%) rename bin/gt_gate_info => gatetools/bin/gt_gate_info.py (100%) rename bin/gt_hausdorff => gatetools/bin/gt_hausdorff.py (100%) rename bin/gt_image_arithm => gatetools/bin/gt_image_arithm.py (100%) rename bin/gt_image_convert => gatetools/bin/gt_image_convert.py (100%) rename bin/gt_image_crop => gatetools/bin/gt_image_crop.py (100%) rename bin/gt_image_gauss => gatetools/bin/gt_image_gauss.py (100%) rename bin/gt_image_resize => gatetools/bin/gt_image_resize.py (100%) rename bin/gt_image_statistics => gatetools/bin/gt_image_statistics.py (100%) rename bin/gt_image_to_dicom_rt_struct => gatetools/bin/gt_image_to_dicom_rt_struct.py (100%) rename bin/gt_image_uncertainty => gatetools/bin/gt_image_uncertainty.py (100%) rename bin/gt_merge_root => gatetools/bin/gt_merge_root.py (100%) rename bin/gt_morpho_math => gatetools/bin/gt_morpho_math.py (100%) rename {bin => gatetools/bin}/gt_pet_necr.py (100%) rename bin/gt_phsp_compare => gatetools/bin/gt_phsp_compare.py (100%) rename bin/gt_phsp_convert => gatetools/bin/gt_phsp_convert.py (100%) rename bin/gt_phsp_info => gatetools/bin/gt_phsp_info.py (100%) rename bin/gt_phsp_merge => gatetools/bin/gt_phsp_merge.py (100%) rename bin/gt_phsp_peaks => gatetools/bin/gt_phsp_peaks.py (100%) rename bin/gt_phsp_plot => gatetools/bin/gt_phsp_plot.py (100%) rename bin/gt_write_dicom => gatetools/bin/gt_write_dicom.py (100%) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/bin/gt_affine_transform b/gatetools/bin/gt_affine_transform.py similarity index 100% rename from bin/gt_affine_transform rename to gatetools/bin/gt_affine_transform.py diff --git a/bin/gt_dicom_info b/gatetools/bin/gt_dicom_info.py similarity index 100% rename from bin/gt_dicom_info rename to gatetools/bin/gt_dicom_info.py diff --git a/bin/gt_dicom_rt_pbs2gate b/gatetools/bin/gt_dicom_rt_pbs2gate.py similarity index 100% rename from bin/gt_dicom_rt_pbs2gate rename to gatetools/bin/gt_dicom_rt_pbs2gate.py diff --git a/bin/gt_dicom_rt_struct_to_image b/gatetools/bin/gt_dicom_rt_struct_to_image.py similarity index 100% rename from bin/gt_dicom_rt_struct_to_image rename to gatetools/bin/gt_dicom_rt_struct_to_image.py diff --git a/bin/gt_digi_mac_converter b/gatetools/bin/gt_digi_mac_converter.py similarity index 100% rename from bin/gt_digi_mac_converter rename to gatetools/bin/gt_digi_mac_converter.py diff --git a/bin/gt_dvh b/gatetools/bin/gt_dvh.py similarity index 100% rename from bin/gt_dvh rename to gatetools/bin/gt_dvh.py diff --git a/bin/gt_gamma_index b/gatetools/bin/gt_gamma_index.py similarity index 100% rename from bin/gt_gamma_index rename to gatetools/bin/gt_gamma_index.py diff --git a/bin/gt_gate_info b/gatetools/bin/gt_gate_info.py similarity index 100% rename from bin/gt_gate_info rename to gatetools/bin/gt_gate_info.py diff --git a/bin/gt_hausdorff b/gatetools/bin/gt_hausdorff.py similarity index 100% rename from bin/gt_hausdorff rename to gatetools/bin/gt_hausdorff.py diff --git a/bin/gt_image_arithm b/gatetools/bin/gt_image_arithm.py similarity index 100% rename from bin/gt_image_arithm rename to gatetools/bin/gt_image_arithm.py diff --git a/bin/gt_image_convert b/gatetools/bin/gt_image_convert.py similarity index 100% rename from bin/gt_image_convert rename to gatetools/bin/gt_image_convert.py diff --git a/bin/gt_image_crop b/gatetools/bin/gt_image_crop.py similarity index 100% rename from bin/gt_image_crop rename to gatetools/bin/gt_image_crop.py diff --git a/bin/gt_image_gauss b/gatetools/bin/gt_image_gauss.py similarity index 100% rename from bin/gt_image_gauss rename to gatetools/bin/gt_image_gauss.py diff --git a/bin/gt_image_resize b/gatetools/bin/gt_image_resize.py similarity index 100% rename from bin/gt_image_resize rename to gatetools/bin/gt_image_resize.py diff --git a/bin/gt_image_statistics b/gatetools/bin/gt_image_statistics.py similarity index 100% rename from bin/gt_image_statistics rename to gatetools/bin/gt_image_statistics.py diff --git a/bin/gt_image_to_dicom_rt_struct b/gatetools/bin/gt_image_to_dicom_rt_struct.py similarity index 100% rename from bin/gt_image_to_dicom_rt_struct rename to gatetools/bin/gt_image_to_dicom_rt_struct.py diff --git a/bin/gt_image_uncertainty b/gatetools/bin/gt_image_uncertainty.py similarity index 100% rename from bin/gt_image_uncertainty rename to gatetools/bin/gt_image_uncertainty.py diff --git a/bin/gt_merge_root b/gatetools/bin/gt_merge_root.py similarity index 100% rename from bin/gt_merge_root rename to gatetools/bin/gt_merge_root.py diff --git a/bin/gt_morpho_math b/gatetools/bin/gt_morpho_math.py similarity index 100% rename from bin/gt_morpho_math rename to gatetools/bin/gt_morpho_math.py diff --git a/bin/gt_pet_necr.py b/gatetools/bin/gt_pet_necr.py similarity index 100% rename from bin/gt_pet_necr.py rename to gatetools/bin/gt_pet_necr.py diff --git a/bin/gt_phsp_compare b/gatetools/bin/gt_phsp_compare.py similarity index 100% rename from bin/gt_phsp_compare rename to gatetools/bin/gt_phsp_compare.py diff --git a/bin/gt_phsp_convert b/gatetools/bin/gt_phsp_convert.py similarity index 100% rename from bin/gt_phsp_convert rename to gatetools/bin/gt_phsp_convert.py diff --git a/bin/gt_phsp_info b/gatetools/bin/gt_phsp_info.py similarity index 100% rename from bin/gt_phsp_info rename to gatetools/bin/gt_phsp_info.py diff --git a/bin/gt_phsp_merge b/gatetools/bin/gt_phsp_merge.py similarity index 100% rename from bin/gt_phsp_merge rename to gatetools/bin/gt_phsp_merge.py diff --git a/bin/gt_phsp_peaks b/gatetools/bin/gt_phsp_peaks.py similarity index 100% rename from bin/gt_phsp_peaks rename to gatetools/bin/gt_phsp_peaks.py diff --git a/bin/gt_phsp_plot b/gatetools/bin/gt_phsp_plot.py similarity index 100% rename from bin/gt_phsp_plot rename to gatetools/bin/gt_phsp_plot.py diff --git a/bin/gt_write_dicom b/gatetools/bin/gt_write_dicom.py similarity index 100% rename from bin/gt_write_dicom rename to gatetools/bin/gt_write_dicom.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..691fff8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,90 @@ +[build-system] +requires = ["setuptools>=67"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = true +zip-safe = false +script-files = [ + 'gatetools/clustertools/opengate_power_merge.sh', + 'gatetools/clustertools/gate_power_merge.sh', +] + +[tool.setuptools.dynamic] +version = { file = "VERSION" } +readme = { file = "readme.md", content-type = "text/markdown"} + +[tool.setuptools.packages] +find = { } # Scanning implicit namespaces is active by default + +[project] +name = "gatetools" +version = "0.12.5" +dynamic = ["readme"] +authors = [{ name = "Opengate collaboration", email = "david.sarrut@creatis.insa-lyon.fr" }] +description = "Python tools for GATE, see https://github.com/OpenGATE/Gate" +license = { file = "LICENSE.md" } +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: PyPy", + "Operating System :: OS Independent", +] +requires-python = ">=3.7" +dependencies = [ + 'matplotlib', + 'click', + 'numpy', + 'scipy', + 'pydicom', + 'tqdm', + 'colored', + 'itk>=5.2.0', + 'uproot', + 'wget', + 'python-box', + 'lz4', + 'colorama', + #'rt-utils', + 'xxhash' +] + +[project.scripts] +gt_gate_info = "gatetools.bin.gt_gate_info:gt_gate_info" + +gt_image_uncertainty = "gatetools.bin.gt_image_uncertainty:gt_image_uncertainty" +gt_image_arithm = "gatetools.bin.gt_image_arithm:gt_image_arithm_main" +gt_image_crop = "gatetools.bin.gt_image_crop:gt_image_crop" +gt_image_convert = "gatetools.bin.gt_image_convert:gt_image_convert" +gt_image_statistics = "gatetools.bin.gt_image_statistics:gt_image_statistics_main" +gt_hausdorff = "gatetools.bin.gt_hausdorff:gt_hausdorff_main" +gt_gamma_index = "gatetools.bin.gt_gamma_index:gt_gamma_index_main" +gt_affine_transform = "gatetools.bin.gt_affine_transform:gt_affine_transform_main" +gt_write_dicom = "gatetools.bin.gt_write_dicom:gt_write_dicom_main" +gt_dicom_info = "gatetools.bin.gt_dicom_info:gt_dicom_info_main" +gt_image_gauss = "gatetools.bin.gt_image_gauss:gt_image_gauss_main" +gt_image_resize = "gatetools.bin.gt_image_resize:gt_image_resize_main" +gt_image_to_dicom_rt_struct = "gatetools.bin.gt_image_to_dicom_rt_struct:gt_image_to_dicom_rt_struct_main" +gt_dvh = "gatetools.bin.gt_dvh:gt_dvh_main" +gt_merge_root = "gatetools.bin.gt_merge_root:gt_merge_root_main" +gt_morpho_math = "gatetools.bin.gt_morpho_math:gt_morpho_math" + +gt_dicom_rt_struct_to_image = "gatetools.bin.gt_dicom_rt_struct_to_image:gt_dicom_rt_struct_to_image" +gt_dicom_rt_pbs2gate = "gatetools.bin.gt_dicom_rt_pbs2gate:gt_pbs_dicom2gate_main" + +gt_phsp_info = "gatetools.bin.gt_phsp_info:gt_phsp_info" +gt_phsp_convert = "gatetools.bin.gt_phsp_convert:gt_phsp_convert" +gt_phsp_merge = "gatetools.bin.gt_phsp_merge:gt_phsp_merge" +gt_phsp_plot = "gatetools.bin.gt_phsp_plot:gt_phsp_plot" +gt_phsp_compare = "gatetools.bin.gt_phsp_compare:gt_phsp_plot" +gt_phsp_peaks = "gatetools.bin.gt_phsp_peaks:gt_phsp_peaks" + +gt_digi_mac_converter = "gatetools.bin.gt_digi_mac_converter:convert_macro" + +gate_split_and_run = "gatetools.gatetools.clustertools.gate_split_and_run:runJobs" +opengate_run = "gatetools.gatetools.clustertools.opengate_run:runJobs_click" + + diff --git a/setup.py b/setup.py deleted file mode 100644 index 627d750..0000000 --- a/setup.py +++ /dev/null @@ -1,98 +0,0 @@ -import setuptools - -with open("readme.md", "r") as fh: - long_description = fh.read() - -setuptools.setup( - name="gatetools", - version="0.12.5", - include_package_data=True, - author="OpenGate collaboration", - author_email="david.sarrut@creatis.insa-lyon.fr", - description="Python tools for GATE, see https://github.com/OpenGATE/Gate", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/OpenGATE/GateTools", - package_dir={'gatetools': 'gatetools', - 'gatetools.phsp': 'gatetools/phsp'}, - packages=['gatetools', 'gatetools.phsp'], - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", - "Operating System :: OS Independent", - ], - python_requires='>=3.7', - install_requires=[ - 'matplotlib', - 'click', - 'numpy', - 'scipy', - 'pydicom', - 'tqdm', - 'colored', - 'itk>=5.2.0', - 'uproot', - 'wget', - 'python-box', - 'lz4', - 'colorama', - #'rt-utils', - 'xxhash' - ], - scripts=[ - 'bin/gt_gate_info', - - 'bin/gt_image_uncertainty', - 'bin/gt_image_arithm', - 'bin/gt_image_crop', - 'bin/gt_image_convert', - 'bin/gt_image_statistics', - 'bin/gt_hausdorff', - 'bin/gt_gamma_index', - 'bin/gt_affine_transform', - 'bin/gt_write_dicom', - 'bin/gt_dicom_info', - 'bin/gt_image_gauss', - 'bin/gt_image_resize', - 'bin/gt_image_to_dicom_rt_struct', - 'bin/gt_dvh', - 'bin/gt_merge_root', - 'bin/gt_morpho_math', - - 'bin/gt_dicom_rt_struct_to_image', - 'bin/gt_dicom_rt_pbs2gate', - - 'bin/gt_phsp_info', - 'bin/gt_phsp_convert', - 'bin/gt_phsp_merge', - 'bin/gt_phsp_plot', - 'bin/gt_phsp_compare', - 'bin/gt_phsp_peaks', - - 'bin/gt_digi_mac_converter', - - 'gatetools/clustertools/gate_split_and_run.py', - 'gatetools/clustertools/opengate_run.py', - 'gatetools/clustertools/opengate_power_merge.sh', - 'gatetools/clustertools/gate_power_merge.sh', - ] -) - -# ----------------------------------------------------------------------------- -# Uploading the package on pypi - -# Steps -# 1 - change version in setup.py file -# 2 - commit, tag. git push --tags -# 3 - setup: python3 setup.py sdist bdist_wheel -# 4 - twine: see below - -# On TEST pypi: -# twine upload --repository-url https://test.pypi.org/legacy/ dist/* -# On REAL pyip -# twine upload dist/* - -# test with -# pip uninstall gatetools -# pip3 install --extra-index-url https://test.pypi.org/simple/ gatetools -# https://test.pypi.org/project/gatetools/