Add check for whitespace issues (#3616)

* Add check for whitespace issues

* editorconfig: add directives for whitespace issues

* pyenv.bats: filter empty line from definitions stub

Drop redundant empty item from `PYTHON_BUILD_DEFINITIONS`

* Fix whitespace issues
This commit is contained in:
native-api authored and GitHub committed 2026-10-31 22:25:29 +03:00
commit 3e05a1ebf6
52 files changed
+138 -119

No files matched your search

+9
View File
@@ -4,8 +4,17 @@ root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab
indent_size = unset # Allow user-defined tab width
# Keep in sync with CHECK_WHITESPACE_EXCLUDE in Makefile.
[*.{patch,diff,md}]
trim_trailing_whitespace = false
# `false` here actually means "ensure no newline",
# while `unset` means "leave it as-is".
insert_final_newline = unset
+1 -1
View File
@@ -1 +1 @@
* @pyenv/pyenv-core-maintainers @pyenv/pyenv-core-committers
* @pyenv/pyenv-core-maintainers @pyenv/pyenv-core-committers
-1
View File
@@ -61,4 +61,3 @@ jobs:
- uses: ./.github/actions/build-python
with:
python-version: ${{ matrix.python-version }}
+16 -16
View File
@@ -24,7 +24,7 @@ jobs:
echo "versions<<$EOF" >> $GITHUB_ENV;
echo "$versions" >> $GITHUB_ENV;
echo "$EOF" >> $GITHUB_ENV;
versions_cpython_only=$(grep -Ee '^[[:digit:]]' <<<"$versions")
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64);
echo "versions_cpython_only<<$EOF" >> $GITHUB_ENV;
@@ -39,45 +39,45 @@ jobs:
import random
import re
import subprocess
import packaging.version
result=[]
def exclude_macos_intel(result, python_version):
result.append({'os':'macos-15-intel','python-version':python_version})
result.append({'os':'macos-26-intel','python-version':python_version})
result.append({'os':'macos-26-intel','python-version':python_version})
for line in os.environ['versions'].splitlines():
if m:=re.match(r'miniconda3-\d+\.\d+-(\d+\.\d+\.\d+)', line):
version = packaging.version.Version(m.group(1))
# Miniconda dropped MacOS x64 support
if version >= packaging.version.Version('25.9.1'):
exclude_macos_intel(result, line)
if m:=re.match(r'anaconda3-(\d+\.\d+)', line):
version = packaging.version.Version(m.group(1))
# Anaconda dropped MacOS x64 support
if version >= packaging.version.Version('2025.12'):
exclude_macos_intel(result, line)
if m:=re.match(r'graalpy[^-]*-(community-)?(\d+\.\d+\.\d+)', line):
version = packaging.version.Version(m.group(2))
# GraalPy dropped MacOS x64 support
if version >= packaging.version.Version('25.0.2'):
exclude_macos_intel(result, line)
EOF = str(random.getrandbits(15*8))
with open(os.environ['GITHUB_ENV'],'w') as f:
f.write(f"versions_macos_build_exclude_json<<{EOF}\n")
json.dump(result, f)
f.write(f'\n{EOF}\n')
- id: modified-versions
run: |
echo "versions=`echo "${{ env.versions }}" | jq -R . | jq -sc .`" >> $GITHUB_OUTPUT
@@ -150,7 +150,7 @@ jobs:
- run: |
pyenv global system
rm -f "$(pyenv root)"/shims/*
macos_build_bundled_dependencies:
needs: discover_modified_scripts
+8
View File
@@ -43,3 +43,11 @@ jobs:
- uses: actions/checkout@v7
- run: |
make test-docker
check_whitespace:
# Checking for missing newlines at the end of files requires git >= 2.53,
# which Ubuntu 26.04 provides.
# TODO: switch to ubuntu-latest after Nov 19 2026, when it finishes migrating to 26.04.
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- run: make check-whitespace
@@ -8,4 +8,4 @@ packages=("$@")
for package in "${packages[@]}"; do
rdepends+=($(brew uses --installed --include-build --include-test --include-optional --recursive "$package"))
done
brew uninstall "${packages[@]}" "${rdepends[@]}"
brew uninstall "${packages[@]}" "${rdepends[@]}"
+13 -1
View File
@@ -136,6 +136,18 @@ $(TEST_BATS_IMAGE_TARGETS):
./ ; \
fi
CHECK_WHITESPACE_EXCLUDE = \
':!*.patch' \
':!*.diff' \
':!*.md'
.PHONY: check-whitespace
# incomplete-line (missing final newline) requires git >= 2.53, covered by CI.
# Known limitation: only tracked files are checked, new files need to be staged first.
check-whitespace:
git -c core.whitespace=incomplete-line diff --check \
$$(git hash-object -t tree /dev/null) -- $(CHECK_WHITESPACE_EXCLUDE)
.PHONY: test test-unit test-python-build test-binary test-link
# Do not pass in user flags to build tests.
@@ -146,7 +158,7 @@ test: test-unit test-python-build test-binary test-link
test-unit: bats
PATH="./bats/bin:$$PATH" test/run
test-python-build: bats
cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+-j $$(($$(getconf _NPROCESSORS_ONLN)*2)) -F "$(PWD)/test/libexec/bats-format-tap-suite"} \
$${BATS_TEST_FILTER:+--filter "$${BATS_TEST_FILTER}"} $${BATS_ARGS} test/$${BATS_FILE_FILTER}
+1 -1
View File
@@ -1,6 +1,6 @@
$scriptblock = {
param($wordToComplete, $commandAst, $cursorPosition)
$words = $commandAst.ToString()
$words = $commandAst.ToString()
if ( $wordToComplete ) {
$matches = (($words[0..$cursorPosition] -join '') | Select-String -Pattern "\s+" -AllMatches).Matches
if ( $matches ) {
+1 -1
View File
@@ -29,7 +29,7 @@ set +f
shopt -s nullglob
{
{
if [[ -n $sh ]]; then
for path in "${paths[@]}"; do
for command in "${path}"/pyenv-sh-*; do
+3 -3
View File
@@ -58,9 +58,9 @@ done
# If shell is not provided, detect it.
if [ -z "$shell" ]; then
if shell=$(tr '\0' ' ' 2>/dev/null </proc/"$PPID"/cmdline);then
:
:
else
shell=$(ps p "$PPID" -o 'args=' 2>/dev/null || true)
shell=$(ps p "$PPID" -o 'args=' 2>/dev/null || true)
fi
shell="${shell%% *}"
shell="${shell##-}"
@@ -570,7 +570,7 @@ EOS
local command=${1:-}'
;;
esac
if [ "$shell" != "fish" ] && [ "$shell" != "pwsh" ]; then
IFS="|"
echo \
+4 -4
View File
@@ -51,7 +51,7 @@ IFS=$'\n'
else
DEFINITION_CANDIDATES=( $(pyenv-install --list --bare) )
fi
# Avoid `grep -q' to prevent SIGPIPE that would fail the check with pipefail
# Bash < 4.4 treats empty arrays as unset with -u;
# "${v[@]:-}" produces "" for an empty array which is okay
@@ -60,14 +60,14 @@ IFS=$'\n'
echo "$prefix"
exit $exitcode;
fi
suffix=
if [[ $prefix =~ ^(.*[0-9])t$ ]]; then
suffix="t"
prefix="${BASH_REMATCH[1]}"
fi
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
prefix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$prefix")"
suffix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$suffix")"
# FIXME: more reliable and readable would probably be to loop over them and transform in pure Bash
+1 -1
View File
@@ -86,7 +86,7 @@ if ( Get-Item -Path Env:\PYENV_VERSION* ) {
} else {
Write-Error "pyenv: Env:PYENV_VERSION_OLD is not set"
return \$false
}
}
EOS
;;
* )
+1 -1
View File
@@ -24,7 +24,7 @@ find_local_version_file() {
# as it's pointless and possibly very slow
# if it e.g. leads to a network search
[[ "${unc:-}" && $root == / ]] && break
if [[ -f $root/.python-version ]]; then
echo "$root/.python-version"
return 0
+1 -1
View File
@@ -6,7 +6,7 @@
#
# Displays the full path to the executable that pyenv will invoke when
# you run the given command.
# Use --nosystem argument in case when you don't need to search command in the
# Use --nosystem argument in case when you don't need to search command in the
# system environment.
# Internal switch --skip-advice used to skip printing an error message on a
# failed search.
+15 -15
View File
@@ -21,25 +21,25 @@ fi
.RS 3
.P
.nh
Appending this line enables shims. Please make sure this line is placed toward the end of the shell configuration file since it manipulates \fBPATH\fR during the initialization\.
Appending this line enables shims. Please make sure this line is placed toward the end of the shell configuration file since it manipulates \fBPATH\fR during the initialization\.
.hy
.TP 13
.B Debian note:
Modify only your \fB~/\.bashrc\fR file instead of creating
Modify only your \fB~/\.bashrc\fR file instead of creating
.br
\fB~/\.bash_profile\fR
.P
.RS 0
\fBZsh note\fR: Modify your \fB~/\.zshrc\fR file instead of \fB~/\.bashrc\fR
.P
\fBWarning\fR: If you configured your system so that \fBBASH_ENV\fR variable points to \fB\.bashrc\fR\. You should almost certainly put the above mentioned line into \fB\.bash_profile\fR, and \fBnot\fR into \fB\.bashrc\fR. Otherwise you may observe strange behaviour, such as \fBpyenv\fR getting into an infinite loop. See #264
\fBWarning\fR: If you configured your system so that \fBBASH_ENV\fR variable points to \fB\.bashrc\fR\. You should almost certainly put the above mentioned line into \fB\.bash_profile\fR, and \fBnot\fR into \fB\.bashrc\fR. Otherwise you may observe strange behaviour, such as \fBpyenv\fR getting into an infinite loop. See #264
.UR https://github\.com/pyenv/pyenv/issues/264
.UE
for details.
.RE
.RE
.IP "2." 3
\fBRestart your shell so the path changes take effect\.\fR You can now begin using pyenv\.
\fBRestart your shell so the path changes take effect\.\fR You can now begin using pyenv\.
.P
.RS 15
exec "$SHELL"\fR
@@ -48,7 +48,7 @@ exec "$SHELL"\fR
\fBInstall Python versions into \fB$(pyenv root)/versions\fR\.\fR For example, to download and install Python 3\.6\.12, run:
.P
.RS 15
.B pyenv install 3.6.12\fR
.B pyenv install 3.6.12\fR
.RE
.P
\fBNOTE:\fR If you need to pass configure option to build, please use \fBCONFIGURE_OPTS\fR environment variable. If you are having trouble installing a python version, please visit the wiki page about Common Build Problems
@@ -132,7 +132,7 @@ List all Python versions that contain the given executable
Display the full path to an executable
.PP
See `pyenv help <command>' for information on a specific command.
For full documentation, see \fBCOMMAND REFERENCE\fR section
For full documentation, see \fBCOMMAND REFERENCE\fR section
.SH OPTIONS
.TP
.B \-h, \-\-help
@@ -180,7 +180,7 @@ $(pyenv root)/shims:/usr/local/bin:/usr/bin:/bin
.fi
.IP "" 0
.P
Through a process called \fIrehashing\fR, pyenv maintains shims in that directory to match every Python command (\fBpython\fR,\fBpip\fR,etc...) across every installed version of Python
Through a process called \fIrehashing\fR, pyenv maintains shims in that directory to match every Python command (\fBpython\fR,\fBpip\fR,etc...) across every installed version of Python
.P
Shims are lightweight executables that simply pass your command along to pyenv\. So with pyenv installed, when you run, say, \fBpip\fR, your operating system will do the following:
.IP \(bu 4
@@ -208,7 +208,7 @@ hy
.SS "Locating the Python Installation"
Once pyenv has determined which version of Python your application has specified, it passes the command along to the corresponding Python installation\.
.P
Each Python version is installed into its own directory under
Each Python version is installed into its own directory under
.nf
\fB$(pyenv root)/versions\fR\.
.fi
@@ -245,7 +245,7 @@ As time goes on, you will accumulate Python versions in your \fB$(pyenv root)/ve
.P
To remove old Python versions, \fBpyenv uninstall\fR command to automate the removal process\.
.P
Alternatively, simply \fBrm \-rf\fR the directory of the version you want to remove\. You can find the directory of a particular Python version with the \fBpyenv prefix\fR command,
Alternatively, simply \fBrm \-rf\fR the directory of the version you want to remove\. You can find the directory of a particular Python version with the \fBpyenv prefix\fR command,
.P
e\.g\. \fBpyenv prefix 2\.6\.8\fR\.
.SH "Command Reference"
@@ -413,7 +413,7 @@ Python 3\.3\.3
.fi
.IP "" 0
.SS "pyenv install"
Install a Python version
Install a Python version
.IP "" 4
.nf
Usage: pyenv install [\-f] [\-kvp] <version>
@@ -421,10 +421,10 @@ Usage: pyenv install [\-f] [\-kvp] <version>
pyenv install \-l|\-\-list
\-l, \-\-list List all available versions
\-f, \-\-force Install even if the version appears to be installed
already
\-f, \-\-force Install even if the version appears to be installed
already
\-s, \-\-skip\-existing Skip the installation if the version appears to be
installed already
installed already
python\-build options:
@@ -524,7 +524,7 @@ Specifies the Python version to be used. Also see \fBpyenv shell\fR
Defines the directory under which Python versions and shims reside. Also see \fBpyenv root\fR
.TP
.B PYENV_DEBUG
Outputs debug information.
Outputs debug information.
.br
Also as: \fBpyenv --debug <subcommand>\fR
.TP
@@ -541,7 +541,7 @@ Proxy Variables
Pass configure options to build.
.TP
.B PYTHON_BUILD_ARIA2_OPTS
Used to pass additional parameters to \fBaria2\fR
Used to pass additional parameters to \fBaria2\fR
.UR https://aria2\.github\.io/
.UE
If the \fBaria2c\fR binary is available on PATH, pyenv uses \fBaria2c\fR instead of \fBcurl\fR or \fBwget\fR to download the Python Source code\. If you have an unstable internet connection, you can use this variable to instruct \fBaria2\fR to accelerate the download\.
+1 -1
View File
@@ -18,7 +18,7 @@ stub_build_environment() {
create_stub pyenv-binary-save true
create_stub pyenv-binary-generate-installer true
for opt in "" -v --verbose; do
for opt in "" -v --verbose; do
run pyenv-binary-package $opt 3.12.7:3.12.7-test \
--archive-base-url http://example.com/binaries
assert_success "pyenv-install ${opt:+--verbose }3.12.7:3.12.7-test"
+1 -1
View File
@@ -38,7 +38,7 @@ set -e
# paths where build definitions are looked up.
shopt -s nullglob
for plugin_path in "$PYENV_ROOT"/plugins/*/share/python-build; do
PYTHON_BUILD_DEFINITIONS="${PYTHON_BUILD_DEFINITIONS}:${plugin_path}"
PYTHON_BUILD_DEFINITIONS="${PYTHON_BUILD_DEFINITIONS:+${PYTHON_BUILD_DEFINITIONS}:}${plugin_path}"
done
export PYTHON_BUILD_DEFINITIONS
shopt -u nullglob
+17 -17
View File
@@ -145,7 +145,7 @@ can_use_homebrew() {
brew_prefix="$(brew --prefix || true)" && [[ -n "$brew_prefix" ]] && \
[[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "${brew_prefix}")"/* ]] && \
{ lock_in homebrew; return 0; }
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_HOMEBREW=1; return 1
}
@@ -470,7 +470,7 @@ http_get_aria2c() {
[ -t 3 ] && aria2c_progress="--summary-interval=5"
local cmd
cmd=(aria2c --allow-overwrite=true --no-conf=true -d "${dir_out}" -o "${out}" ${aria2c_progress} ${ARIA2_OPTS} "$1")
if [ -t 3 ]; then
"${cmd[@]}" 2>&1 | interactive_output
ret=${PIPESTATUS[0]}
@@ -682,7 +682,7 @@ fetch_git() {
local git_url="$2"
local git_ref="$3"
local git_sha=
# Checking the ref's SHA-1 is enough to ensure its authenticity according to Linus Torvalds
# https://security.stackexchange.com/questions/67920/how-safe-are-signed-git-tags-only-as-safe-as-sha-1-or-somehow-safer
# ":" is illegal in ref names, see git-check-ref-format(1) manpage
@@ -723,7 +723,7 @@ fetch_git() {
echo "error: please install \`git\` and try again" >&2
exit 1
fi
if [[ -n $git_sha ]]; then
#If the tag is annotated, its underlying ("peeled") commit is checked out instead
#In this case, we accept either commit's SHA or tag's SHA for convenience
@@ -1101,7 +1101,7 @@ make_python_symlinks() {
local -a interpreter_names
seeder_basename="${1:?}"; shift
(($#)) && interpreter_names=("$@") || interpreter_names=(python)
local real_interpreter
real_interpreter=$(resolve_link "${PREFIX_PATH}/bin/$seeder_basename" || echo $seeder_basename)
# Use syntax accepted in both Py2 and Py3. Even though current Py2 holdouts (e.g. PyPy) support e.g. print()
@@ -1241,8 +1241,8 @@ build_package_pypy_builder() {
use_homebrew_tcltk || true
use_homebrew_ncurses || use_macports_ncurses || true
use_homebrew || use_macports || true
if [ -f "rpython/bin/rpython" ]; then # pypy 2.x
if [ -z "${PYPY_OPTS}" ]; then
local PYPY_OPTS="--opt=jit --batch --make-jobs=$(num_cpu_cores)"
@@ -1786,7 +1786,7 @@ prefer_openssl11() {
prefer_openssl3() {
PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl@3 openssl@3.5 openssl@3.0 openssl@1.1 openssl}"
export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA
PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA="${PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA:-openssl3 openssl openssl11}"
export PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA
}
@@ -1794,7 +1794,7 @@ prefer_openssl3() {
prefer_openssl3_to_4() {
PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl@3 openssl@3.5 openssl@3.0 openssl@4 openssl@1.1 openssl}"
export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA
PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA="${PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA:-openssl3 openssl4 openssl openssl11}"
export PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA
}
@@ -1802,7 +1802,7 @@ prefer_openssl3_to_4() {
require_openssl3() {
PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl@3 openssl@3.5 openssl@3.0}"
export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA
PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA="${PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA:-openssl3}"
export PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA
}
@@ -1873,7 +1873,7 @@ use_homebrew_openssl() {
export CPPFLAGS="-I${ssldir}/include ${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L${ssldir}/lib -Wl,-rpath,${ssldir}/lib${LDFLAGS:+ $LDFLAGS}"
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
lock_in homebrew
return 0
@@ -1929,11 +1929,11 @@ build_package_mac_openssl() {
local nokerberos
[[ "$1" != openssl-1.0.* ]] || nokerberos=1
# switches introduced in OpenSSL 1.1.1
local notests
[[ $(openssl_version $1) -ge 10101 ]] && notests=1
# switches introduced in OpenSSL 3.2
local extra_no_features
[[ $(openssl_version $1) -ge 30200 ]] && extra_no_features=1
@@ -2023,7 +2023,7 @@ use_xcode_sdk_zlib() {
# when searching in the SDK
# Since 2.7.4 and 3.2.1 (issue #7724), setup.py and distutils can search in the MacOS SDK when
# it's explicitly specified with -isysroot
#distutils.unixcompiler and setup.py specifically search CFLAGS for "-isysroot"
export CFLAGS="${CFLAGS:+$CFLAGS }-isysroot ${sdkroot}"
#while one can get away with adding it just to CFLAGS, this may cause linker failures
@@ -2247,7 +2247,7 @@ build_package_symlink_version_suffix() {
verify_python() {
build_package_symlink_version_suffix
local python_bin="${PYTHON_BIN%/*}/python${1:?}"
if [ ! -x "${python_bin}" ]; then
@@ -2507,7 +2507,7 @@ build_package_ensurepip() {
fi
local python_opts="-I"
if [[ $mode == "lt21" ]]; then python_opts="-s"; fi
# FIXME: `--altinstall` with `get-pip.py`
"$PYTHON_BIN" $python_opts -m ensurepip ${ensurepip_opts} 1>/dev/null 2>&1 || build_package_get_pip "$@" || return 1
build_package_symlink_version_suffix
@@ -2733,7 +2733,7 @@ if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; the
create_framework_dirs "${DEFINITION_PATH##*/}"
# the `/Library/Frameworks` suffix makes CPython build install apps under prefix rather than into /Applications (#1003)
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
#FIXME: doesn't properly handle paths with spaces. Fix by parsing *OPTS into arrays.
CONFIGURE_OPTS="${CONFIGURE_OPTS//--enable-framework?(=*([^ ]))?( )/}";
CONFIGURE_OPTS="${CONFIGURE_OPTS% }"
@@ -242,7 +242,7 @@ class CondaVersion(NamedTuple):
return PyVersion.PY36
raise ValueError(self.flavor)
def requires_tos_accept(self):
"""
requires to accept TOS for installation
@@ -113,7 +113,7 @@ def add_version(release, distributions):
shas = dict([download_sha(url) for (name, url) in download_urls.items()
if name.endswith('.sha256') and supported(os.path.splitext(name)[0]) and tag_name in name])
specs = [create_spec(filename, sha, download_urls[filename]) for (filename, sha) in shas.items() if supported(filename)]
for distribution in distributions:
distribution_specs = [spec for spec in specs if distribution in spec['flavor'].lower()]
@@ -165,7 +165,7 @@ if __name__ == '__main__':
help="Increase verbosity of logging",
)
parsed = parser.parse_args()
if parsed.verbose: logging.getLogger.setLevel(logging.DEBUG)
main()
+2 -2
View File
@@ -5,7 +5,7 @@ _python_build_dir=$(cd "${BASH_SOURCE%/*}/.."; pwd -P)
backport() {
[[ $# -lt 2 ]] && { echo "usage: $FUNCNAME <commit_hash> <CPython version>..." >&2; return 1; }
(set -euxo pipefail
sha="${1:?}"
shift
@@ -24,4 +24,4 @@ backport() {
mv "$f" "$patch_dir/$(printf '%04d' $((${f::4}+patch_offset)))${f:4}"
done
done)
}
}
@@ -7,4 +7,3 @@ if has_tar_xz_support; then
else
install_package "Python-3.9.0" "https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz#df796b2dc8ef085edae2597a41c1c0a63625ebd92487adaef2fed22b567873e8" standard verify_py39 copy_python_gdb ensurepip
fi
@@ -7,4 +7,3 @@ if has_tar_xz_support; then
else
install_package "Python-3.9.1" "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz#29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117" standard verify_py39 copy_python_gdb ensurepip
fi
@@ -7,4 +7,3 @@ if has_tar_xz_support; then
else
install_package "Python-3.9.2" "https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz#7899e8a6f7946748830d66739f2d8f2b30214dad956e56b9ba216b3de5581519" standard verify_py39 copy_python_gdb ensurepip
fi
@@ -1,2 +1 @@
install_zip "IronPython-2.7.7" "https://github.com/IronLanguages/main/releases/download/ipy-2.7.7/IronPython-2.7.7-win.zip#657c134ff6d6f0ed86557d9455dcdfeac11823944f7aa36d72a41cc5444c4a89" ironpython ensurepip
@@ -1,4 +1,4 @@
has_tar_xz_support \
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.21.0.tar.xz#abd2152613559d3f44728668346e78be9d93458133a03b700baf222c322fd4d5"; } \
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.21.0.zip#12521faacc7191353f2739267bd9fd2a5e60ea04fb47df74f8e22b6bf59ba967"; }
$install micropython-1.21.0 "$src" micropython
$install micropython-1.21.0 "$src" micropython
@@ -1 +1 @@
install_package micropython-1.22.0 https://micropython.org/resources/source/micropython-1.22.0.tar.xz#a042764f0b6f6d92b267454c5bd5afcb83fc3900119f2583672aac571e661924 micropython
install_package micropython-1.22.0 https://micropython.org/resources/source/micropython-1.22.0.tar.xz#a042764f0b6f6d92b267454c5bd5afcb83fc3900119f2583672aac571e661924 micropython
@@ -1 +1 @@
install_package micropython-1.23.0 https://micropython.org/resources/source/micropython-1.23.0.tar.xz#0ab283c2fc98d466c1ff26692bee46abaeeab55d488a36fc3cb6372cb8fb390d micropython
install_package micropython-1.23.0 https://micropython.org/resources/source/micropython-1.23.0.tar.xz#0ab283c2fc98d466c1ff26692bee46abaeeab55d488a36fc3cb6372cb8fb390d micropython
@@ -1 +1 @@
install_package micropython-1.24.0 https://micropython.org/resources/source/micropython-1.24.0.tar.xz#cde2a6795280945100089c053ba85f842d85f3038229d743da35a3673bc1786b micropython
install_package micropython-1.24.0 https://micropython.org/resources/source/micropython-1.24.0.tar.xz#cde2a6795280945100089c053ba85f842d85f3038229d743da35a3673bc1786b micropython
@@ -1 +1 @@
install_package micropython-1.25.0 https://micropython.org/resources/source/micropython-1.25.0.tar.xz#9fe99ad5808e66bb40d374f5cad187c32c7d1c49cf47f72b38fd453c28c2aebe micropython
install_package micropython-1.25.0 https://micropython.org/resources/source/micropython-1.25.0.tar.xz#9fe99ad5808e66bb40d374f5cad187c32c7d1c49cf47f72b38fd453c28c2aebe micropython
@@ -1 +1 @@
install_package micropython-1.26.0 https://micropython.org/resources/source/micropython-1.26.0.tar.xz#a1b8e0f6bf7a8a78b55ac865c46c4c45f9623a86a1785d2063ff1cb3b6e661d7 micropython
install_package micropython-1.26.0 https://micropython.org/resources/source/micropython-1.26.0.tar.xz#a1b8e0f6bf7a8a78b55ac865c46c4c45f9623a86a1785d2063ff1cb3b6e661d7 micropython
@@ -1 +1 @@
install_package micropython-1.27.0 https://micropython.org/resources/source/micropython-1.27.0.tar.xz#9874b20646c3bbe81d524f779a16875e5d088b7065e175ffd2aa2a02f50573c9 micropython
install_package micropython-1.27.0 https://micropython.org/resources/source/micropython-1.27.0.tar.xz#9874b20646c3bbe81d524f779a16875e5d088b7065e175ffd2aa2a02f50573c9 micropython
@@ -1 +1 @@
install_package micropython-1.28.0 https://micropython.org/resources/source/micropython-1.28.0.tar.xz#4e43c59657b8da33b4bc503509a827cc3ea6cb66c446475c57776cf4467ba215 micropython
install_package micropython-1.28.0 https://micropython.org/resources/source/micropython-1.28.0.tar.xz#4e43c59657b8da33b4bc503509a827cc3ea6cb66c446475c57776cf4467ba215 micropython
@@ -3,7 +3,7 @@ PYVER='2.7'
MIN_OSX_VERSION='10.14'
# https://www.pypy.org/checksums.html
aarch64_hash=b5edfc995d83feea8b4c8aeffccb89753b4b182f076126550bd07cc35faa6208
aarch64_hash=b5edfc995d83feea8b4c8aeffccb89753b4b182f076126550bd07cc35faa6208
linux32_hash=7c84f173bbcd73d0eb10909259d11b5cc253d4c6ea4492e6da8f2532df9b3da5
linux64_hash=1f2e84fb539ffce233c34769d2f11647955f894be091e85419e05f48011e8940
osx64_hash=e5c1ff39ad9916ea23e3deb8012fe42367b6b19284cf13b1a1ea2b2f53a43add
@@ -37,4 +37,3 @@ case "$(pypy_architecture 2>/dev/null || true)" in
exit 1
;;
esac
@@ -3,7 +3,7 @@ PYVER='3.7'
MIN_OSX_VERSION='10.14'
# https://www.pypy.org/checksums.html
aarch64_hash=639c76f128a856747aee23a34276fa101a7a157ea81e76394fbaf80b97dcf2f2
aarch64_hash=639c76f128a856747aee23a34276fa101a7a157ea81e76394fbaf80b97dcf2f2
linux32_hash=38429ec6ea1aca391821ee4fbda7358ae86de4600146643f2af2fe2c085af839
linux64_hash=409085db79a6d90bfcf4f576dca1538498e65937acfbe03bd4909bdc262ff378
osx64_hash=76b8eef5b059a7e478f525615482d2a6e9feb83375e3f63c16381d80521a693f
@@ -3,7 +3,7 @@ PYVER='3.8'
MIN_OSX_VERSION='10.14'
# https://www.pypy.org/checksums.html
aarch64_hash=0210536e9f1841ba283c13b04783394050837bb3e6f4091c9f1bd9c7f2b94b55
aarch64_hash=0210536e9f1841ba283c13b04783394050837bb3e6f4091c9f1bd9c7f2b94b55
linux32_hash=bea4b275decd492af6462157d293dd6fcf08a949859f8aec0959537b40afd032
linux64_hash=089f8e3e357d6130815964ddd3507c13bd53e4976ccf0a89b5c36a9a6775a188
osx64_hash=de1b283ff112d76395c0162a1cf11528e192bdc230ee3f1b237f7694c7518dee
@@ -3,7 +3,7 @@ PYVER='3.9'
MIN_OSX_VERSION='10.14'
# https://www.pypy.org/checksums.html
aarch64_hash=b7282bc4484bceae5bc4cc04e05ee4faf51cb624c8fc7a69d92e5fdf0d0c96aa
aarch64_hash=b7282bc4484bceae5bc4cc04e05ee4faf51cb624c8fc7a69d92e5fdf0d0c96aa
linux32_hash=0894c468e7de758c509a602a28ef0ba4fbf197ccdf946c7853a7283d9bb2a345
linux64_hash=129a055032bba700cd1d0acacab3659cf6b7180e25b1b2f730e792f06d5b3010
osx64_hash=95bd88ac8d6372cd5b7b5393de7b7d5c615a0c6e42fdb1eb67f2d2d510965aee
+2 -2
View File
@@ -132,7 +132,7 @@ OUT
stub brew false
stub_make_install
stub_make_install "$PYTHON_MAKE_INSTALL_TARGET"
install_fixture definitions/needs-yaml
assert_success
@@ -1069,7 +1069,7 @@ OUT
test_tcltk_var() {
local var="${1:?}"
cached_tarball "Python-3.6.2"
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
stub uname '-s : echo Darwin'
-1
View File
@@ -41,4 +41,3 @@ while (($#)); do
shift
done
cp "$src" "${dir_}${dest}"
@@ -7,7 +7,7 @@ _setup() {
libreadline-dev libsqlite3-dev curl git llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev \
liblzma-dev libzstd-dev"
optional="libgdbm-dev"
}
+3 -6
View File
@@ -15,7 +15,7 @@ stub_python_build_lib() {
stub_python_build_no_latest() {
stub python-build "${@:-echo python-build \"\$@\"}"
}
stub_python_build() {
stub_python_build_no_latest "$@"
stub pyenv-latest '-f -k * : shift 2; echo "$@"'
@@ -111,7 +111,7 @@ OUT
stub_python_build_lib
for i in {1..2}; do stub_python_build '--definitions : echo -e 3.4.2\\n3.5.1\\n3.5.2'; done
for i in {1..2}; do stub_python_build; done
pyenv-hooks install; unstub pyenv-hooks
PYENV_INSTALL_ROOT="$BATS_TEST_DIRNAME/../../.."
export PYENV_HOOK_PATH="$PYENV_INSTALL_ROOT/pyenv.d"
@@ -243,7 +243,7 @@ OUT
run pyenv-install 3.4.2
assert_success ""
unstub python-build
}
@@ -256,7 +256,6 @@ OUT
run pyenv-install 3.4.2
assert_success
assert_output <<OUT
${PYENV_ROOT}/plugins/bar/share/python-build
${PYENV_ROOT}/plugins/foo/share/python-build
OUT
@@ -274,7 +273,6 @@ OUT
assert_success
assert_output <<OUT
Available versions:
${PYENV_ROOT}/plugins/bar/share/python-build
${PYENV_ROOT}/plugins/foo/share/python-build
OUT
@@ -299,7 +297,6 @@ OUT
--verbose
--version
--debug
${PYENV_ROOT}/plugins/bar/share/python-build
${PYENV_ROOT}/plugins/foo/share/python-build
OUT
+4 -4
View File
@@ -258,7 +258,7 @@ build_package_pyston
verify_python 3.8
OUT
assert_success
for name in python python3 python3.8; do
assert_equal "$(resolve_link "${INSTALL_ROOT}/bin/$name")" "real_interpreter_name"
done
@@ -277,7 +277,7 @@ build_package_pypy
build_package_verify_py311
OUT
assert_success
for name in pypy pypy3 pypy3.11 python python3 python3.11; do
assert_equal "$(resolve_link "${INSTALL_ROOT}/bin/$name")" "pypywhatever"
done
@@ -286,7 +286,7 @@ OUT
@test "enable framework" {
framework_path="${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin"
mkdir -p "$framework_path"
for executable in python3{,.4}{,-config}; do
for executable in python3{,.4}{,-config}; do
touch "$framework_path/$executable"
chmod +x "$framework_path/$executable"
done
@@ -313,7 +313,7 @@ EOS
}
@test "enable universalsdk" {
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub arch "echo x86_64"
+1 -1
View File
@@ -2,7 +2,7 @@ pyenv_install_resolve_latest() {
local DEFINITION_PREFIX DEFINITION_TYPE
local -a DEFINITION_CANDIDATES
local DEFINITION="$1"
DEFINITION_PREFIX="${DEFINITION%%:*}"
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
+1 -1
View File
@@ -192,4 +192,4 @@ wc
who
whoami
yes
# --- end exclusions from coreutils
# --- end exclusions from coreutils
+4 -4
View File
@@ -209,7 +209,7 @@ darwin*)
;;
esac
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
;;
openbsd*|netbsd*|mirbsd*)
@@ -349,7 +349,7 @@ hpux9*)
#
# SHLIB_XLDFLAGS='+b $(libdir)'
# SHLIB_LIBSUFF='sl'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
@@ -381,7 +381,7 @@ hpux10*)
#
# SHLIB_XLDFLAGS='+b $(libdir)'
# SHLIB_LIBSUFF='sl'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
@@ -412,7 +412,7 @@ hpux11*)
#
# SHLIB_XLDFLAGS='+b $(libdir)'
# SHLIB_LIBSUFF='sl'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
+2 -2
View File
@@ -168,7 +168,7 @@ LD_LIBRARY_PATH=*/test/lib:/foo/bar
&& $(LC_ALL=C csrutil status) == *"enabled." ]]; then
skip "macOS with Bash covered by SIP"
fi
export PYENV_VERSION="test"
create_alt_executable print_env <<!
#!$BASH
@@ -189,4 +189,4 @@ DYLD_LIBRARY_PATH=*/test/lib
PYTHONHOME=*/test
DYLD_LIBRARY_PATH=*/test/lib:/foo/bar
!
}
}
+1 -1
View File
@@ -42,4 +42,4 @@ bats_tap_stream_suite() { # <file name>
printf '%s\n' "${1##*/}"
}
orig_bats_parse_internal_extended_tap
orig_bats_parse_internal_extended_tap
+3 -3
View File
@@ -303,7 +303,7 @@ hash -r 2>/dev/null || true"
}
@test "sh-rehash in fish (integration)" {
command -v fish >/dev/null || skip "-- fish not installed"
command -v fish >/dev/null || skip "-- fish not installed"
create_alt_executable_in_version "3.4" "python"
PYENV_SHELL=fish fish -Nc "source (pyenv-sh-rehash | psub)"
assert_success
@@ -317,7 +317,7 @@ hash -r 2>/dev/null || true"
}
@test "sh-rehash in pwsh (integration)" {
command -v pwsh >/dev/null || skip "-- pwsh not installed"
command -v pwsh >/dev/null || skip "-- pwsh not installed"
assert [ ! -x "${PYENV_ROOT}/shims/python" ]
create_alt_executable_in_version "3.4" "python"
run pwsh -nop -c -<<'!'
@@ -341,7 +341,7 @@ echo _PYENV_SHIM_PATH="\$_PYENV_SHIM_PATH"
pyenv-rehash
mkdir -p "${PYENV_TEST_DIR}/alt-shim"
ln -s "${PYENV_ROOT}/shims/python3" "${PYENV_TEST_DIR}/alt-shim/python3"
run "${PYENV_TEST_DIR}/alt-shim/python3"
assert_success
assert_output <<!
+1 -1
View File
@@ -50,7 +50,7 @@ echo "convoluted call success!"
mkdir -p "$real_path"
ln -s "${PYENV_ROOT}/versions/custom/bin/$progname" "$real_path/$progname"
PATH="$PATH:$real_path"
run "$progname"
assert_success
assert_output <<!
+1 -1
View File
@@ -170,7 +170,7 @@ assert() {
# but in which system utils necessary for pyenv operation are still available.
path_without() {
local path=":${PATH}:"
for exe; do
for exe; do
local found alt util
for found in $(PATH="$path" type -aP "$exe"); do
found="${found%/*}"
+2 -2
View File
@@ -175,7 +175,7 @@ EOF
@test "resolves pyenv-latest prefixes" {
create_alt_executable_in_version "3.4.2" "python"
PYENV_VERSION=3.4 run pyenv-which python
assert_success "${PYENV_ROOT}/versions/3.4.2/bin/python"
}
@@ -217,7 +217,7 @@ OUT
PATH="$dir_:$PATH"
done
create_executable "$dir_" "normal_program"
run pyenv-which "$progname"
assert_success
assert_output <<!