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

Perform python version check earlier #269

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cheribuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
module_dir = Path(__file__).resolve().parent
sys.path.append(str(module_dir))
# noinspection PyPep8
import pycheribuild.check_version # noqa
from pycheribuild.__main__ import main # "__main__" case # noqa: E402

main()
1 change: 1 addition & 0 deletions combine-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def check_all_files_used(directory: Path):


# append all the individual files in the right order
add_filtered_file(script_dir / "check_version.py")
add_filtered_file(script_dir / "colour.py")
add_filtered_file(script_dir / "utils.py")
add_filtered_file(script_dir / "mtree.py")
Expand Down
1 change: 1 addition & 0 deletions jenkins-cheri-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
if __name__ == "__main__":
module_dir = Path(__file__).resolve().parent
sys.path.append(str(module_dir))
import pycheribuild.check_version # noqa: E402
import pycheribuild.jenkins
pycheribuild.jenkins.jenkins_main()
32 changes: 32 additions & 0 deletions pycheribuild/check_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2022 Lawrence Esswood
#
# This work was supported by Innovate UK project 105694, "Digital Security
# by Design (DSbD) Technology Platform Prototype".
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

import sys

if sys.version_info < (3, 6, 0):
sys.exit("This script requires at least Python 3.6.0")
1 change: 1 addition & 0 deletions release-scripts/create_morello_release_tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
module_dir = Path(__file__).resolve().parent.parent
sys.path.append(str(module_dir))
# noinspection PyProtectedMember
import pycheribuild.check_version # noqa
from pycheribuild.utils import default_make_jobs_count, GlobalConfig, warning_message # noqa: E402
from pycheribuild.processutils import run_command # noqa: E402

Expand Down
1 change: 1 addition & 0 deletions tests/test_metalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pathlib import Path

sys.path.append(str(Path(__file__).parent.parent))
import pycheribuild.check_version # noqa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need this for the tests, but adding it to the main entry point seems reasonable.

from pycheribuild.mtree import MtreeFile # noqa: E402

HAVE_LCHMOD = True
Expand Down