Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise metadata error on bad pkg, rather than build-system-notfound #918

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/rez/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@

def get_current_developer_package():
from rez.packages import get_developer_package
from rez.exceptions import PackageMetadataError

global _package

if _package is None:
try:
_package = get_developer_package(os.getcwd())
except PackageMetadataError:
# no package, or bad package
pass
_package = get_developer_package(os.getcwd())

return _package

Expand All @@ -33,14 +28,19 @@ def setup_parser_common(parser):
"""Parser setup common to both rez-build and rez-release."""
from rez.build_process import get_build_process_types
from rez.build_system import get_valid_build_systems
from rez.exceptions import PackageMetadataError

process_types = get_build_process_types()
parser.add_argument(
"--process", type=str, choices=process_types, default="local",
help="the build process to use (default: %(default)s).")

# add build system choices valid for this package
package = get_current_developer_package()
try:
package = get_current_developer_package()
except PackageMetadataError:
package = None # no package, or bad package

clss = get_valid_build_systems(os.getcwd(), package=package)

if clss:
Expand Down