miniupnp/.github/actions/activate-venv/test_check_activated.py
Kyle Altendorf f9b2857dce
build miniupnpc wheels in ci (#640)
* add miniupnpc_wheels_yml

* cp --recursive --verbose cloned/miniupnpc source

* --dereference

* reduce legibility to -RLv for macOS

* try qemu for linux aarch64

* use macos-latest for macOS ARM64 and cross build

* only setup qemu for linux

* skip install test for macos arm64 since we are cross building

* force all CIBW_ARCHS

* skip install test for all arm since we are cross building

* copy in actions

* setup for windows exclusion before merge

* add 3.12

* update from upstream

* macos arm runners, supposedly

* checkout before local actions

* cloned/

* _MACOS

* multiple cibuildwheel pins

* more cloned/

* exclude macos arm 3.7-3.9 due to python unavailability from github actions

* yup

* actions/setup-python@v5

* update pip

* maybe actually use qemu for linux arm

* oops

* more explicit in docker

* -m

* hmm

* aarch64

* aarch64 _and_ arm64

* ...

* try calling out os/arch labels for the runner

* Revert "try calling out os/arch labels for the runner"

This reverts commit 51f1f43e6b11b83433eb297a1ba0a15ef9e06702.

* add copyright and license notices

* exclude windows, cleanup
2024-03-13 01:09:47 +01:00

41 lines
1.2 KiB
Python

# Copyright 2024 Chia Network Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import pathlib
import sys
reference = pathlib.Path(os.environ["REFERENCE_PATH"]).absolute()
actual = pathlib.Path(sys.executable)
expected_inside = {"true": True, "false": False}[os.environ["EXPECTED_INSIDE"]]
is_inside: bool
try:
actual.relative_to(reference)
except ValueError:
is_inside = False
else:
is_inside = True
correct = expected_inside == is_inside
print(f" reference: {reference}")
print(f" actual: {actual}")
print(f"expected_inside: {expected_inside}")
print(f" is_inside: {is_inside}")
print(f" correct: {'yes' if correct else 'no'}")
if not correct:
sys.exit(1)