Skip to content

Commit 94e68ac

Browse files
authored
fix: Ensure python command (on macos) (#104)
1 parent 918ff5b commit 94e68ac

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

.circleci/test-deploy.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@ parameters:
99
cache-version:
1010
type: string
1111
default: v3
12+
13+
executors:
14+
macos:
15+
macos:
16+
xcode: 14.0.0
17+
resource_class: medium
18+
1219
jobs:
1320
pip-install-test:
14-
executor: python/default
21+
parameters:
22+
executor:
23+
type: executor
24+
default: python/default
25+
executor: << parameters.executor >>
1526
steps:
1627
- checkout
1728
- python/install-packages:
@@ -115,6 +126,10 @@ workflows:
115126
test-deploy:
116127
jobs:
117128
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
129+
- pip-install-test:
130+
name: "pip-install-macos"
131+
filters: *filters
132+
executor: macos
118133
- pip-install-test:
119134
filters: *filters
120135
- pip-install-test-args:
@@ -242,6 +257,7 @@ workflows:
242257
requires:
243258
- orb-tools/pack
244259
- pip-install-test
260+
- pip-install-macos
245261
- pip-install-test-args
246262
- pipenv-test
247263
- poetry-test

src/commands/dist.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ parameters:
66
default: "."
77
description: Path to the directory containing your python project. Not needed if 'setup.py' lives in root project dir
88
steps:
9+
- run:
10+
name: Alias Python
11+
command: <<include(scripts/alias-python.sh)>>
912
- run:
1013
name: Install wheel
1114
command: pip install wheel

src/commands/install-packages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ steps:
7373
- run:
7474
name: "Export automatic environment detection script"
7575
command: << include(scripts/export-detect-env.sh) >>
76+
- run:
77+
name: Alias Python
78+
command: <<include(scripts/alias-python.sh)>>
7679
# restore caches
7780
- when:
7881
condition:

src/scripts/alias-python.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if [ ! "${BASH_ENV_PYTHON_ALIASED}" ]; then
2+
echo 'if [ ! $(command -v python) ]; then
3+
shopt -s expand_aliases
4+
alias python=python3
5+
alias pip=pip3
6+
fi
7+
8+
BASH_ENV_PYTHON_ALIASED=true' >> "$BASH_ENV"
9+
fi

src/scripts/cache-link-lockfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ ! -f "${LOCKFILE_PATH}" ]; then
2222
if [ -z "${LOCK_FILE}" ]; then
2323
echo "WARNING: Could not determine lockfile path for ${DETECT_PKG_MNGR:-PARAM_PKG_MNGR}"
2424
else
25-
FULL_LOCK_FILE=$(readlink -f -v "${LOCK_FILE}")
25+
FULL_LOCK_FILE=$(readlink -f "${LOCK_FILE}")
2626

2727
if [ -f "${LOCK_FILE}" ]; then
2828
echo "INFO: Copying ${FULL_LOCK_FILE} to ${LOCKFILE_PATH}"

0 commit comments

Comments
 (0)