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

DM-34666: Set macOS deployment target to 11.0 on ARM systems #107

Merged
merged 4 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build_and_test

on:
push:
branches:
- main
pull_request:

jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
channels: conda-forge,defaults
channel-priority: strict
show-channel-urls: true

- name: Install conda packages used by this package
shell: bash -l {0}
run: |
conda install mamba
mamba install -y -q scons eups compilers

# We have two cores so we can speed up the testing with xdist
- name: Install pytest packages
shell: bash -l {0}
run: |
mamba install -y -q \
flake8 \
pytest pytest-flake8 pytest-xdist pytest-openfiles pytest-cov pytest-session2file

- name: List installed packages
shell: bash -l {0}
run: |
conda list
pip list -v

- name: Build and test
shell: bash -l {0}
run: |
setup -k -r .
scons -j2

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
file: tests/.tests/pytest-sconsUtils.xml-cov-sconsUtils.xml
2 changes: 1 addition & 1 deletion configs/python.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Configuration(lsst.sconsUtils.Configuration):
"""The relevant Python is not guaranteed to be the Python
that we are using to run SCons so we must shell out to the
PATH python."""
pycmd = 'import distutils.sysconfig as s; print(s.get_config_var("{}"))'.format(name)
pycmd = 'import sysconfig as s; print(s.get_config_var("{}"))'.format(name)
result = subprocess.check_output(["python", "-c", pycmd]).decode().strip()
# Be consistent with native interface
if result == "None":
Expand Down
18 changes: 17 additions & 1 deletion python/lsst/sconsUtils/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ def _initLog():
log = utils.Log()


def _get_macosx_deployment_target_default():
"""Determine the default deployment target on macOS.

Returns
-------
target : `str`
The default target for this platform. Can be returned even
if not running on macOS.
"""
uname = os.uname()
if uname.sysname == 'Darwin' and uname.machine == 'arm64':
return "11.0"
return "10.9"


def _initVariables():
files = []
if "optfile" in SCons.Script.ARGUMENTS:
Expand Down Expand Up @@ -106,7 +121,8 @@ def _initVariables():
('baseversion', 'Specify the current base version', None),
('optFiles', "Specify a list of files that SHOULD be optimized", None),
('noOptFiles', "Specify a list of files that should NOT be optimized", None),
('macosx_deployment_target', 'Deployment target for Mac OS X', '10.9'),
('macosx_deployment_target', 'Deployment target for Mac OS X',
_get_macosx_deployment_target_default()),
)


Expand Down