From 34d98b7d1c5563df31bf411e7ad50f6292082a88 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 13 May 2024 16:03:16 -0700 Subject: [PATCH 01/28] Fix path --- tools/debian/make-package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/debian/make-package.sh b/tools/debian/make-package.sh index d8cd84b4..cb846d0c 100755 --- a/tools/debian/make-package.sh +++ b/tools/debian/make-package.sh @@ -12,7 +12,7 @@ TOP_DIR=`cd "${TOOL_DIR}/../.." && pwd` cd ${TOP_DIR} rm -rf debian -cp -r util/debian/ . +cp -r tools/debian/ . rm debian/make-package.sh sed -i -e "s/\@CODENAME\@/$CODENAME/g" debian/changelog From ee30e66d1569630c864da3178f5898bf0ec773d0 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 4 Jun 2024 10:41:14 -0700 Subject: [PATCH 02/28] Squashed 'tools/dev_tools/' changes from 3ad5e0d8..c2d08a83 c2d08a83 Drop more Python 2 compatibility code 0c2600eb Remove Python 2 compatibility code a7ba54a2 Don't claim support for Python 2 git-subtree-dir: tools/dev_tools git-subtree-split: c2d08a833a185bae37ec2e962ad49f92fe6875e4 --- tools/dev_tools/README.md | 4 ++-- tools/dev_tools/check_standards.py | 1 - tools/dev_tools/cleanup_code.py | 11 ++--------- tools/dev_tools/cleanup_pycs.py | 1 - tools/dev_tools/make_all_header.py | 9 +-------- tools/dev_tools/python_tools/__init__.py | 1 - tools/dev_tools/replace.py | 1 - 7 files changed, 5 insertions(+), 23 deletions(-) diff --git a/tools/dev_tools/README.md b/tools/dev_tools/README.md index 686c409a..bfeaebf2 100644 --- a/tools/dev_tools/README.md +++ b/tools/dev_tools/README.md @@ -18,5 +18,5 @@ In particular it provides tools to deal with only modifying files that are changed (sed touches all passed files). - git support: see the `git` subdir. -Most of the scripts are Python scripts, and should work with Python 2.7 or -later (including Python 3). +Most of the scripts are Python scripts, and should work with Python 3.6 or +later. diff --git a/tools/dev_tools/check_standards.py b/tools/dev_tools/check_standards.py index 036b3a02..511945b7 100755 --- a/tools/dev_tools/check_standards.py +++ b/tools/dev_tools/check_standards.py @@ -2,7 +2,6 @@ """Print out any violations of IMP-specific standards.""" -from __future__ import print_function import sys import os.path import glob diff --git a/tools/dev_tools/cleanup_code.py b/tools/dev_tools/cleanup_code.py index dd42118b..b922cb7e 100755 --- a/tools/dev_tools/cleanup_code.py +++ b/tools/dev_tools/cleanup_code.py @@ -3,21 +3,14 @@ """Use clang-format and autopep8 when available to clean up the listed source files.""" -from __future__ import print_function from argparse import ArgumentParser import subprocess import os import sys import multiprocessing -try: - from queue import Queue # python3 -except ImportError: - from Queue import Queue # python2 +from queue import Queue from threading import Thread -try: - from shutil import which # python3.3 or later -except ImportError: - from distutils.spawn import find_executable as which +from shutil import which sys.path.append(os.path.split(sys.argv[0])) import python_tools diff --git a/tools/dev_tools/cleanup_pycs.py b/tools/dev_tools/cleanup_pycs.py index 705b311c..cde21870 100755 --- a/tools/dev_tools/cleanup_pycs.py +++ b/tools/dev_tools/cleanup_pycs.py @@ -3,7 +3,6 @@ """Traverses the directory tree deleting any .pyc's who do not have a source .py. Helpful when switching between revisions with source control.""" -from __future__ import print_function from os.path import join from os import walk, unlink import re diff --git a/tools/dev_tools/make_all_header.py b/tools/dev_tools/make_all_header.py index b10deee0..c5eda960 100755 --- a/tools/dev_tools/make_all_header.py +++ b/tools/dev_tools/make_all_header.py @@ -12,13 +12,6 @@ sys.path.append(os.path.split(sys.argv[0])[0]) import python_tools -# Treat an open file as UTF8-encoded, regardless of the locale -if sys.version_info[0] >= 3: - def open_utf8(fname): - return open(fname, encoding='UTF8') -else: - open_utf8 = open - def _add_includes(headers, output): for g in headers: @@ -51,7 +44,7 @@ def _add_includes(headers, output): allh = [] deprecated_allh = [] for h in orig_h: - if 'DEPRECATED_HEADER' in open_utf8(h).read(): + if 'DEPRECATED_HEADER' in open(h, encoding='UTF8').read(): deprecated_allh.append(h) else: allh.append(h) diff --git a/tools/dev_tools/python_tools/__init__.py b/tools/dev_tools/python_tools/__init__.py index aecd175f..204caa2a 100644 --- a/tools/dev_tools/python_tools/__init__.py +++ b/tools/dev_tools/python_tools/__init__.py @@ -1,4 +1,3 @@ -from __future__ import print_function import glob import os import ast diff --git a/tools/dev_tools/replace.py b/tools/dev_tools/replace.py index d8f76dd6..dbdd3243 100755 --- a/tools/dev_tools/replace.py +++ b/tools/dev_tools/replace.py @@ -3,7 +3,6 @@ """Replace all instances of argv[1] with argv[2], only updating the file if changes were made. """ -from __future__ import print_function import sys import os From e429b5f9c15f968db761aa2e21cedb679dcd5982 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 4 Jun 2024 10:50:04 -0700 Subject: [PATCH 03/28] Drop Python 2 compatibility code --- benchmark/benchmark_rmf.py | 1 - bin/rmf3_dump.py | 1 - examples/add_bonds.py | 1 - examples/alias.py | 1 - examples/alternatives.py | 1 - examples/bonds.py | 1 - examples/cloning.py | 1 - examples/externals.py | 1 - examples/geometry.py | 1 - examples/make_reference_frames.py | 1 - examples/motion.py | 1 - examples/multistate.py | 1 - examples/reference_frame_particle.py | 1 - examples/reference_frames.py | 1 - examples/rmf_decorator.py | 1 - examples/rmf_xml.py | 1 - test/expensive_test_signature.py | 1 - test/medium_test_backwards.py | 1 - test/medium_test_transitory_buffer.py | 1 - test/test_aliases.py | 1 - test/test_buffer_io.py | 1 - test/test_chain.py | 1 - test/test_children.py | 1 - test/test_closing.py | 1 - test/test_copy.py | 1 - test/test_dag.py | 1 - test/test_data_types.py | 1 - test/test_description.py | 1 - test/test_enums.py | 1 - test/test_external.py | 1 - test/test_features.py | 1 - test/test_file_level.py | 1 - test/test_fill.py | 1 - test/test_forward_compat.py | 1 - test/test_frame_comments.py | 1 - test/test_import.py | 1 - test/test_invalid.py | 1 - test/test_late_add_nodes.py | 1 - test/test_low_level.py | 1 - test/test_multikey.py | 1 - test/test_names.py | 1 - test/test_numpy.py | 1 - test/test_paths.py | 1 - test/test_pickle.py | 6 +----- test/test_provenance.py | 1 - test/test_ranges.py | 1 - test/test_reference.py | 1 - test/test_signature.py | 1 - test/test_string_chain.py | 1 - test/test_traverse.py | 1 - test/test_trivial.py | 1 - test/test_uncertainty.py | 1 - test/test_validate.py | 1 - test/test_writing.py | 1 - 54 files changed, 1 insertion(+), 58 deletions(-) diff --git a/benchmark/benchmark_rmf.py b/benchmark/benchmark_rmf.py index 2c6d9576..d30b2819 100644 --- a/benchmark/benchmark_rmf.py +++ b/benchmark/benchmark_rmf.py @@ -2,7 +2,6 @@ # \brief Benchmark operations on the RMF from python to see how much overhead # that adds -from __future__ import print_function import RMF import datetime diff --git a/bin/rmf3_dump.py b/bin/rmf3_dump.py index 2977dd2a..ac5a68bb 100755 --- a/bin/rmf3_dump.py +++ b/bin/rmf3_dump.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from __future__ import print_function import avro.schema from avro.datafile import DataFileReader, DataFileWriter from avro.io import DatumReader, DatumWriter diff --git a/examples/add_bonds.py b/examples/add_bonds.py index 0f8aca8f..843a8fa3 100644 --- a/examples/add_bonds.py +++ b/examples/add_bonds.py @@ -1,6 +1,5 @@ ## \example add_bonds.py # Show how to add bonds to a file. -from __future__ import print_function import RMF diff --git a/examples/alias.py b/examples/alias.py index 7bbc8c84..e308eb36 100644 --- a/examples/alias.py +++ b/examples/alias.py @@ -1,7 +1,6 @@ ## \example alias.py # Show using aliases to provide two different organization schemes # for manipulating a hierarchy. -from __future__ import print_function import RMF # find the name for a temporary file to use to for writing the hdf5 file diff --git a/examples/alternatives.py b/examples/alternatives.py index fe8969a2..1a03d3fa 100644 --- a/examples/alternatives.py +++ b/examples/alternatives.py @@ -5,7 +5,6 @@ # biological entity. Different representations can be used for different # purposes based on resolution or other criteria. -from __future__ import print_function import RMF tfn = RMF._get_temporary_file_path("alternatives.rmf3") diff --git a/examples/bonds.py b/examples/bonds.py index 3cc42238..d58fbb67 100644 --- a/examples/bonds.py +++ b/examples/bonds.py @@ -1,6 +1,5 @@ ## \example bonds.py # Show how to extract bonds from a file. -from __future__ import print_function import RMF diff --git a/examples/cloning.py b/examples/cloning.py index a62a1f76..1c50fec9 100644 --- a/examples/cloning.py +++ b/examples/cloning.py @@ -2,7 +2,6 @@ # RMF includes functions to help cloning files an extracting parts. They are # also exposed through the [rmf_slice](\ref rmf_slice) application. -from __future__ import print_function import RMF in_name = RMF.get_example_path("3U7W.rmf") diff --git a/examples/externals.py b/examples/externals.py index ee87882d..2025f768 100644 --- a/examples/externals.py +++ b/examples/externals.py @@ -1,7 +1,6 @@ ## \example externals.py # Show how to create an RMF file that has references to external files. # And how to read it back, sort of. -from __future__ import print_function import RMF import os.path import sys diff --git a/examples/geometry.py b/examples/geometry.py index 0bf0b00b..7528658b 100644 --- a/examples/geometry.py +++ b/examples/geometry.py @@ -1,7 +1,6 @@ ## \example geometry.py # Show creation of geometry in an RMF -from __future__ import print_function import RMF tfn = RMF._get_temporary_file_path("aliases.rmf") diff --git a/examples/make_reference_frames.py b/examples/make_reference_frames.py index a2e84e07..fb456535 100644 --- a/examples/make_reference_frames.py +++ b/examples/make_reference_frames.py @@ -1,7 +1,6 @@ ## \example make_reference_frames.py # This simple example makes an RMF file with several rigid copies of the # same thing -from __future__ import print_function import RMF file_name = RMF._get_temporary_file_path("reference_frame.rmfz") diff --git a/examples/motion.py b/examples/motion.py index 70734c5c..9bcb44c2 100644 --- a/examples/motion.py +++ b/examples/motion.py @@ -1,7 +1,6 @@ ## \example motion.py # Do a silly little simulation to show things moving around -from __future__ import print_function import RMF import random diff --git a/examples/multistate.py b/examples/multistate.py index 75166598..733bed52 100644 --- a/examples/multistate.py +++ b/examples/multistate.py @@ -2,7 +2,6 @@ # Show how to create an detect files where frames represent multiple # states of the same thing. -from __future__ import print_function import RMF tfn = RMF._get_temporary_file_path("multistate.rmf3") diff --git a/examples/reference_frame_particle.py b/examples/reference_frame_particle.py index 9a8973de..adb81c90 100644 --- a/examples/reference_frame_particle.py +++ b/examples/reference_frame_particle.py @@ -1,7 +1,6 @@ ## \example reference_frame_particle.py # This simple example makes an RMF file with several rigid copies of the # same thing -from __future__ import print_function import RMF file_name = RMF._get_temporary_file_path("reference_frame.rmfz") diff --git a/examples/reference_frames.py b/examples/reference_frames.py index 92e9f756..f0ec2ffd 100644 --- a/examples/reference_frames.py +++ b/examples/reference_frames.py @@ -1,6 +1,5 @@ ## \example reference_frames.py # Show how to properly extract coordinates in the presence of rigid bodies. -from __future__ import print_function import RMF # print out transformed coordinates diff --git a/examples/rmf_decorator.py b/examples/rmf_decorator.py index f62def3e..e94ee5b8 100644 --- a/examples/rmf_decorator.py +++ b/examples/rmf_decorator.py @@ -1,7 +1,6 @@ ## \example rmf_decorator.py # The example shows how to use the decorators by printing the # coordates and radius of every node that has them. -from __future__ import print_function import RMF diff --git a/examples/rmf_xml.py b/examples/rmf_xml.py index f5ce12ca..afddf707 100644 --- a/examples/rmf_xml.py +++ b/examples/rmf_xml.py @@ -8,7 +8,6 @@ # the same as other values). See the source code of rmf_xml for a # similar example in C++. -from __future__ import print_function import RMF # don't bother with command line arguments, to keep in simple diff --git a/test/expensive_test_signature.py b/test/expensive_test_signature.py index e1a534d8..0620387f 100644 --- a/test/expensive_test_signature.py +++ b/test/expensive_test_signature.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/medium_test_backwards.py b/test/medium_test_backwards.py index f1b260f9..96095076 100644 --- a/test/medium_test_backwards.py +++ b/test/medium_test_backwards.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/medium_test_transitory_buffer.py b/test/medium_test_transitory_buffer.py index c2e5f7b9..2e3aaf58 100644 --- a/test/medium_test_transitory_buffer.py +++ b/test/medium_test_transitory_buffer.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_aliases.py b/test/test_aliases.py index c972599d..9e366eef 100644 --- a/test/test_aliases.py +++ b/test/test_aliases.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_buffer_io.py b/test/test_buffer_io.py index 3b2866ea..2c5d79f1 100644 --- a/test/test_buffer_io.py +++ b/test/test_buffer_io.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_chain.py b/test/test_chain.py index 107be42f..6a997ddf 100644 --- a/test/test_chain.py +++ b/test/test_chain.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest diff --git a/test/test_children.py b/test/test_children.py index b485ed58..b11d876d 100644 --- a/test/test_children.py +++ b/test/test_children.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest import utils diff --git a/test/test_closing.py b/test/test_closing.py index 02759f53..f31c65e0 100644 --- a/test/test_closing.py +++ b/test/test_closing.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_copy.py b/test/test_copy.py index 26b06dc7..3e2588e1 100644 --- a/test/test_copy.py +++ b/test/test_copy.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_dag.py b/test/test_dag.py index 78b87df2..51e8508e 100644 --- a/test/test_dag.py +++ b/test/test_dag.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF RMF.set_log_level("trace") for suffix in RMF.suffixes: diff --git a/test/test_data_types.py b/test/test_data_types.py index 81f1dfc0..ee4c26ae 100644 --- a/test/test_data_types.py +++ b/test/test_data_types.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_description.py b/test/test_description.py index 4a5b4d49..72c28482 100644 --- a/test/test_description.py +++ b/test/test_description.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_enums.py b/test/test_enums.py index b1c4d4df..73bd9ce1 100644 --- a/test/test_enums.py +++ b/test/test_enums.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF rep = RMF.REPRESENTATION diff --git a/test/test_external.py b/test/test_external.py index c4d80c56..1a37cd73 100644 --- a/test/test_external.py +++ b/test/test_external.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import os.path import unittest diff --git a/test/test_features.py b/test/test_features.py index 7f2082d2..061d2087 100644 --- a/test/test_features.py +++ b/test/test_features.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import utils diff --git a/test/test_file_level.py b/test/test_file_level.py index 4ad82128..34b0946c 100644 --- a/test/test_file_level.py +++ b/test/test_file_level.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_fill.py b/test/test_fill.py index 9552e772..35903401 100644 --- a/test/test_fill.py +++ b/test/test_fill.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_forward_compat.py b/test/test_forward_compat.py index 2a711a06..a744922f 100644 --- a/test/test_forward_compat.py +++ b/test/test_forward_compat.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest diff --git a/test/test_frame_comments.py b/test/test_frame_comments.py index ba3cb4fd..f1f38222 100644 --- a/test/test_frame_comments.py +++ b/test/test_frame_comments.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_import.py b/test/test_import.py index 76bfd9db..df544c24 100644 --- a/test/test_import.py +++ b/test/test_import.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest diff --git a/test/test_invalid.py b/test/test_invalid.py index 5ebb8a65..8eaaf583 100644 --- a/test/test_invalid.py +++ b/test/test_invalid.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import utils diff --git a/test/test_late_add_nodes.py b/test/test_late_add_nodes.py index 089048f4..a7863814 100644 --- a/test/test_late_add_nodes.py +++ b/test/test_late_add_nodes.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF diff --git a/test/test_low_level.py b/test/test_low_level.py index f6136508..d1808754 100644 --- a/test/test_low_level.py +++ b/test/test_low_level.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_multikey.py b/test/test_multikey.py index 315f14f1..37904c34 100644 --- a/test/test_multikey.py +++ b/test/test_multikey.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_names.py b/test/test_names.py index 8c14d412..b5ee3f24 100644 --- a/test/test_names.py +++ b/test/test_names.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest diff --git a/test/test_numpy.py b/test/test_numpy.py index 3b577063..04e42899 100644 --- a/test/test_numpy.py +++ b/test/test_numpy.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest if RMF.RMF_HAS_NUMPY: diff --git a/test/test_paths.py b/test/test_paths.py index eefff4d4..7c24dde1 100644 --- a/test/test_paths.py +++ b/test/test_paths.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest import shutil diff --git a/test/test_pickle.py b/test/test_pickle.py index 8ba532c9..7b8181bd 100644 --- a/test/test_pickle.py +++ b/test/test_pickle.py @@ -1,9 +1,5 @@ -from __future__ import print_function import RMF -try: - import cPickle as pickle -except ImportError: - import pickle +import pickle b = RMF.BufferHandle() f = RMF.create_rmf_buffer(b) diff --git a/test/test_provenance.py b/test/test_provenance.py index e00c81c0..73c8af5e 100644 --- a/test/test_provenance.py +++ b/test/test_provenance.py @@ -1,4 +1,3 @@ -from __future__ import print_function import sys import RMF import unittest diff --git a/test/test_ranges.py b/test/test_ranges.py index 32bfa4f6..3a2eb60e 100644 --- a/test/test_ranges.py +++ b/test/test_ranges.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_reference.py b/test/test_reference.py index 38e66892..a8f81bd5 100644 --- a/test/test_reference.py +++ b/test/test_reference.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF import unittest import os diff --git a/test/test_signature.py b/test/test_signature.py index 97598d7b..98c59c53 100644 --- a/test/test_signature.py +++ b/test/test_signature.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_string_chain.py b/test/test_string_chain.py index 5b0007a9..fc2b355c 100644 --- a/test/test_string_chain.py +++ b/test/test_string_chain.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF import shutil diff --git a/test/test_traverse.py b/test/test_traverse.py index 5ebff1e6..63980e73 100644 --- a/test/test_traverse.py +++ b/test/test_traverse.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_trivial.py b/test/test_trivial.py index 6990ea57..bdddbc3e 100644 --- a/test/test_trivial.py +++ b/test/test_trivial.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_uncertainty.py b/test/test_uncertainty.py index 10d3ce3e..8af1ec48 100644 --- a/test/test_uncertainty.py +++ b/test/test_uncertainty.py @@ -1,4 +1,3 @@ -from __future__ import print_function import sys import RMF import unittest diff --git a/test/test_validate.py b/test/test_validate.py index 66744eb5..ced16199 100644 --- a/test/test_validate.py +++ b/test/test_validate.py @@ -1,4 +1,3 @@ -from __future__ import print_function import unittest import RMF diff --git a/test/test_writing.py b/test/test_writing.py index e434fc23..04669ffc 100644 --- a/test/test_writing.py +++ b/test/test_writing.py @@ -1,4 +1,3 @@ -from __future__ import print_function import RMF RMF.set_log_level("trace") From be3b5e9e534fd4b33f8852cd7e4363750ece67db Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 4 Jun 2024 10:50:44 -0700 Subject: [PATCH 04/28] Update copyright year --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2ecd3c0..a8c131e7 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ and score data. The main documentation is found on the [web site](http://integrativemodeling.org/rmf/nightly/doc/). -Copyright 2007-2023 IMP Inventors. +Copyright 2007-2024 IMP Inventors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 4683274be9456f20abf11a642501ec57661b3c95 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 4 Jun 2024 17:35:58 -0700 Subject: [PATCH 05/28] Drop support for Python 2 --- tools/RMF.spec | 123 +++---------------------------------------------- 1 file changed, 7 insertions(+), 116 deletions(-) diff --git a/tools/RMF.spec b/tools/RMF.spec index b64846c1..051f747b 100644 --- a/tools/RMF.spec +++ b/tools/RMF.spec @@ -1,29 +1,3 @@ -# On modern Fedora/RHEL, use Python 3 by default (and provide an RMF-python2 -# subpackage; on RHEL 9 or later, use Python 3 only). -# On older systems, the RMF package uses Python 2 only. -%if 0%{?fedora} > 12 || 0%{?rhel} >= 8 -%define with_python3 1 -%define cmake_use_python2 off -%define default_python python3 -%else -%define with_python3 0 -%define cmake_use_python2 on -%define default_python python2 -%endif - -%if 0%{?rhel} >= 9 -%define with_python2 0 -%else -%define with_python2 1 -%endif - -# Old RHEL only has a python-devel package, but RHEL8 only has python2-devel -%if 0%{?fedora} || 0%{?rhel} >= 8 -%define PYTHON2 python2 -%else -%define PYTHON2 python -%endif - Name: RMF Version: 1.6.1 Release: 1%{?dist} @@ -33,36 +7,14 @@ Group: Applications/Engineering Packager: Ben Webb URL: https://integrativemodeling.org/rmf/ Source0: rmf-%{version}.tar.gz -%if 0%{?with_python2} -BuildRequires: %{PYTHON2}-devel >= 2.7 -%endif -%if 0%{?with_python3} BuildRequires: python3-devel, symlinks -%endif BuildRequires: gcc-c++, hdf5-devel >= 1.8 -%if 0%{?rhel} == 7 -# The default SWIG package in RHEL7 is SWIG 2, but SWIG 3 is provided -# (in the CentOS Extras repository) -BuildRequires: swig3 >= 3.0 -%else BuildRequires: swig >= 3.0 -%endif - BuildRequires: cmake >= 2.8 BuildRequires: boost-devel >= 1.53 -# Add numpy support if available (the Python 2 variant is no longer shipped -# with modern Fedora). -%if 0%{?with_python3} BuildRequires: python3-numpy Requires: python3-numpy -%if 0%{?with_python2} && (0%{?fedora} < 34 || 0%{?rhel}) -BuildRequires: python2-numpy -%endif -%else -BuildRequires: numpy -Requires: numpy -%endif # Use user-visible (not "platform") Python on RHEL8 %if 0%{?rhel} >= 8 @@ -85,31 +37,12 @@ Group: Applications/Engineering Summary: Development package for RMF developers. Requires: %{name} = %{version}-%{release} Requires: boost-devel, hdf5-devel -%if 0%{?with_python3} Requires: python3-devel -%else -Requires: %{PYTHON2}-devel -%endif %description devel This package contains the include files for building applications that link against RMF. -%if 0%{?with_python2} && 0%{?with_python3} -%package python2 -Group: Applications/Engineering -Summary: Python wrappers for Python 2 -Requires: %{name} = %{version}-%{release} -Requires: python2 -%if 0%{?fedora} < 34 || 0%{?rhel} -Requires: python2-numpy -%endif - -%description python2 -This package contains wrappers for Python 2 (the base package already -includes Python 3 wrappers). -%endif - %prep %setup -n rmf-%{version} @@ -118,72 +51,30 @@ mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DUSE_PYTHON2=%{cmake_use_python2} + -DUSE_PYTHON2=off make %{?_smp_mflags} %install cd build make %{?_smp_mflags} DESTDIR=${RPM_BUILD_ROOT} install -%if 0%{?with_python2} && 0%{?with_python3} -# Build Python 2 wrappers -py2_ver=`%{PYTHON2} -c "import sys; print('%d.%d' % sys.version_info[:2])"` -py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` -py2_lib=`echo %{_libdir}/libpython2.*.so` -py2_inc=`echo /usr/include/python2.*` -cmake .. \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DCMAKE_INSTALL_PYTHONDIR=%{_libdir}/python${py2_ver}/site-packages \ - -DSWIG_PYTHON_LIBRARIES=${py2_lib} \ - -DPYTHON_INCLUDE_DIRS=${py2_inc} \ - -DPYTHON_INCLUDE_PATH=${py2_inc} \ - -DPYTHON_LIBRARIES=${py2_lib} -DUSE_PYTHON2=on -make %{?_smp_mflags} DESTDIR=${RPM_BUILD_ROOT} install - -# Replace .py files with symlinks to Python 3 files (since they are the same) -# but not the SWIG-generated __init__.py files (since these contain config -# information which might be different; e.g. on Fedora the Python 3 wrappers -# include numpy support but the Python 2 wrappers do not) -(cd ${RPM_BUILD_ROOT}%{_libdir}/python${py2_ver} \ - && find site-packages -name '*.py' -a ! -name __init__.py \ - -exec ln -sf ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/\{\} \{\} \; \ - && symlinks -rc .) -%endif - %check # Basic check of installed Python wrappers and command line tools export LD_LIBRARY_PATH=${RPM_BUILD_ROOT}%{_libdir} ${RPM_BUILD_ROOT}%{_prefix}/bin/rmf3_dump --version -%if 0%{?with_python3} - py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` - export PYTHONPATH=${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages - python3 -c "import RMF; assert(RMF.__version__ == '%{version}')" - python3 -c "import RMF; assert(hasattr(RMF, 'get_all_global_coordinates'))" -%endif - -%if 0%{?with_python2} - py2_ver=`%{PYTHON2} -c "import sys; print('%d.%d' % sys.version_info[:2])"` - export PYTHONPATH=${RPM_BUILD_ROOT}%{_libdir}/python${py2_ver}/site-packages - %{PYTHON2} -c "import RMF; assert(RMF.__version__ == '%{version}')" -%endif +py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` +export PYTHONPATH=${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages +python3 -c "import RMF; assert(RMF.__version__ == '%{version}')" +python3 -c "import RMF; assert(hasattr(RMF, 'get_all_global_coordinates'))" %files %defattr(-,root,root) %{_prefix}/bin/* %{_libdir}/libRMF*.so.* -%{_libdir}/%{default_python}*/site-packages/RMF* -%{_libdir}/%{default_python}*/site-packages/_RMF*so -%if 0%{?with_python3} +%{_libdir}/python3*/site-packages/RMF* +%{_libdir}/python3*/site-packages/_RMF*so %{_libdir}/python3*/site-packages/__pycache__ -%endif - -%if 0%{?with_python2} && 0%{?with_python3} -%files python2 -%defattr(-,root,root) -%{_libdir}/python2*/site-packages/RMF* -%{_libdir}/python2*/site-packages/_RMF*so -%endif %files devel %defattr(-,root,root) From e09fb8111050d2d0ea951e4568c8d7105cec1d31 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 5 Jun 2024 09:16:33 -0700 Subject: [PATCH 06/28] Require Python 3 at CMake time Remove the USE_PYTHON2 CMake variable since it is now required to always be "off". --- cmake_modules/IMPFindPython.cmake | 40 ++++++------------------------- tools/RMF.spec | 3 +-- tools/debian/rules | 2 +- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/cmake_modules/IMPFindPython.cmake b/cmake_modules/IMPFindPython.cmake index ed8d87c1..db7d5c08 100644 --- a/cmake_modules/IMPFindPython.cmake +++ b/cmake_modules/IMPFindPython.cmake @@ -1,17 +1,10 @@ # Like cmake's FindPython but allows the user to override; should also # work (to some degree) with older cmake function(imp_find_python) - set(USE_PYTHON2 off CACHE BOOL - "Force use of Python2 (by default Python3 is used if available)") - if (${CMAKE_VERSION} VERSION_LESS "3.14.0") message(WARNING "Using old Python detection logic. Recommended to upgrade to cmake 3.14.0 or later") if(NOT DEFINED PYTHON_INCLUDE_DIRS) - if (USE_PYTHON2) - set(_SEARCH_PYTHON_BINARIES python2 python) - else() - set(_SEARCH_PYTHON_BINARIES python3 python2 python) - endif() + set(_SEARCH_PYTHON_BINARIES python3 python) foreach(pybinary ${_SEARCH_PYTHON_BINARIES}) execute_process(COMMAND ${pybinary} -c "import sys; print(sys.executable)" @@ -44,6 +37,9 @@ function(imp_find_python) set(PYTHON_VERSION_MINOR ${minor} CACHE INTERNAL "" FORCE) set(PYTHON_VERSION_PATCH ${patch} CACHE INTERNAL "" FORCE) message(STATUS "Python binary is " ${python_full_path} " (version " ${python_full_version} ")") + if(${major} EQUAL 2) + message(FATAL_ERROR "Only Python 2 was found; Python 3 is required to build") + endif() find_package(PythonLibs ${python_full_version} EXACT REQUIRED) # Make sure PYTHON_INCLUDE_DIRS is in the cache so it can be @@ -69,12 +65,9 @@ function(imp_find_python) endif() else() - if (NOT USE_PYTHON2) - find_package(Python3 COMPONENTS Interpreter Development NumPy) - endif() + find_package(Python3 COMPONENTS Interpreter Development NumPy) - if(NOT USE_PYTHON2 - AND Python3_Interpreter_FOUND AND Python3_Development_FOUND) + if(Python3_Interpreter_FOUND AND Python3_Development_FOUND) # Use Python 3 tools set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "" FORCE) set(PYTHON_TEST_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "") @@ -89,26 +82,7 @@ function(imp_find_python) set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE INTERNAL "" FORCE) set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE INTERNAL "" FORCE) else() - find_package(Python2 COMPONENTS Interpreter Development NumPy) - if(Python2_Interpreter_FOUND AND Python2_Development_FOUND) - set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE} CACHE INTERNAL "" FORCE) - set(PYTHON_TEST_EXECUTABLE ${Python2_EXECUTABLE} CACHE STRING "") - set(PYTHON_LIBRARIES ${Python2_LIBRARIES} CACHE INTERNAL "" FORCE) - set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_LIBRARY_DIRS ${Python2_LIBRARY_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_NUMPY_FOUND ${Python2_NumPy_FOUND} CACHE INTERNAL "" FORCE) - set(PYTHON_NUMPY_INCLUDE_DIR ${Python2_NumPy_INCLUDE_DIRS} - CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION ${Python2_VERSION} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR} - CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MINOR ${Python2_VERSION_MINOR} - CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_PATCH ${Python2_VERSION_PATCH} - CACHE INTERNAL "" FORCE) - else() - message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.") - endif() + message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.") endif() endif() endfunction(imp_find_python) diff --git a/tools/RMF.spec b/tools/RMF.spec index 051f747b..82798b05 100644 --- a/tools/RMF.spec +++ b/tools/RMF.spec @@ -50,8 +50,7 @@ against RMF. mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DUSE_PYTHON2=off + -DCMAKE_INSTALL_PREFIX=%{_prefix} make %{?_smp_mflags} %install diff --git a/tools/debian/rules b/tools/debian/rules index 6773a32b..1698cec9 100755 --- a/tools/debian/rules +++ b/tools/debian/rules @@ -17,7 +17,7 @@ override_dh_auto_configure: cd build && py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` \ && cmake .. -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PYTHONDIR=/usr/lib/python$${py3_ver}/dist-packages \ - -DCMAKE_INSTALL_PREFIX=/usr -DUSE_PYTHON2=off + -DCMAKE_INSTALL_PREFIX=/usr override_dh_auto_build: $(MAKE) -C build From 29a97249671490b0f88731b3fa894a1db9a7b44f Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 5 Jun 2024 09:24:32 -0700 Subject: [PATCH 07/28] Remove CMake modules that are not used in RMF --- cmake_modules/CheckCompiles.cmake | 28 --------- cmake_modules/FindCGAL.cmake | 99 ------------------------------- cmake_modules/FindEigen3.cmake | 81 ------------------------- cmake_modules/FindOpenMP3.cmake | 21 ------- cmake_modules/FindRMF.cmake | 44 -------------- cmake_modules/InstallDeref.cmake | 23 ------- 6 files changed, 296 deletions(-) delete mode 100644 cmake_modules/CheckCompiles.cmake delete mode 100644 cmake_modules/FindCGAL.cmake delete mode 100644 cmake_modules/FindEigen3.cmake delete mode 100644 cmake_modules/FindOpenMP3.cmake delete mode 100644 cmake_modules/FindRMF.cmake delete mode 100644 cmake_modules/InstallDeref.cmake diff --git a/cmake_modules/CheckCompiles.cmake b/cmake_modules/CheckCompiles.cmake deleted file mode 100644 index 457868f5..00000000 --- a/cmake_modules/CheckCompiles.cmake +++ /dev/null @@ -1,28 +0,0 @@ -include(CheckCXXSourceCompiles) -function(check_compiles name pkgname ucpkgname includes include_dir link_libs result) - #message(STATUS "Trying to compile ${pkgname} searching in ${include_dir} ${link_libs}") - set(CMAKE_REQUIRED_LIBRARIES ${link_libs}) - set(CMAKE_REQUIRED_INCLUDES ${include_dir}) - set(mybody "${includes} -int main(int,char*[]) { - ${CHECK_COMPILES_BODY} - return 0; -}") - set(${pkgname}) - check_cxx_source_compiles("${mybody}" "${pkgname}${name}") - if ("${${pkgname}${name}}" MATCHES "1") - #message(STATUS "Compiled ok") - set(${ucpkgname}_INCLUDE_PATH ${include_dir} CACHE INTERNAL "" FORCE) - foreach(l ${link_libs}) - set(${ucpkgname}_LIBRARIES ${${ucpkgname}_LIBRARIES} ${l} CACHE INTERNAL "" FORCE) - endforeach() - file(WRITE "${CMAKE_BINARY_DIR}/build_info/${pkgname}" "ok=True -includepath=\"${${pkgname}_INCLUDE_PATH}\" -swigpath=\"${${pkgname}_SWIG_PATH}\" -libpath=\"${${pkgname}_LIB_PATH}\" -") - set(${result} "1" PARENT_SCOPE) - else() - set(${result} "0" PARENT_SCOPE) - endif() -endfunction(check_compiles) diff --git a/cmake_modules/FindCGAL.cmake b/cmake_modules/FindCGAL.cmake deleted file mode 100644 index 0471b8dd..00000000 --- a/cmake_modules/FindCGAL.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# -# The following module is based on FindVTK.cmake -# - -# - Find a CGAL installation or binary tree. -# The following variables are set if CGAL is found. If CGAL is not -# found, CGAL_FOUND is set to false. -# -# CGAL_FOUND - Set to true when CGAL is found. -# CGAL_USE_FILE - CMake file to use CGAL. -# - -# Construct consistent error messages for use below. -set(CGAL_DIR_DESCRIPTION "directory containing CGALConfig.cmake. This is either the binary directory where CGAL was configured or PREFIX/lib/CGAL for an installation.") -set(CGAL_DIR_MESSAGE "CGAL not found. Set the CGAL_DIR cmake variable or environment variable to the ${CGAL_DIR_DESCRIPTION}") - -set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) - -if ( NOT CGAL_DIR ) - - # Get the system search path as a list. - if(UNIX) - string(REGEX MATCHALL "[^:]+" CGAL_DIR_SEARCH1 "$ENV{PATH}") - else() - string(REGEX REPLACE "\\\\" "/" CGAL_DIR_SEARCH1 "$ENV{PATH}") - endif() - - string(REGEX REPLACE "/;" ";" CGAL_DIR_SEARCH2 "${CGAL_DIR_SEARCH1}") - - # Construct a set of paths relative to the system search path. - set(CGAL_DIR_SEARCH "") - - foreach(dir ${CGAL_DIR_SEARCH2}) - - set(CGAL_DIR_SEARCH ${CGAL_DIR_SEARCH} ${dir}/../lib/CGAL ) - - endforeach() - - - # - # Look for an installation or build tree. - # - find_path(CGAL_DIR CGALConfig.cmake - - # Look for an environment variable CGAL_DIR. - $ENV{CGAL_DIR} - - # Look in places relative to the system executable search path. - ${CGAL_DIR_SEARCH} - - # Look in standard UNIX install locations. - /usr/local/lib/CGAL - /usr/local/lib/cmake/CGAL - /usr/lib64/CGAL - /usr/lib64/cmake/CGAL - /usr/lib/CGAL - /usr/lib/cmake/CGAL - /usr/local/share/CGAL/cmake - /usr/share/CGAL/cmake - /usr/share/cmake/CGAL - /opt/homebrew/lib/cmake/CGAL - - # Read from the CMakeSetup registry entries. It is likely that - # CGAL will have been recently built. - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10] - - # Help the user find it if we cannot. - DOC "The ${CGAL_DIR_DESCRIPTION}" - ) - -endif() - -if ( CGAL_DIR ) - - if ( EXISTS "${CGAL_DIR}/CGALConfig.cmake" ) - include( "${CGAL_DIR}/CGALConfig.cmake" ) - set( CGAL_FOUND TRUE ) - endif() - -endif() - -if( NOT CGAL_FOUND) - if(CGAL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR ${CGAL_DIR_MESSAGE}) - else() - if(NOT CGAL_FIND_QUIETLY) - MESSAGE(STATUS ${CGAL_DIR_MESSAGE}) - endif() - endif() -endif() diff --git a/cmake_modules/FindEigen3.cmake b/cmake_modules/FindEigen3.cmake deleted file mode 100644 index 9c546a05..00000000 --- a/cmake_modules/FindEigen3.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# - Try to find Eigen3 lib -# -# This module supports requiring a minimum version, e.g. you can do -# find_package(Eigen3 3.1.2) -# to require version 3.1.2 or newer of Eigen3. -# -# Once done this will define -# -# EIGEN3_FOUND - system has eigen lib with correct version -# EIGEN3_INCLUDE_DIR - the eigen include directory -# EIGEN3_VERSION - eigen version - -# Copyright (c) 2006, 2007 Montel Laurent, -# Copyright (c) 2008, 2009 Gael Guennebaud, -# Copyright (c) 2009 Benoit Jacob -# Redistribution and use is allowed according to the terms of the 2-clause BSD license. - -if(NOT Eigen3_FIND_VERSION) - if(NOT Eigen3_FIND_VERSION_MAJOR) - set(Eigen3_FIND_VERSION_MAJOR 2) - endif(NOT Eigen3_FIND_VERSION_MAJOR) - if(NOT Eigen3_FIND_VERSION_MINOR) - set(Eigen3_FIND_VERSION_MINOR 91) - endif(NOT Eigen3_FIND_VERSION_MINOR) - if(NOT Eigen3_FIND_VERSION_PATCH) - set(Eigen3_FIND_VERSION_PATCH 0) - endif(NOT Eigen3_FIND_VERSION_PATCH) - - set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") -endif(NOT Eigen3_FIND_VERSION) - -macro(_eigen3_check_version) - file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) - - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") - set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") - set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") - set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") - - set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) - if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - set(EIGEN3_VERSION_OK FALSE) - else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - set(EIGEN3_VERSION_OK TRUE) - endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - - if(NOT EIGEN3_VERSION_OK) - - message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " - "but at least version ${Eigen3_FIND_VERSION} is required") - endif(NOT EIGEN3_VERSION_OK) -endmacro(_eigen3_check_version) - -if (EIGEN3_INCLUDE_DIR) - - # in cache already - _eigen3_check_version() - set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) - -else (EIGEN3_INCLUDE_DIR) - - find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - PATHS - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) - - if(EIGEN3_INCLUDE_DIR) - _eigen3_check_version() - endif(EIGEN3_INCLUDE_DIR) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) - - mark_as_advanced(EIGEN3_INCLUDE_DIR) - -endif(EIGEN3_INCLUDE_DIR) - diff --git a/cmake_modules/FindOpenMP3.cmake b/cmake_modules/FindOpenMP3.cmake deleted file mode 100644 index 0fd92e77..00000000 --- a/cmake_modules/FindOpenMP3.cmake +++ /dev/null @@ -1,21 +0,0 @@ -find_package(OpenMP) -if (OPENMP_FOUND) - set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS}) - set(mybody "#include -int main() { -omp_sched_t kind; -int chunk_size; -omp_get_schedule(&kind, &chunk_size); -return chunk_size; -}") - - check_cxx_source_compiles("${mybody}" OpenMP3) - set(CMAKE_REQUIRED_FLAGS ) - if ("${OpenMP3}" MATCHES "1") - message(STATUS "OpenMP 3 is supported and will be used") - else() - message(STATUS "OpenMP 3 not supported - will not be used") - set(OpenMP_CXX_FLAGS "" CACHE STRING "OpenMP flags" FORCE) - set(OPENMP_FOUND FALSE) - endif() -endif() diff --git a/cmake_modules/FindRMF.cmake b/cmake_modules/FindRMF.cmake deleted file mode 100644 index 2c87be14..00000000 --- a/cmake_modules/FindRMF.cmake +++ /dev/null @@ -1,44 +0,0 @@ -#[=======================================================================[.rst: -FindRMF -------- - -Try to find RMF - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -``RMF_FOUND`` - system has RMF -``RMF_INCLUDE_PATH`` - the RMF include directory -``RMF_SWIG_PATH`` - the directory containing SWIG (.i) files for RMF -``RMF_LIBRARY`` - Link this to use RMF -``RMF_VERSION_STRING`` - the version of RMF found - - -#]=======================================================================] - - -find_path(RMF_INCLUDE_PATH RMF.h PATH_SUFFIXES include) -find_path(RMF_SWIG_PATH RMF.i PATH_SUFFIXES share/RMF/swig) -if (NOT RMF_LIBRARY) - find_library(RMF_LIBRARY NAMES RMF PATH_SUFFIXES lib) -endif() - -if (RMF_INCLUDE_PATH AND EXISTS "${RMF_INCLUDE_PATH}/RMF/config.h") - file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MAJOR_H REGEX "#define RMF_VERSION_MAJOR +([0-9]+)") - file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MINOR_H REGEX "#define RMF_VERSION_MINOR +([0-9]+)") - string(REGEX REPLACE " *#define RMF_VERSION_MAJOR +([0-9]+) *" "\\1" RMF_VERSION_MAJOR "${RMF_MAJOR_H}") - string(REGEX REPLACE " *#define RMF_VERSION_MINOR +([0-9]+) *" "\\1" RMF_VERSION_MINOR "${RMF_MINOR_H}") - set(RMF_VERSION_STRING "${RMF_VERSION_MAJOR}.${RMF_VERSION_MINOR}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(RMF - REQUIRED_VARS RMF_LIBRARY RMF_INCLUDE_PATH RMF_SWIG_PATH - VERSION_VAR RMF_VERSION_STRING) diff --git a/cmake_modules/InstallDeref.cmake b/cmake_modules/InstallDeref.cmake deleted file mode 100644 index d5303c47..00000000 --- a/cmake_modules/InstallDeref.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Similar to INSTALL(DIRECTORY, ...) except that any symlinks in the -# hierarchy are dereferenced -function(install_deref src pattern dest) - file(GLOB_RECURSE relfiles RELATIVE ${src} FOLLOW_SYMLINKS ${src}/${pattern}) - foreach(relfile ${relfiles}) - get_filename_component(subdir ${relfile} PATH) - get_filename_component(fileext ${relfile} EXT) - get_filename_component(filename ${relfile} NAME) - get_filename_component(realfile "${src}/${relfile}" REALPATH) - # If we hit a directory, this must be a symlink; recurse into the - # linked-to directory - if(IS_DIRECTORY ${realfile}) - install_deref("${src}/${relfile}" ${pattern} "${dest}/${relfile}") - # Don't install .pyc (compiled Python) files, scons control files, - # or source control files - elseif(NOT "${fileext}" STREQUAL ".pyc" - AND NOT "${filename}" STREQUAL "SConscript" - AND NOT "${realfile}" MATCHES "\\.svn") - install(FILES ${realfile} RENAME ${filename} - DESTINATION "${dest}/${subdir}") - endif() - endforeach(relfile) -endfunction(install_deref) From e276a31a149efdf3fc62aab7111c49e3bfe4e1f5 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 28 Jun 2024 17:04:22 -0700 Subject: [PATCH 08/28] Use latest codecov with token --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f03b074..a3388fe1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,9 @@ jobs: ctest -j 2 --output-on-failure -L ${{ matrix.tests }} - name: Combine coverage run: | + ${GCC/gcc/gcov} $(find . -name "*.gcno") cd build/coverage - coverage combine && mv .coverage ../.. - - uses: codecov/codecov-action@v1 + coverage combine && coverage xml && mv coverage.xml ../.. + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From d2d63e476d2f0183c7dfc3fbe5ba52ac10c8fafb Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 28 Jun 2024 17:13:00 -0700 Subject: [PATCH 09/28] Skip gcov step for now --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3388fe1..8972d1d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,6 @@ jobs: ctest -j 2 --output-on-failure -L ${{ matrix.tests }} - name: Combine coverage run: | - ${GCC/gcc/gcov} $(find . -name "*.gcno") cd build/coverage coverage combine && coverage xml && mv coverage.xml ../.. - uses: codecov/codecov-action@v4 From 223a03c634edfbd4dad8ba96bcd09f742d6b2dc9 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 21 Aug 2024 09:21:13 -0700 Subject: [PATCH 10/28] Use FindBoost module rather than BoostConfig.cmake --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac9707a3..03260560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,12 @@ if(POLICY CMP0086) cmake_policy(SET CMP0086 NEW) endif(POLICY CMP0086) +# Use FindBoost module rather than BoostConfig.cmake (which requires +# Boost 1.70 or later) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif(POLICY CMP0167) + # C++11 can use the boost version set(Boost_NO_BOOST_CMAKE ON) find_package(Boost COMPONENTS system filesystem thread program_options iostreams From e812ce3e2a9b23e8ba575a5af5e85cb513638876 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 30 Aug 2024 13:19:17 -0700 Subject: [PATCH 11/28] Fix broken links to HDF5 API docs --- doc/FileFormat.md | 2 +- doc/HDF5.md | 2 +- doc/Installation.md | 2 +- include/RMF/HDF5/ConstDataSetD.h | 2 +- include/RMF/HDF5/ConstFile.h | 2 +- include/RMF/HDF5/ConstGroup.h | 2 +- include/RMF/HDF5/DataSetAccessPropertiesD.h | 2 +- include/RMF/HDF5/DataSetCreationPropertiesD.h | 2 +- include/RMF/HDF5/DataSetD.h | 2 +- include/RMF/HDF5/File.h | 4 ++-- include/RMF/HDF5/Group.h | 2 +- include/RMF/HDF5/MutableAttributes.h | 2 +- include/RMF/HDF5/Object.h | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/FileFormat.md b/doc/FileFormat.md index 6014df96..d578a8c4 100644 --- a/doc/FileFormat.md +++ b/doc/FileFormat.md @@ -207,7 +207,7 @@ There are several ways that the files can be made more compact (without breaking forwards compatibility of existing files). They can be investigated further if there is sufficient demand. -If [HDF5](https://support.hdfgroup.org/HDF5/) is available when RMF is built, +If [HDF5](https://www.hdfgroup.org/solutions/hdf5/) is available when RMF is built, wrappers for it will be built and support for older HDF5-based RMF formats will be compiled. diff --git a/doc/HDF5.md b/doc/HDF5.md index 21b9113c..5f511bca 100644 --- a/doc/HDF5.md +++ b/doc/HDF5.md @@ -4,7 +4,7 @@ HDF5 {#hdf5} We provide a simple set of classes for accessing core HDF5 functionality from C++. This was needed since - The HDF5 C interface is not trivial to use properly, particularly in regards to data type conversions and resource management. - It is very easy to use the C interface incorrectly without knowing it. -- The [standard HDF5 C++ interface](https://support.hdfgroup.org/HDF5/) doesn't really simplify use of the HDF5 library and doesn't make use of the features of C++. +- The [standard HDF5 C++ interface](https://www.hdfgroup.org/solutions/hdf5/) doesn't really simplify use of the HDF5 library and doesn't make use of the features of C++. The main classes provide access to: - HDF5 files through RMF::HDF5::File and RMF::HDF5::ConstFile diff --git a/doc/Installation.md b/doc/Installation.md index a7ac7293..004e4469 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -42,7 +42,7 @@ In order to build from source, you will need: If you want to be able to read older format RMF files, you will also need: -- [HDF5](https://support.hdfgroup.org/HDF5/) (1.8 or later; 1.10 or 1.12 +- [HDF5](https://www.hdfgroup.org/solutions/hdf5/) (1.8 or later; 1.10 or 1.12 should also work) ## Download {#installation_download} diff --git a/include/RMF/HDF5/ConstDataSetD.h b/include/RMF/HDF5/ConstDataSetD.h index b1e43d9b..b70502be 100644 --- a/include/RMF/HDF5/ConstDataSetD.h +++ b/include/RMF/HDF5/ConstDataSetD.h @@ -35,7 +35,7 @@ typedef std::vector ConstDataSetAttributesList; named as RMF::HDF5IndexDataSet2D (or RMF.HDF5IndexDataSet2). See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_d.html, the HDF5 manual} for more information. */ template diff --git a/include/RMF/HDF5/ConstFile.h b/include/RMF/HDF5/ConstFile.h index 3f3e9e91..caf956c7 100644 --- a/include/RMF/HDF5/ConstFile.h +++ b/include/RMF/HDF5/ConstFile.h @@ -18,7 +18,7 @@ namespace RMF { namespace HDF5 { /** Store a handle to a non-writable HDF5 file. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_f.html, the HDF5 manual} for more information. \note At the moment, a given file can only be opened once within a diff --git a/include/RMF/HDF5/ConstGroup.h b/include/RMF/HDF5/ConstGroup.h index f80cf42d..32dbd64a 100644 --- a/include/RMF/HDF5/ConstGroup.h +++ b/include/RMF/HDF5/ConstGroup.h @@ -24,7 +24,7 @@ RMF_ENABLE_WARNINGS namespace RMF { #endif /** Wrap an HDF5 Group. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5G.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_g.html, the HDF5 manual} for more information. */ class RMFEXPORT ConstGroup : public ConstAttributes { diff --git a/include/RMF/HDF5/DataSetAccessPropertiesD.h b/include/RMF/HDF5/DataSetAccessPropertiesD.h index 9bd3633a..fdef282a 100644 --- a/include/RMF/HDF5/DataSetAccessPropertiesD.h +++ b/include/RMF/HDF5/DataSetAccessPropertiesD.h @@ -28,7 +28,7 @@ RMF_ENABLE_WARNINGS namespace RMF { public: hid_t get_handle() const { return *h_; } /* Set the chunk cache to a certain size. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetChunkCache,H5Pset_chunk_cache}. + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___d_a_p_l.html#ga104d00442c31714ee073dee518f661f1,H5Pset_chunk_cache}. */ void set_chunk_cache_size(unsigned int entries, unsigned int size_bytes, double policy = .75) { diff --git a/include/RMF/HDF5/DataSetCreationPropertiesD.h b/include/RMF/HDF5/DataSetCreationPropertiesD.h index 9e3bcda6..b64da15e 100644 --- a/include/RMF/HDF5/DataSetCreationPropertiesD.h +++ b/include/RMF/HDF5/DataSetCreationPropertiesD.h @@ -36,7 +36,7 @@ RMF_ENABLE_WARNINGS namespace RMF { } } /** See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetChunk, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___d_c_p_l.html#ga3584d592e377da3604b7604e266dcf5b, H5Pset_chunk} */ void set_chunk_size(DataSetIndexD chunk_size) { diff --git a/include/RMF/HDF5/DataSetD.h b/include/RMF/HDF5/DataSetD.h index 24bc7c04..46eb2ba6 100644 --- a/include/RMF/HDF5/DataSetD.h +++ b/include/RMF/HDF5/DataSetD.h @@ -26,7 +26,7 @@ namespace HDF5 { named as RMF::HDF5::IndexDataSet2D (or RMF.HDF5.IndexDataSet2). See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_d.html, the HDF5 manual} for more information. */ template diff --git a/include/RMF/HDF5/File.h b/include/RMF/HDF5/File.h index 92fc44f6..142faf27 100644 --- a/include/RMF/HDF5/File.h +++ b/include/RMF/HDF5/File.h @@ -20,7 +20,7 @@ RMF_ENABLE_WARNINGS namespace RMF { regards to data type conversions and resource management - It is very easy to use the C interface incorrectly without knowing it. - The - \external{https://support.hdfgroup.org/HDF5/, standard HDF5 C++ interface} + \external{https://www.hdfgroup.org/solutions/hdf5/, standard HDF5 C++ interface} doesn't really simplify use of the HDF5 library and doesn't make use of the features of C++. @@ -50,7 +50,7 @@ RMF_ENABLE_WARNINGS namespace RMF { namespace HDF5 { /** Store a handle to an HDF5 file. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_f.html, the HDF5 manual} for more information.*/ class RMFEXPORT File : public Group { public: diff --git a/include/RMF/HDF5/Group.h b/include/RMF/HDF5/Group.h index 5394d395..d4b904b8 100644 --- a/include/RMF/HDF5/Group.h +++ b/include/RMF/HDF5/Group.h @@ -24,7 +24,7 @@ typedef std::vector GroupAttributesList; #endif /** Wrap an HDF5 Group. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5G.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_g.html, the HDF5 manual} for more information. */ class RMFEXPORT Group : public MutableAttributes { diff --git a/include/RMF/HDF5/MutableAttributes.h b/include/RMF/HDF5/MutableAttributes.h index 60793220..aac6d5de 100644 --- a/include/RMF/HDF5/MutableAttributes.h +++ b/include/RMF/HDF5/MutableAttributes.h @@ -18,7 +18,7 @@ RMF_ENABLE_WARNINGS namespace RMF { namespace HDF5 { /** Wrap a set of HDF5 Attributes. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5A.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_a.html, the HDF5 manual} for more information. */ template diff --git a/include/RMF/HDF5/Object.h b/include/RMF/HDF5/Object.h index 1f8676af..20df2837 100644 --- a/include/RMF/HDF5/Object.h +++ b/include/RMF/HDF5/Object.h @@ -24,7 +24,7 @@ namespace HDF5 { class File; /** Wrap an HDF5 Object. See - \external{https://support.hdfgroup.org/HDF5/doc/RM/RM_H5O.html, + \external{https://docs.hdfgroup.org/releases/hdf5/v1_14/v1_14_4/documentation/doxygen/group___h5_o.html, the HDF5 manual} for more information. */ class RMFEXPORT Object { From 8cd2a6191fd229a6080d97ccb78b1c66d2dfa963 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 30 Oct 2024 17:50:23 -0700 Subject: [PATCH 12/28] Don't catch polymorphic type by value --- bin/rmf3_dump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rmf3_dump.cpp b/bin/rmf3_dump.cpp index 8f0f7ddd..de80a2a1 100644 --- a/bin/rmf3_dump.cpp +++ b/bin/rmf3_dump.cpp @@ -56,7 +56,7 @@ int main(int argc, char** argv) { std::cout << std::endl; } } - catch (std::exception e) { + catch (const std::exception &e) { std::cerr << "Caught exception " << e.what() << std::endl; } return 0; From d73f857f60d6f436da77587ba0ea84dd8957b963 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:27:32 -0800 Subject: [PATCH 13/28] Add script to check spelling --- tools/codespell.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 tools/codespell.sh diff --git a/tools/codespell.sh b/tools/codespell.sh new file mode 100755 index 00000000..a925e793 --- /dev/null +++ b/tools/codespell.sh @@ -0,0 +1,2 @@ +#!/bin/sh +codespell . --skip="*.pdb,*.rmf,*.rmf3,*.buf,./src/avrocpp/*" -L assertIn From 0c59e5eca26df9d085644e5873af5ae843a395a7 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:30:56 -0800 Subject: [PATCH 14/28] Fix typos --- doc/Viewing.md | 2 +- include/RMF/HDF5/ConstAttributes.h | 2 +- tools/codespell.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Viewing.md b/doc/Viewing.md index d047f70b..53dce456 100644 --- a/doc/Viewing.md +++ b/doc/Viewing.md @@ -10,7 +10,7 @@ There are currently several molecular viewers that support RMFs: # Chimera # {#chimera} The [Chimera](https://www.cgl.ucsf.edu/chimera/) research group has -provided support for loading and interacing with RMF files. Chimera +provided support for loading and interacting with RMF files. Chimera supports - interactive display of restraints and restraint scores - geometry diff --git a/include/RMF/HDF5/ConstAttributes.h b/include/RMF/HDF5/ConstAttributes.h index e9a788ce..02540d90 100644 --- a/include/RMF/HDF5/ConstAttributes.h +++ b/include/RMF/HDF5/ConstAttributes.h @@ -20,7 +20,7 @@ RMF_ENABLE_WARNINGS namespace RMF { namespace HDF5 { -/** Wrap an gettings the attributes from an HDF5 Object. Each data set or +/** Wrap getting the attributes from an HDF5 Object. Each data set or group can have associated data. These data should be relatively small (a few k at most). See MutableAttributes for the methods to change the attribute data. diff --git a/tools/codespell.sh b/tools/codespell.sh index a925e793..24d844c4 100755 --- a/tools/codespell.sh +++ b/tools/codespell.sh @@ -1,2 +1,2 @@ #!/bin/sh -codespell . --skip="*.pdb,*.rmf,*.rmf3,*.buf,./src/avrocpp/*" -L assertIn +codespell . --skip="*.pdb,*.rmf,*.rmf3,*.buf,molfile_plugin.h,./src/avrocpp/*" -L assertIn From 05a9dc96b4c4ad7d994aa5c8f7539347acbc473a Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:33:36 -0800 Subject: [PATCH 15/28] Fix flake8 issues --- doc/dot | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/dot b/doc/dot index 2f9e5ca1..5e0b9c99 100755 --- a/doc/dot +++ b/doc/dot @@ -1,14 +1,15 @@ #!/usr/bin/env python -"""Tidy up .dot files to remove links to internal headers and full path names""" +"""Tidy up .dot files to remove links to internal headers and + full path names""" import sys import os import re -labelre = re.compile('\s*Node(\d+)\s+\[label="[^"]*internal[^"]*"') -stripre = re.compile('(\s*Node\d+\s+\[label=")[^"]*include/(.*)$') -linkre = re.compile('\s*Node(\d+)\s+\->Node(\d+)\s+') +labelre = re.compile(r'\s*Node(\d+)\s+\[label="[^"]*internal[^"]*"') +stripre = re.compile(r'(\s*Node\d+\s+\[label=")[^"]*include/(.*)$') +linkre = re.compile(r'\s*Node(\d+)\s+\->Node(\d+)\s+') # Get a dict of all nodes that correspond to internal headers nodes_to_remove = {} @@ -21,7 +22,8 @@ for line in file_contents: # Rewrite the .dot file fh = open(sys.argv[1], 'w') for line in file_contents: - # Remove any nodes corresponding to internal headers, and links between them + # Remove any nodes corresponding to internal headers, and + # links between them m = labelre.match(line) if m and m.group(1) in nodes_to_remove: continue From f3816b37c0a4e8b1b3fe8aacc13b1e86ee3b38d1 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:39:22 -0800 Subject: [PATCH 16/28] Remove some obsolete tags --- doc/Doxyfile.in | 75 ------------------------------------------------- 1 file changed, 75 deletions(-) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 3201f630..d790e716 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -226,12 +226,6 @@ ALIASES = "command{1}=\code \1 \endcode" \ "rmfattributetable_end=" \ "rmfattribute{4}=\1\2\3\4" -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -1004,13 +998,6 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1413,17 +1400,6 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using prerendered bitmaps. Use this if you do not have LaTeX @@ -1602,15 +1578,6 @@ MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO -# The PAPER_TYPE tag can be used to set the paper type that is used by the -# printer. -# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x -# 14 inches) and executive (7.25 x 10.5 inches). -# The default value is: a4. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -PAPER_TYPE = a4wide - # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names # that should be included in the LaTeX output. To get the times font for # instance you can specify @@ -1686,16 +1653,6 @@ LATEX_BATCHMODE = YES LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # http://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -2016,12 +1973,6 @@ EXTERNAL_GROUPS = NO EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2035,15 +1986,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2076,23 +2018,6 @@ HAVE_DOT = YES DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTNAME = - -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTSIZE = 10 - # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set # the path where dot can find it using this tag. From f89d80d1a36f500318ef51c1fea29b430c28642e Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:47:19 -0800 Subject: [PATCH 17/28] Fix unmatched group --- include/RMF/infrastructure_macros.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/RMF/infrastructure_macros.h b/include/RMF/infrastructure_macros.h index a1e02a51..431fcf61 100644 --- a/include/RMF/infrastructure_macros.h +++ b/include/RMF/infrastructure_macros.h @@ -79,7 +79,6 @@ RMF_ENABLE_WARNINGS //! Implement a hash function for the class #define RMF_HASHABLE(name, hashret) -/** @} */ #else #define RMF_HASHABLE(name, hashret) \ @@ -87,8 +86,6 @@ RMF_ENABLE_WARNINGS #endif -/** @} */ - #ifdef SWIG #define RMF_SHOWABLE(Name, streamed) \ std::string __str__() const { \ From 6e351ae3f1e23d409355a7d5b47b1ccd20172667 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 14:59:56 -0800 Subject: [PATCH 18/28] Allow for any version of doxygen The docs appear to build without issues using the latest version of doxygen, so don't require the ancient 1.8.6 version. --- cmake_modules/FindCurrentDoxygen.cmake | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmake_modules/FindCurrentDoxygen.cmake b/cmake_modules/FindCurrentDoxygen.cmake index 9d7607a0..a1b3d743 100644 --- a/cmake_modules/FindCurrentDoxygen.cmake +++ b/cmake_modules/FindCurrentDoxygen.cmake @@ -6,18 +6,11 @@ message(STATUS "Python xml.etree not found, docs disabled.") set(IMP_DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}" CACHE INTERNAL "") else() find_package(Doxygen QUIET) -set(needed_doxygen_version "1.8.6") if(DOXYGEN_FOUND) imp_get_process_output("Doxygen version" doxygen_version ${CMAKE_BINARY_DIR} COMMAND ${DOXYGEN_EXECUTABLE} --version) - if("${doxygen_version}" STREQUAL "${needed_doxygen_version}") - message(STATUS "Doxygen is ${DOXYGEN_EXECUTABLE}, version ${doxygen_version}") - set(IMP_DOXYGEN_FOUND True CACHE INTERNAL "") - set(IMP_DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE} CACHE INTERNAL "") - else() - message(STATUS "Wrong doxygen version at ${DOXYGEN_EXECUTABLE}. Found ${doxygen_version}, but needed ${needed_doxygen_version}") - set(IMP_DOXYGEN_FOUND False CACHE INTERNAL "") - set(IMP_DOXYGEN_EXECUTABLE "not-found" CACHE INTERNAL "") - endif() + message(STATUS "Doxygen is ${DOXYGEN_EXECUTABLE}, version ${doxygen_version}") + set(IMP_DOXYGEN_FOUND True CACHE INTERNAL "") + set(IMP_DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE} CACHE INTERNAL "") else() message(STATUS "Doxygen not found") endif(DOXYGEN_FOUND) From 60aaa406d2d9ed260788293f8d279797589eeb9a Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 15:06:11 -0800 Subject: [PATCH 19/28] Fix path to Python binary --- doc/dot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dot b/doc/dot index 5e0b9c99..e599ee58 100755 --- a/doc/dot +++ b/doc/dot @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Tidy up .dot files to remove links to internal headers and full path names""" From 1c6c503662234d54a18a09b2485bbc5da6491056 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 15:09:08 -0800 Subject: [PATCH 20/28] Make sure files get closed --- doc/dot | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/doc/dot b/doc/dot index e599ee58..b744680a 100755 --- a/doc/dot +++ b/doc/dot @@ -13,26 +13,27 @@ linkre = re.compile(r'\s*Node(\d+)\s+\->Node(\d+)\s+') # Get a dict of all nodes that correspond to internal headers nodes_to_remove = {} -file_contents = open(sys.argv[1]).readlines() +with open(sys.argv[1]) as fh: + file_contents = fh.readlines() for line in file_contents: m = labelre.match(line) if m: nodes_to_remove[m.group(1)] = None # Rewrite the .dot file -fh = open(sys.argv[1], 'w') -for line in file_contents: - # Remove any nodes corresponding to internal headers, and - # links between them - m = labelre.match(line) - if m and m.group(1) in nodes_to_remove: - continue - m = linkre.match(line) - if m and (m.group(1) in nodes_to_remove or m.group(2) in nodes_to_remove): - continue - # Strip out full paths (sometimes doxygen lets these slip through) - fh.write(stripre.sub(r'\1\2', line)) -fh.close() +with open(sys.argv[1], 'w') as fh: + for line in file_contents: + # Remove any nodes corresponding to internal headers, + # and links between them + m = labelre.match(line) + if m and m.group(1) in nodes_to_remove: + continue + m = linkre.match(line) + if m and (m.group(1) in nodes_to_remove + or m.group(2) in nodes_to_remove): + continue + # Strip out full paths (sometimes doxygen lets these slip through) + fh.write(stripre.sub(r'\1\2', line)) # Now pass control to the real 'dot' binary sys.argv[0] = 'dot' From 8e289687e5fea593d9f87972ee78230871833262 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 8 Nov 2024 15:18:59 -0800 Subject: [PATCH 21/28] Don't report an exception at end-of-file --- bin/rmf3_dump.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/rmf3_dump.cpp b/bin/rmf3_dump.cpp index de80a2a1..ce82452f 100644 --- a/bin/rmf3_dump.cpp +++ b/bin/rmf3_dump.cpp @@ -57,7 +57,10 @@ int main(int argc, char** argv) { } } catch (const std::exception &e) { - std::cerr << "Caught exception " << e.what() << std::endl; + // avro uses a plain exception to signal EOF + if (std::string(e.what()) != "EOF reached") { + std::cerr << "Caught exception " << e.what() << std::endl; + } } return 0; } From 99d3cdeb8e32ae1ff4cc0638517e7e0b8b53a9a4 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 14 Nov 2024 11:57:11 -0800 Subject: [PATCH 22/28] Update minimum CMake version to 3.14 The oldest OS we support, Ubuntu 20.04, ships with CMake 3.16, so we can require 3.14. 3.14 includes the new Python detection logic so we can also drop our workaround for older CMake. --- CMakeLists.txt | 2 +- cmake_modules/IMPFindPython.cmake | 100 +++++------------------------- doc/Installation.md | 2 +- 3 files changed, 19 insertions(+), 85 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03260560..2a8e9c5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12...3.6.0) +cmake_minimum_required(VERSION 3.14.0) project(RMF) # needs to be in main CMakeLists.txt diff --git a/cmake_modules/IMPFindPython.cmake b/cmake_modules/IMPFindPython.cmake index db7d5c08..4244c2a7 100644 --- a/cmake_modules/IMPFindPython.cmake +++ b/cmake_modules/IMPFindPython.cmake @@ -1,88 +1,22 @@ -# Like cmake's FindPython but allows the user to override; should also -# work (to some degree) with older cmake +# Like cmake's FindPython but allows the user to override function(imp_find_python) - if (${CMAKE_VERSION} VERSION_LESS "3.14.0") - message(WARNING "Using old Python detection logic. Recommended to upgrade to cmake 3.14.0 or later") - if(NOT DEFINED PYTHON_INCLUDE_DIRS) - set(_SEARCH_PYTHON_BINARIES python3 python) - - foreach(pybinary ${_SEARCH_PYTHON_BINARIES}) - execute_process(COMMAND ${pybinary} -c "import sys; print(sys.executable)" - RESULT_VARIABLE retval - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - OUTPUT_VARIABLE python_full_path - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(${retval} EQUAL 0) - break() - endif() - endforeach() - - if(NOT ${retval} EQUAL 0) - message(FATAL_ERROR "Could not find a suitable Python binary - looked for ${_SEARCH_PYTHON_BINARIES}") - endif() - set(PYTHON_EXECUTABLE ${python_full_path} CACHE INTERNAL "" FORCE) - set(PYTHON_TEST_EXECUTABLE ${python_full_path} CACHE STRING "") - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print('%d.%d.%d' % sys.version_info[:3])" - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - OUTPUT_VARIABLE python_full_version - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "^([0-9])+\\.[0-9]+.*" "\\1" major - "${python_full_version}") - string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" minor - "${python_full_version}") - string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" patch - "${python_full_version}") - set(PYTHON_VERSION ${python_full_version} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MAJOR ${major} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MINOR ${minor} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_PATCH ${patch} CACHE INTERNAL "" FORCE) - message(STATUS "Python binary is " ${python_full_path} " (version " ${python_full_version} ")") - if(${major} EQUAL 2) - message(FATAL_ERROR "Only Python 2 was found; Python 3 is required to build") - endif() - - find_package(PythonLibs ${python_full_version} EXACT REQUIRED) - # Make sure PYTHON_INCLUDE_DIRS is in the cache so it can be - # used elsewhere - set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} CACHE INTERNAL "") - endif() - if(NOT DEFINED PYTHON_NUMPY_INCLUDE_DIR) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "try: import numpy; print(numpy.get_include());\nexcept: pass" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - OUTPUT_VARIABLE __numpy_path - OUTPUT_STRIP_TRAILING_WHITESPACE) - find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h - HINTS "${__numpy_path}" "${PYTHON_INCLUDE_PATH}" - NO_DEFAULT_PATH) - if(PYTHON_NUMPY_INCLUDE_DIR) - set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found") - endif() - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(NumPy - REQUIRED_VARS PYTHON_NUMPY_INCLUDE_DIR - VERSION_VAR __numpy_version) - endif() + find_package(Python3 COMPONENTS Interpreter Development NumPy) + if(Python3_Interpreter_FOUND AND Python3_Development_FOUND) + # Use Python 3 tools + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "" FORCE) + set(PYTHON_TEST_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "") + set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE INTERNAL "" FORCE) + set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE INTERNAL "" FORCE) + set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE INTERNAL "" FORCE) + set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE INTERNAL "" FORCE) + set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS} + CACHE INTERNAL "" FORCE) + set(PYTHON_VERSION ${Python3_VERSION} CACHE INTERNAL "" FORCE) + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE INTERNAL "" FORCE) + set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE INTERNAL "" FORCE) + set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE INTERNAL "" FORCE) else() - find_package(Python3 COMPONENTS Interpreter Development NumPy) - - if(Python3_Interpreter_FOUND AND Python3_Development_FOUND) - # Use Python 3 tools - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "" FORCE) - set(PYTHON_TEST_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "") - set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE INTERNAL "" FORCE) - set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE INTERNAL "" FORCE) - set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS} - CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION ${Python3_VERSION} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE INTERNAL "" FORCE) - else() - message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.") - endif() + message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.") endif() endfunction(imp_find_python) diff --git a/doc/Installation.md b/doc/Installation.md index 004e4469..ad29e475 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -33,7 +33,7 @@ IMP: Download an IMP binary (which includes RMF) from the In order to build from source, you will need: -- [CMake](https://cmake.org) (2.8.12 or later; 3.14 or later is recommended) +- [CMake](https://cmake.org) (3.14 or later) - [Boost](https://www.boost.org) (1.53 or later; Boost.Iostreams must be built with its [zlib filter enabled](https://www.boost.org/doc/libs/1_67_0/libs/iostreams/doc/installation.html)) - [Python](https://www.python.org) (2.7 or later, or any version of Python 3) From 58637b4811272ba8aa401ba2cab8b6d4a464ccca Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 14 Nov 2024 11:59:04 -0800 Subject: [PATCH 23/28] We now require Python 3 --- doc/Installation.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/Installation.md b/doc/Installation.md index ad29e475..6a096471 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -36,9 +36,8 @@ In order to build from source, you will need: - [CMake](https://cmake.org) (3.14 or later) - [Boost](https://www.boost.org) (1.53 or later; Boost.Iostreams must be built with its [zlib filter enabled](https://www.boost.org/doc/libs/1_67_0/libs/iostreams/doc/installation.html)) -- [Python](https://www.python.org) (2.7 or later, or any version of Python 3) -- [SWIG](http://www.swig.org) (1.3.40 or later; 2.0.4 or later is needed - if you want to use Python 3) +- [Python](https://www.python.org) (3.6 or later) +- [SWIG](http://www.swig.org) (2.0.4 or later) If you want to be able to read older format RMF files, you will also need: From ffd3ff3704b335c5ff9851ed4c81a1f69b5b2887 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 14 Nov 2024 11:59:27 -0800 Subject: [PATCH 24/28] Any newer version of HDF5 should work --- doc/Installation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/Installation.md b/doc/Installation.md index 6a096471..53db5c0f 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -41,8 +41,7 @@ In order to build from source, you will need: If you want to be able to read older format RMF files, you will also need: -- [HDF5](https://www.hdfgroup.org/solutions/hdf5/) (1.8 or later; 1.10 or 1.12 - should also work) +- [HDF5](https://www.hdfgroup.org/solutions/hdf5/) (1.8 or later) ## Download {#installation_download} From 312f78eb95285e4ec8662b98098798b9c013b8ac Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 14 Nov 2024 12:00:19 -0800 Subject: [PATCH 25/28] Don't force-set Python cache variables Allow the user to override Python paths from the command line. --- cmake_modules/IMPFindPython.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake_modules/IMPFindPython.cmake b/cmake_modules/IMPFindPython.cmake index 4244c2a7..b1ed3b50 100644 --- a/cmake_modules/IMPFindPython.cmake +++ b/cmake_modules/IMPFindPython.cmake @@ -4,18 +4,18 @@ function(imp_find_python) if(Python3_Interpreter_FOUND AND Python3_Development_FOUND) # Use Python 3 tools - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE INTERNAL "" FORCE) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "") set(PYTHON_TEST_EXECUTABLE ${Python3_EXECUTABLE} CACHE STRING "") - set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE INTERNAL "" FORCE) - set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE INTERNAL "" FORCE) - set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE INTERNAL "" FORCE) + set(PYTHON_LIBRARIES ${Python3_LIBRARIES} CACHE STRING "") + set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} CACHE STRING "") + set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} CACHE STRING "") + set(PYTHON_NUMPY_FOUND ${Python3_NumPy_FOUND} CACHE STRING "") set(PYTHON_NUMPY_INCLUDE_DIR ${Python3_NumPy_INCLUDE_DIRS} - CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION ${Python3_VERSION} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE INTERNAL "" FORCE) - set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE INTERNAL "" FORCE) + CACHE STRING "") + set(PYTHON_VERSION ${Python3_VERSION} CACHE STRING "") + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR} CACHE STRING "") + set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR} CACHE STRING "") + set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH} CACHE STRING "") else() message(FATAL_ERROR "Could not find a Python interpreter and matching headers/libraries. Python is required to build.") endif() From 169bb4f54f38ba67caebdddebb9e56d24a0f645f Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 3 Dec 2024 20:47:17 -0800 Subject: [PATCH 26/28] Allow specifying mmCIF asym ID for a chain --- doc/DecoratorsAndAttributes.md | 1 + test/test_chain.py | 3 +++ tools/build/make_decorators.py | 1 + 3 files changed, 5 insertions(+) diff --git a/doc/DecoratorsAndAttributes.md b/doc/DecoratorsAndAttributes.md index 89717f59..e455fa15 100644 --- a/doc/DecoratorsAndAttributes.md +++ b/doc/DecoratorsAndAttributes.md @@ -73,6 +73,7 @@ The category name is `sequence` and it includes information about the types and | `sequence` | string | Primary sequence of a chain | | `sequence offset`| int | Offset from sequence index to residue index | | `chain type` | string | Type of chain sequence (e.g. Protein, DNA, RNA) | +| `label asym id` | string | mmCIF asym ID for a chain | | `uniprot accession`| string | UniProt accession code for the sequence | | `first residue index` | int | The index of the first residue (in a domain) | | `last residue index` | int | The index of the last residue (in a domain) | diff --git a/test/test_chain.py b/test/test_chain.py index 6a997ddf..807e15ba 100644 --- a/test/test_chain.py +++ b/test/test_chain.py @@ -20,12 +20,14 @@ def test_chain(self): self.assertEqual(c.get_sequence(), '') self.assertEqual(c.get_sequence_offset(), 0) self.assertEqual(c.get_uniprot_accession(), '') + self.assertEqual(c.get_label_asym_id(), '') # Check setters c.set_chain_type('LPolypeptide') c.set_sequence('CGY') c.set_sequence_offset(10) c.set_uniprot_accession('Q13098') c.set_chain_id('X') + c.set_label_asym_id('AA') # Check both const and non-const getters self.check_rmf(cf, c0, c1) @@ -40,6 +42,7 @@ def check_rmf(self, cf, c0, c1): self.assertEqual(c.get_sequence_offset(), 10) self.assertEqual(c.get_uniprot_accession(), 'Q13098') self.assertEqual(c.get_chain_id(), 'X') + self.assertEqual(c.get_label_asym_id(), 'AA') if __name__ == '__main__': unittest.main() diff --git a/tools/build/make_decorators.py b/tools/build/make_decorators.py index d803003b..01383f3a 100755 --- a/tools/build/make_decorators.py +++ b/tools/build/make_decorators.py @@ -179,6 +179,7 @@ Attribute("sequence", "String", default=""), Attribute("sequence offset", "Int", default=0), Attribute("uniprot accession", "String", default=""), + Attribute("label asym id", "String", default=""), Attribute("chain type", "String", default='UnknownChainType')]) From 4b19b06b16596585e85e4efcf2c70b9531546b98 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 3 Dec 2024 21:02:42 -0800 Subject: [PATCH 27/28] We now require a newer CMake --- tools/RMF.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/RMF.spec b/tools/RMF.spec index 82798b05..1006c788 100644 --- a/tools/RMF.spec +++ b/tools/RMF.spec @@ -10,7 +10,7 @@ Source0: rmf-%{version}.tar.gz BuildRequires: python3-devel, symlinks BuildRequires: gcc-c++, hdf5-devel >= 1.8 BuildRequires: swig >= 3.0 -BuildRequires: cmake >= 2.8 +BuildRequires: cmake >= 3.14 BuildRequires: boost-devel >= 1.53 BuildRequires: python3-numpy From 3482beccf1c2e48d655b798a33b767d01a94bcfb Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 3 Dec 2024 21:07:57 -0800 Subject: [PATCH 28/28] Prepare for 1.7.0 release --- CMakeLists.txt | 4 ++-- ChangeLog.md | 6 ++++++ tools/RMF.spec | 5 ++++- tools/debian/changelog | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a8e9c5a..c2a05fef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,8 +145,8 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) # Version information set (RMF_VERSION_MAJOR 1) -set (RMF_VERSION_MINOR 6) -set (RMF_VERSION_MICRO 1) +set (RMF_VERSION_MINOR 7) +set (RMF_VERSION_MICRO 0) math (EXPR RMF_VERSION "${RMF_VERSION_MAJOR} * 100000 + ${RMF_VERSION_MINOR} * 100 + ${RMF_VERSION_MICRO}") set(RMF_SOVERSION "${RMF_VERSION_MAJOR}.${RMF_VERSION_MINOR}" CACHE INTERNAL "" FORCE) diff --git a/ChangeLog.md b/ChangeLog.md index aeb3f063..7675efa5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,12 @@ Change Log {#changelog} ========== +# 1.7.0 - 2024-12-04 # {#changelog_1_7_0} +- Python 2 is no longer supported; the minimum supported Python version is 3.6. +- CMake 2 is no longer supported; the minimum supported CMake version is 3.14. +- RMF::decorator::Chain can now store the mmCIF asym ID, which need not be + the same as the (author-provided) chain ID. + # 1.6.1 - 2024-05-13 # {#changelog_1_6_1} - .deb packages for RMF for Ubuntu are now provided via the [Ubuntu PPA](https://launchpad.net/~salilab/+archive/ubuntu/ppa) mechanism. diff --git a/tools/RMF.spec b/tools/RMF.spec index 1006c788..913855bd 100644 --- a/tools/RMF.spec +++ b/tools/RMF.spec @@ -1,5 +1,5 @@ Name: RMF -Version: 1.6.1 +Version: 1.7.0 Release: 1%{?dist} License: Apache 2.0 Summary: Library to support reading and writing of RMF files @@ -83,6 +83,9 @@ python3 -c "import RMF; assert(hasattr(RMF, 'get_all_global_coordinates'))" %{_libdir}/libRMF*.so %changelog +* Wed Dec 04 2024 Ben Webb 1.7.0-1 +- Update for 1.7.0 release. + * Mon May 13 2024 Ben Webb 1.6.1-1 - Update for 1.6.1 release. diff --git a/tools/debian/changelog b/tools/debian/changelog index 25ea3634..50703dec 100644 --- a/tools/debian/changelog +++ b/tools/debian/changelog @@ -1,3 +1,9 @@ +rmf (1.7.0-1~@CODENAME@) @CODENAME@; urgency=low + + * RMF 1.7.0 release + + -- IMP Developers Wed, 04 Dec 2024 10:04:14 -0800 + rmf (1.6.1-1~@CODENAME@) @CODENAME@; urgency=low * RMF 1.6.1 release