Skip to content

Commit cb5bec6

Browse files
author
Rafael Martins
committed
Add no readline variants
1 parent 0a624d2 commit cb5bec6

File tree

5 files changed

+50
-13
lines changed

5 files changed

+50
-13
lines changed

abs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# the conda-build parameters to use for disabling --skip-existing
2+
build_parameters:
3+
- "--suppress-variables"
4+
#- "--skip-existing"
5+
- "--error-overlinking"
6+
- "--error-overdepending"
7+
8+
aggregate_check: false
9+
10+
channels:
11+
- norl
12+
13+
upload_without_merge: true

recipe/build_base.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,14 @@ _common_configure_args+=(--with-tcltk-includes="-I${PREFIX}/include")
252252
_common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl8.6 -ltk8.6")
253253
_common_configure_args+=(--with-platlibdir=lib)
254254

255+
if [[ "${READLINE_MODE}" = readline ]]; then
256+
_common_configure_args+=(--with-readline=readline)
257+
elif [[ "${READLINE_MODE}" = editline ]]; then
258+
_common_configure_args+=(--with-readline=editline)
259+
elif [[ "${READLINE_MODE}" = none ]]; then
260+
_common_configure_args+=(--without-readline)
261+
fi
262+
255263
# Add more optimization flags for the static Python interpreter:
256264
declare -a PROFILE_TASK=()
257265
if [[ ${_OPTIMIZED} == yes ]]; then
@@ -455,7 +463,7 @@ pushd "${PREFIX}"/lib/python${VER}
455463
# Remove osx sysroot as it depends on the build machine
456464
sed -i.bak "s@-isysroot @@g" sysconfigfile
457465
# make sure $CONDA_BUILD_SYSROOT is not empty ...
458-
if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
466+
if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
459467
sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile
460468
fi
461469
# Remove unfilled config option

recipe/conda_build_config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ python:
33
python_impl:
44
- cpython
55
libffi: # [win]
6-
- 3.4 # [win]
6+
- 3.4 # [win]
77
numpy:
88
- 1.16
9+
readline_mode:
10+
- readline
11+
- editline
12+
- none
913
MACOSX_SDK_VERSION: # [osx and x86_64]
1014
- 11.0 # [osx and x86_64]

recipe/meta.yaml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% set ver2 = '.'.join(version.split('.')[0:2]) %}
55
{% set ver2nd = ''.join(version.split('.')[0:2]) %}
66
{% set ver3nd = ''.join(version.split('.')[0:3]) %}
7-
{% set build_number = "0" %}
7+
{% set build_number = 1 %}
88
{% set channel_targets = ('abc', 'def') %}
99

1010
# this makes the linter happy
@@ -37,6 +37,10 @@
3737
{% set py_interp_debug = "no" %}
3838
{% endif %}
3939

40+
{% set rl_string = "" %} # [win or readline_mode == 'readline']
41+
{% set rl_string = "el_" %} # [not win and readline_mode == 'editline']
42+
{% set rl_string = "norl_" %} # [not win and readline_mode == 'none']
43+
4044
package:
4145
name: python-split
4246
version: {{ version }}{{ dev }}
@@ -89,7 +93,8 @@ source:
8993
{% endif %}
9094

9195
build:
92-
number: {{ build_number }}
96+
number: {{ build_number + 100 }} # [win or readline_mode == 'readline']
97+
number: {{ build_number }} # [not(win or readline_mode == 'readline')]
9398

9499
requirements:
95100
build:
@@ -106,7 +111,9 @@ outputs:
106111
script: build_base.sh # [unix]
107112
script: build_base.bat # [win]
108113
build:
109-
number: {{ build_number }}
114+
number: {{ build_number + 200 }} # [win or readline_mode == 'readline']
115+
number: {{ build_number + 100 }} # [not win and readline_mode == 'editline']
116+
number: {{ build_number }} # [not win and readline_mode == 'none']
110117
activate_in_script: true
111118
# Windows has issues updating python if conda is using files itself.
112119
# Copy rather than link.
@@ -127,13 +134,13 @@ outputs:
127134
# - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux]
128135
# - lib/libpython3.dylib # [osx]
129136
# match python.org compiler standard
130-
skip: true # [win and int(float(vc)) < 14]
137+
skip: true # [win and (int(float(vc)) < 14 or readline_mode != 'none')]
131138
{% if 'conda-forge' in channel_targets %}
132139
skip_compile_pyc:
133140
- '*.py' # [build_platform != target_platform]
134141
{% endif %}
135-
string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")]
136-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")]
142+
string: {{ dev_ }}h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")]
143+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")]
137144
{% if 'conda-forge' in channel_targets %}
138145
run_exports:
139146
noarch:
@@ -144,6 +151,7 @@ outputs:
144151
script_env:
145152
- PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }}
146153
- PY_INTERP_DEBUG={{ py_interp_debug }}
154+
- READLINE_MODE={{ readline_mode }}
147155
# Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs
148156
# after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for
149157
# important env. vars.
@@ -193,7 +201,8 @@ outputs:
193201
- xz
194202
- zlib
195203
- openssl
196-
- readline # [not win]
204+
- readline {{ readline }} # [readline_mode == 'readline']
205+
- libedit # [readline_mode == 'editline']
197206
- tk
198207
- ncurses # [unix]
199208
- libffi 3.4
@@ -290,15 +299,17 @@ outputs:
290299
script: build_static.sh # [unix]
291300
script: build_static.bat # [win]
292301
build:
293-
number: {{ build_number }}
302+
number: {{ build_number + 100 }} # [win or readline_mode == 'readline']
303+
number: {{ build_number }} # [not(win or readline_mode == 'readline')]
294304
activate_in_script: true
295305
{% if 'conda-forge' in channel_targets %}
296306
ignore_run_exports:
297307
- python_abi
298-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
308+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython
299309
{% else %}
300-
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
310+
string: h{{ PKG_HASH }}_{{ rl_string }}{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}
301311
{% endif %}
312+
skip: true # [win and readline_mode != 'none']
302313
requirements:
303314
build:
304315
- {{ compiler('c') }}

recipe/run_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@
8181
import fcntl
8282
import grp
8383
import nis
84-
import readline
8584
import resource
8685
import syslog
8786
import termios
8887

88+
if os.environ["READLINE_MODE"] != 'none':
89+
import readline
8990

9091
if not (armv6l or armv7l or ppc64le or osx105):
9192
import tkinter

0 commit comments

Comments
 (0)