From a04dc0fed60370399ca38ebbdc28b49d2441be46 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 12:36:57 -0500 Subject: [PATCH 1/8] Convert all plugin rezconfig to rezconfig.py Signed-off-by: brycegbrazen --- .../build_process/{rezconfig => rezconfig.py} | 0 src/rezplugins/build_system/rezconfig | 21 ----- .../{rezconfig => rezconfig.py} | 20 ++--- .../release_hook/{rezconfig => rezconfig.py} | 87 ++++++++++--------- .../release_vcs/{rezconfig => rezconfig.py} | 5 +- src/rezplugins/shell/rezconfig | 40 --------- src/rezplugins/shell/rezconfig.py | 41 +++++++++ 7 files changed, 98 insertions(+), 116 deletions(-) rename src/rezplugins/build_process/{rezconfig => rezconfig.py} (100%) delete mode 100644 src/rezplugins/build_system/rezconfig rename src/rezplugins/package_repository/{rezconfig => rezconfig.py} (79%) rename src/rezplugins/release_hook/{rezconfig => rezconfig.py} (70%) rename src/rezplugins/release_vcs/{rezconfig => rezconfig.py} (64%) delete mode 100644 src/rezplugins/shell/rezconfig create mode 100644 src/rezplugins/shell/rezconfig.py diff --git a/src/rezplugins/build_process/rezconfig b/src/rezplugins/build_process/rezconfig.py similarity index 100% rename from src/rezplugins/build_process/rezconfig rename to src/rezplugins/build_process/rezconfig.py diff --git a/src/rezplugins/build_system/rezconfig b/src/rezplugins/build_system/rezconfig deleted file mode 100644 index 18ddea371..000000000 --- a/src/rezplugins/build_system/rezconfig +++ /dev/null @@ -1,21 +0,0 @@ -# TODO remove this file in PR for https://github.com/AcademySoftwareFoundation/rez/issues/525, -# it is unused - -cmake: - # The name of the CMake build system to use, valid options are - # eclipse, make, xcode and codeblocks. - build_system: make - - # The name of the CMake build target to use, valid options are Debug, - # Release and RelWithDebInfo. - build_target: Release - - # A list of default arguments to be passed to the cmake binary. - cmake_args: - - '-DCMAKE_SKIP_RPATH=1' - - # Optionally specify an explicit cmake executable to use for building. - cmake_binary: - - # If True, install pyc files when the 'rez_install_python' macro is used. - install_pyc: true diff --git a/src/rezplugins/package_repository/rezconfig b/src/rezplugins/package_repository/rezconfig.py similarity index 79% rename from src/rezplugins/package_repository/rezconfig rename to src/rezplugins/package_repository/rezconfig.py index 811b8215d..f037ee92a 100644 --- a/src/rezplugins/package_repository/rezconfig +++ b/src/rezplugins/package_repository/rezconfig.py @@ -1,15 +1,9 @@ -filesystem: - # The mechanism used to create the lockfile. If set to 'default', this will - # use hardlinks if the 'os.link' method is present, otherwise mkdir is used. - # It can also be explicitly set to use only 'hardlink', or only 'mkdir'. - # Valid options are 'default', 'mkdir', or 'hardlink' - file_lock_type: default - +filesystem = { # The timeout to use when creating file locks. This is done when a variant is # installed into an existing package, to prevent multiple file writes at # once (which could result in a variant install getting lost). The timeout # value is in seconds. A value of zero indicates no timeout. - file_lock_timeout: 10 + "file_lock_timeout": 10, # The relative directory, under the repository location, where file locks # are created. You might need to use this option when file permissions are @@ -21,13 +15,13 @@ # # Note: The directory can have any name, but we suggest '.lock' as the # standard convention. - file_lock_dir: + "file_lock_dir": None, # If True, verify that a potential package directory contains a package.py / # package.yaml file before treating it as a package. There *shouldn't* be # non-packages in these directories, and the solver is faster if this value # is False, because a lot of file stats are avoided. - check_package_definition_files: false + "check_package_definition_files": False, # A list of filenames that are expected to contain Rez definitions. # The list will be checked in top to bottom order, and the first filename @@ -39,5 +33,7 @@ # released package filename, regardless of the definition filename present # in the source. # - package_filenames: - - 'package' + "package_filenames": [ + "package" + ] +} \ No newline at end of file diff --git a/src/rezplugins/release_hook/rezconfig b/src/rezplugins/release_hook/rezconfig.py similarity index 70% rename from src/rezplugins/release_hook/rezconfig rename to src/rezplugins/release_hook/rezconfig.py index 1dd9ce24d..fccdead21 100644 --- a/src/rezplugins/release_hook/rezconfig +++ b/src/rezplugins/release_hook/rezconfig.py @@ -1,18 +1,22 @@ -emailer: + +emailer = { # SMTP host. - smtp_host: '' + "smtp_host": '', # SMTP port. - smtp_port: 25 + "smtp_port": 25, # The address that post-release emails appear to come from. - sender: '{system.user}@rez-release.com' + "sender": '{system.user}@rez-release.com', # List of recipients of post-release emails; OR, path to recipients config # file (see emailer-recipients-example.yaml). If this is a string that # contains '@' and doesn't refer to a filepath, then it's treated as an # email address. - recipients: [] + "recipients": [], + + # Subject format - supports the same object formatting available in 'body' + "subject": '[rez] [release] {system.user} released {package.qualified_name}', # Message format. Available objects for formatting are: # - package: The package that is being released. @@ -25,43 +29,43 @@ # - variants: Namespace for info about the variants that were released: # - count: The number of variants that were released; # - paths: Newline-separated paths to the root of each variant. - body: | - Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. + "body": \ +""" +Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. - USER: {system.user} - PACKAGE: {package.qualified_name} - RELEASED TO: {release.path} - PREVIOUS VERSION: {release.previous_version} - REZ VERSION: {system.rez_version} +USER: {system.user} +PACKAGE: {package.qualified_name} +RELEASED TO: {release.path} +PREVIOUS VERSION: {release.previous_version} +REZ VERSION: {system.rez_version} - {variants.count} VARIANTS: - {variants.paths} +{variants.count} VARIANTS: +{variants.paths} - MESSAGE: - {release.message} +MESSAGE: +{release.message} - CHANGELOG: - {release.changelog} - - # Subject format - supports the same object formatting available in 'body' - subject: '[rez] [release] {system.user} released {package.qualified_name}' +CHANGELOG: +{release.changelog} +""".strip() +} -command: +command = { # If true, print the commands that are being run - print_commands: true + "print_commands": True, # If true, print output of commands. - print_output: true + "print_output": True, # If true, print failed commands to stderr - print_error: true + "print_error": True, # If true, cancel the package release if a pre-* command fails. - cancel_on_error: true + "cancel_on_error": True, # If true, skip all commands after a failed command. This does not cancel # the package release. - stop_on_error: true + "stop_on_error": True, # List of commands to execute prior to build, in given order. # Each item is a dict containing: @@ -82,8 +86,7 @@ # - release: Namespace for info about the current release, contains: # - path: Installation path of release. # - # Also, any environment variables references in command arguments are - # expanded also. + # Any environment variables references in command arguments are expanded. # # Example: # pre_build_commands @@ -91,35 +94,37 @@ # args: '-a -l' # user: root # - pre_build_commands: [] + "pre_build_commands": [], # Same expected values as pre_build_commands - pre_release_commands: [] + "pre_release_commands": [], # Same expected values as pre_build_commands - post_release_commands: [] + "post_release_commands": [] +} -amqp: +amqp = { # host server, or '{host}:{port}' - host: '' + "host": '', # userid - userid: '' + "userid": '', # password - password: '' + "password": '', # connection timeout - connect_timeout: 10 + "connect_timeout": 10, # exchange name - exchange_name: '' + "exchange_name": '', # exchange routing key - exchange_routing_key: 'REZ.PACKAGE.RELEASED' + "exchange_routing_key": 'REZ.PACKAGE.RELEASED', # message delivery mode - message_delivery_mode: 1 + "message_delivery_mode": 1, # extra message attributes to be published - message_attributes: {} + "message_attributes": {} +} \ No newline at end of file diff --git a/src/rezplugins/release_vcs/rezconfig b/src/rezplugins/release_vcs/rezconfig.py similarity index 64% rename from src/rezplugins/release_vcs/rezconfig rename to src/rezplugins/release_vcs/rezconfig.py index a0a963d90..e82ec164e 100644 --- a/src/rezplugins/release_vcs/rezconfig +++ b/src/rezplugins/release_vcs/rezconfig.py @@ -1,3 +1,4 @@ -git: +git = { # If false, cancel a package release if there is no upstream branch. - allow_no_upstream: false + "allow_no_upstream": False +} \ No newline at end of file diff --git a/src/rezplugins/shell/rezconfig b/src/rezplugins/shell/rezconfig deleted file mode 100644 index 392a8b655..000000000 --- a/src/rezplugins/shell/rezconfig +++ /dev/null @@ -1,40 +0,0 @@ -sh: - prompt: '>' - executable_fullpath: null - -bash: - prompt: '>' - executable_fullpath: null - -csh: - prompt: '>' - executable_fullpath: null - -tcsh: - prompt: '>' - executable_fullpath: null - -zsh: - prompt: '%' - executable_fullpath: null - -cmd: - prompt: '$G' - additional_pathext: ['.PY'] - executable_fullpath: null - -powershell: - prompt: '> $ ' - additional_pathext: ['.PY'] - executable_fullpath: null - execution_policy: null - -pwsh: - prompt: '> $ ' - additional_pathext: ['.PY'] - executable_fullpath: null - execution_policy: null - -gitbash: - prompt: '>' - executable_fullpath: null diff --git a/src/rezplugins/shell/rezconfig.py b/src/rezplugins/shell/rezconfig.py new file mode 100644 index 000000000..bf03e0312 --- /dev/null +++ b/src/rezplugins/shell/rezconfig.py @@ -0,0 +1,41 @@ +sh = { + "prompt": '>', + "executable_fullpath": None +} +bash = { + "prompt": '>', + "executable_fullpath": None +} +csh = { + "prompt": '>', + "executable_fullpath": None +} +tcsh = { + "prompt": '>', + "executable_fullpath": None +} +zsh = { + "prompt": '%', + "executable_fullpath": None +} +cmd = { + "prompt": '$G', + "additional_pathext": [".PY"], + "executable_fullpath": None +} +powershell = { + "prompt": '> $ ', + "additional_pathext": [".PY"], + "executable_fullpath": None, + "execution_policy": None +} +pwsh = { + "prompt": '> $ ', + "additional_pathext": [".PY"], + "executable_fullpath": None, + "execution_policy": None +} +gitbash = { + "prompt": '>', + "executable_fullpath": None +} \ No newline at end of file From c866f5e3394a1fa5799668a3d4734378cc9f1c3a Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 12:40:25 -0500 Subject: [PATCH 2/8] Readd package_repository setting lost via copy paste Signed-off-by: brycegbrazen --- src/rezplugins/package_repository/rezconfig.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rezplugins/package_repository/rezconfig.py b/src/rezplugins/package_repository/rezconfig.py index f037ee92a..4dba835fb 100644 --- a/src/rezplugins/package_repository/rezconfig.py +++ b/src/rezplugins/package_repository/rezconfig.py @@ -1,4 +1,10 @@ filesystem = { + # The mechanism used to create the lockfile. If set to 'default', this will + # use hardlinks if the 'os.link' method is present, otherwise mkdir is used. + # It can also be explicitly set to use only 'hardlink', or only 'mkdir'. + # Valid options are 'default', 'mkdir', or 'hardlink' + "file_lock_type": "default", + # The timeout to use when creating file locks. This is done when a variant is # installed into an existing package, to prevent multiple file writes at # once (which could result in a variant install getting lost). The timeout From 0fb5f63262cfb8d4e43ebb567d753c7a3c1b1437 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 14:16:19 -0500 Subject: [PATCH 3/8] Address linting notes Signed-off-by: brycegbrazen --- .../package_repository/rezconfig.py | 2 +- src/rezplugins/release_hook/rezconfig.py | 38 +++++++++---------- src/rezplugins/release_vcs/rezconfig.py | 2 +- src/rezplugins/shell/rezconfig.py | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/rezplugins/package_repository/rezconfig.py b/src/rezplugins/package_repository/rezconfig.py index 4dba835fb..c940641f0 100644 --- a/src/rezplugins/package_repository/rezconfig.py +++ b/src/rezplugins/package_repository/rezconfig.py @@ -42,4 +42,4 @@ "package_filenames": [ "package" ] -} \ No newline at end of file +} diff --git a/src/rezplugins/release_hook/rezconfig.py b/src/rezplugins/release_hook/rezconfig.py index fccdead21..8a5c8e121 100644 --- a/src/rezplugins/release_hook/rezconfig.py +++ b/src/rezplugins/release_hook/rezconfig.py @@ -30,24 +30,24 @@ # - count: The number of variants that were released; # - paths: Newline-separated paths to the root of each variant. "body": \ -""" -Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. - -USER: {system.user} -PACKAGE: {package.qualified_name} -RELEASED TO: {release.path} -PREVIOUS VERSION: {release.previous_version} -REZ VERSION: {system.rez_version} - -{variants.count} VARIANTS: -{variants.paths} - -MESSAGE: -{release.message} - -CHANGELOG: -{release.changelog} -""".strip() + """ + Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. + + USER: {system.user} + PACKAGE: {package.qualified_name} + RELEASED TO: {release.path} + PREVIOUS VERSION: {release.previous_version} + REZ VERSION: {system.rez_version} + + {variants.count} VARIANTS: + {variants.paths} + + MESSAGE: + {release.message} + + CHANGELOG: + {release.changelog} + """.strip() } command = { @@ -127,4 +127,4 @@ # extra message attributes to be published "message_attributes": {} -} \ No newline at end of file +} diff --git a/src/rezplugins/release_vcs/rezconfig.py b/src/rezplugins/release_vcs/rezconfig.py index e82ec164e..b57c38eee 100644 --- a/src/rezplugins/release_vcs/rezconfig.py +++ b/src/rezplugins/release_vcs/rezconfig.py @@ -1,4 +1,4 @@ git = { # If false, cancel a package release if there is no upstream branch. "allow_no_upstream": False -} \ No newline at end of file +} diff --git a/src/rezplugins/shell/rezconfig.py b/src/rezplugins/shell/rezconfig.py index bf03e0312..b761a828d 100644 --- a/src/rezplugins/shell/rezconfig.py +++ b/src/rezplugins/shell/rezconfig.py @@ -38,4 +38,4 @@ gitbash = { "prompt": '>', "executable_fullpath": None -} \ No newline at end of file +} From af0f3598715c295f031ffa4c39df381a4ab90fac Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 14:18:02 -0500 Subject: [PATCH 4/8] More lint Signed-off-by: brycegbrazen --- src/rezplugins/release_hook/rezconfig.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rezplugins/release_hook/rezconfig.py b/src/rezplugins/release_hook/rezconfig.py index 8a5c8e121..b5087803b 100644 --- a/src/rezplugins/release_hook/rezconfig.py +++ b/src/rezplugins/release_hook/rezconfig.py @@ -32,19 +32,19 @@ "body": \ """ Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. - + USER: {system.user} PACKAGE: {package.qualified_name} RELEASED TO: {release.path} PREVIOUS VERSION: {release.previous_version} REZ VERSION: {system.rez_version} - + {variants.count} VARIANTS: {variants.paths} - + MESSAGE: {release.message} - + CHANGELOG: {release.changelog} """.strip() From aeb82ce6b38efc61a114fcde29e63461dfdeb561 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 14:22:02 -0500 Subject: [PATCH 5/8] Fix apply_copyright to no longer reference deleted backport folder Signed-off-by: brycegbrazen --- src/build_utils/license/apply_copyright | 1 - 1 file changed, 1 deletion(-) diff --git a/src/build_utils/license/apply_copyright b/src/build_utils/license/apply_copyright index 880cfa583..daa048eb9 100755 --- a/src/build_utils/license/apply_copyright +++ b/src/build_utils/license/apply_copyright @@ -7,7 +7,6 @@ fi # remove copyright find ./src/rez/data -name '*.py' > .lic.tmp -find ./src/rez/backport -name '*.py' >> .lic.tmp cat .lic.tmp | xargs -i ./src/build_utils/license/change_copyright -so {} # add copyright From f8df2e65adc83a2660b41f2737ff2c30bab9d3b2 Mon Sep 17 00:00:00 2001 From: brycegbrazen Date: Tue, 19 Mar 2024 14:25:50 -0500 Subject: [PATCH 6/8] Apply copyright notices Signed-off-by: brycegbrazen --- src/rezplugins/build_process/rezconfig.py | 2 ++ src/rezplugins/package_repository/rezconfig.py | 4 ++++ src/rezplugins/release_hook/rezconfig.py | 3 +++ src/rezplugins/release_vcs/rezconfig.py | 4 ++++ src/rezplugins/shell/rezconfig.py | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/src/rezplugins/build_process/rezconfig.py b/src/rezplugins/build_process/rezconfig.py index e69de29bb..ac31011e1 100644 --- a/src/rezplugins/build_process/rezconfig.py +++ b/src/rezplugins/build_process/rezconfig.py @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Rez Project diff --git a/src/rezplugins/package_repository/rezconfig.py b/src/rezplugins/package_repository/rezconfig.py index c940641f0..85eba726c 100644 --- a/src/rezplugins/package_repository/rezconfig.py +++ b/src/rezplugins/package_repository/rezconfig.py @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Rez Project + + filesystem = { # The mechanism used to create the lockfile. If set to 'default', this will # use hardlinks if the 'os.link' method is present, otherwise mkdir is used. diff --git a/src/rezplugins/release_hook/rezconfig.py b/src/rezplugins/release_hook/rezconfig.py index b5087803b..f029a188d 100644 --- a/src/rezplugins/release_hook/rezconfig.py +++ b/src/rezplugins/release_hook/rezconfig.py @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Rez Project + emailer = { # SMTP host. diff --git a/src/rezplugins/release_vcs/rezconfig.py b/src/rezplugins/release_vcs/rezconfig.py index b57c38eee..411fe38a8 100644 --- a/src/rezplugins/release_vcs/rezconfig.py +++ b/src/rezplugins/release_vcs/rezconfig.py @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Rez Project + + git = { # If false, cancel a package release if there is no upstream branch. "allow_no_upstream": False diff --git a/src/rezplugins/shell/rezconfig.py b/src/rezplugins/shell/rezconfig.py index b761a828d..549cc6605 100644 --- a/src/rezplugins/shell/rezconfig.py +++ b/src/rezplugins/shell/rezconfig.py @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Rez Project + + sh = { "prompt": '>', "executable_fullpath": None From 03faef9cb4bb1de3e650b672eb09766168cd8590 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 13 Apr 2024 14:37:48 -0400 Subject: [PATCH 7/8] Fix indentation lost in translation Signed-off-by: Jean-Christophe Morin --- src/rezplugins/release_hook/rezconfig.py | 29 ++++++++++++------------ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/rezplugins/release_hook/rezconfig.py b/src/rezplugins/release_hook/rezconfig.py index f029a188d..acec27c73 100644 --- a/src/rezplugins/release_hook/rezconfig.py +++ b/src/rezplugins/release_hook/rezconfig.py @@ -32,25 +32,24 @@ # - variants: Namespace for info about the variants that were released: # - count: The number of variants that were released; # - paths: Newline-separated paths to the root of each variant. - "body": \ - """ - Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. + "body": """ +Package '{package.qualified_name}' was released by {system.user}@{system.fqdn}. - USER: {system.user} - PACKAGE: {package.qualified_name} - RELEASED TO: {release.path} - PREVIOUS VERSION: {release.previous_version} - REZ VERSION: {system.rez_version} +USER: {system.user} +PACKAGE: {package.qualified_name} +RELEASED TO: {release.path} +PREVIOUS VERSION: {release.previous_version} +REZ VERSION: {system.rez_version} - {variants.count} VARIANTS: - {variants.paths} +{variants.count} VARIANTS: +{variants.paths} - MESSAGE: - {release.message} +MESSAGE: +{release.message} - CHANGELOG: - {release.changelog} - """.strip() +CHANGELOG: +{release.changelog} +""".strip() } command = { From 00a18a8c8c7f6f764e537bcfcac07933b158be6e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 13 Apr 2024 14:38:42 -0400 Subject: [PATCH 8/8] Remove references to rezconfig files Signed-off-by: Jean-Christophe Morin --- MANIFEST.in | 3 +-- setup.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index c646b6968..26b821f83 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,7 @@ include src/rez/data/* -include src/rez/rezconfig include src/rez/completion/* include src/rez/vendor/distlib/*.exe include src/rezgui/rezguiconfig include src/rezgui/icons/* recursive-include src/rez README* -recursive-include src/rezplugins *.cmake Doxyfile rezconfig +recursive-include src/rezplugins *.cmake Doxyfile diff --git a/setup.py b/setup.py index 34b9b396d..ad11b1edb 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,6 @@ def find_files(pattern, path=None, root="rez"): find_files('*', 'data') + find_files('*.exe', 'vendor/distlib'), 'rezplugins': - find_files('rezconfig', root='rezplugins') + find_files('*.cmake', 'build_system', root='rezplugins') + find_files('*', 'build_system/template_files', root='rezplugins'), 'rezgui':