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

[23.0] Add support for Python 3.11 #15487

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/first_startup.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.10']
python-version: ['3.7', '3.11']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.10']
python-version: ['3.7', '3.11']
env:
LINT_PATH: 'lib/galaxy/dependencies/pinned-lint-requirements.txt'
TYPE_PATH: 'lib/galaxy/dependencies/pinned-typecheck-requirements.txt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reports_startup.yaml
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.10']
python-version: ['3.7', '3.11']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_galaxy_packages.yaml
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.10']
python-version: ['3.7', '3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.10']
python-version: ['3.7', '3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down
16 changes: 2 additions & 14 deletions client/src/schema/schema.ts
Expand Up @@ -5066,12 +5066,6 @@ export interface components {
)[];
metadata: components["schemas"]["LibraryFolderMetadata"];
};
/**
* LibraryFolderContentsIndexSortByEnum
* @description An enumeration.
* @enum {string}
*/
LibraryFolderContentsIndexSortByEnum: "name" | "description" | "type" | "size" | "update_time";
/**
* LibraryFolderCurrentPermissions
* @description Base model definition with common configuration used by all derived models.
Expand Down Expand Up @@ -7348,12 +7342,6 @@ export interface components {
[key: string]: number | undefined;
};
};
/**
* WorkflowSortByEnum
* @description An enumeration.
* @enum {string}
*/
WorkflowSortByEnum: "create_time" | "update_time" | "name" | "None";
/**
* WriteInvocationStoreToPayload
* @description Base model definition with common configuration used by all derived models.
Expand Down Expand Up @@ -8655,7 +8643,7 @@ export interface operations {
offset?: number;
search_text?: string;
include_deleted?: boolean;
order_by?: components["schemas"]["LibraryFolderContentsIndexSortByEnum"];
order_by?: "name" | "description" | "type" | "size" | "update_time";
sort_desc?: boolean;
};
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
Expand Down Expand Up @@ -14324,7 +14312,7 @@ export interface operations {
missing_tools?: boolean;
show_published?: boolean;
show_shared?: boolean;
sort_by?: components["schemas"]["WorkflowSortByEnum"];
sort_by?: "create_time" | "update_time" | "name";
sort_desc?: boolean;
limit?: number;
offset?: number;
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/dependencies/conditional-requirements.txt
@@ -1,5 +1,5 @@
# These dependencies are only required when certain config options are set
psycopg2-binary==2.9.1
psycopg2-binary==2.9.5
mysqlclient
fluent-logger
sentry-sdk
Expand Down
270 changes: 136 additions & 134 deletions lib/galaxy/dependencies/dev-requirements.txt

Large diffs are not rendered by default.

379 changes: 190 additions & 189 deletions lib/galaxy/dependencies/pinned-requirements.txt

Large diffs are not rendered by default.

55 changes: 50 additions & 5 deletions lib/galaxy/dependencies/update.sh
Expand Up @@ -6,10 +6,13 @@

set -e

SUPPORTED_PYTHON_VERSIONS="3.7 3.8 3.9 3.10 3.11"
NOT_SUPPORTED_NEXT_PYTHON_VERSION="3.12"

this_directory="$(cd "$(dirname "$0")" > /dev/null && pwd)"

usage() {
printf "Usage: %s: [-a] [pkg_spec...]\n" ${0##*/} >&2
printf "Usage: %s: [-a] [pkg_spec...]\n" "${0##*/}" >&2
}

add=
Expand All @@ -23,7 +26,7 @@ do
;;
esac
done
shift $(($OPTIND - 1))
shift $((OPTIND - 1))

if [ -n "$add" ] && [ $# -eq 0 ]; then
printf "When adding (-a), you must provide at least one package specification.\n" >&2
Expand All @@ -42,6 +45,48 @@ else
poetry add -vv --lock "$@"
fi

# Update pinned requirements.
poetry export -f requirements.txt --without-hashes --output "$this_directory/pinned-requirements.txt"
poetry export --only dev -f requirements.txt --without-hashes --output "$this_directory/dev-requirements.txt"
# Update pinned requirements files.
PINNED_REQUIREMENTS_FILE=$this_directory/pinned-requirements.txt
PINNED_DEV_REQUIREMENTS_FILE=$this_directory/dev-requirements.txt
poetry export -f requirements.txt --without-hashes --output "$PINNED_REQUIREMENTS_FILE"
poetry export --only dev -f requirements.txt --without-hashes --output "$PINNED_DEV_REQUIREMENTS_FILE"

# Fix requirements

latest_package_version_for_python_version () {
PIP_INDEX_OUT=$(pip index versions --python-version "$2" "$1")
echo "$PIP_INDEX_OUT" | head -n 1 | sed -e 's/.* (\(.*\)).*/\1/'
}

split_requirement () {
PACKAGE_NAME=$1

if ! pip index version --help >/dev/null; then
echo "pip >= 21.2.1 required for the 'index' command"
exit 1
fi

NEW_REQUIREMENTS=
PREVIOUS_LATEST_PACKAGE_VERSION=
for PYTHON_VERSION in $SUPPORTED_PYTHON_VERSIONS; do
LATEST_PACKAGE_VERSION=$(latest_package_version_for_python_version "$PACKAGE_NAME" "$PYTHON_VERSION")
if [ -z "$NEW_REQUIREMENTS" ]; then
NEW_REQUIREMENTS="$PACKAGE_NAME==$LATEST_PACKAGE_VERSION ; python_version >= \"$PYTHON_VERSION\""
elif [ "$LATEST_PACKAGE_VERSION" != "$PREVIOUS_LATEST_PACKAGE_VERSION" ]; then
NEW_REQUIREMENTS="$NEW_REQUIREMENTS and python_version < \"$PYTHON_VERSION\"\n$PACKAGE_NAME==$LATEST_PACKAGE_VERSION ; python_version >= \"$PYTHON_VERSION\""
fi
PREVIOUS_LATEST_PACKAGE_VERSION=$LATEST_PACKAGE_VERSION
done
if [ -n "$NOT_SUPPORTED_NEXT_PYTHON_VERSION" ]; then
NEW_REQUIREMENTS="$NEW_REQUIREMENTS and python_version < \"$NOT_SUPPORTED_NEXT_PYTHON_VERSION\""
fi

sed -i.orig -e "s/^$PACKAGE_NAME==.*/$NEW_REQUIREMENTS/" "$PINNED_REQUIREMENTS_FILE" "$PINNED_DEV_REQUIREMENTS_FILE"
}

# For some packages there is no recent version that works on all Python versions
# supported by Galaxy, so Poetry resorts to an old version that didn't have a
# maximum Python version pin. Here we replace any such requirement with multiple
# Python-version-specific requirements.
split_requirement numpy
split_requirement scipy
21 changes: 9 additions & 12 deletions lib/galaxy/managers/folders.py
Expand Up @@ -37,10 +37,7 @@
RequestParameterInvalidException,
)
from galaxy.model.scoped_session import galaxy_scoped_session
from galaxy.schema.schema import (
LibraryFolderContentsIndexQueryPayload,
LibraryFolderContentsIndexSortByEnum,
)
from galaxy.schema.schema import LibraryFolderContentsIndexQueryPayload
from galaxy.security import RBACAgent
from galaxy.security.idencoding import IdEncodingHelper

Expand All @@ -57,17 +54,17 @@ class SecurityParams:


LDDA_SORT_COLUMN_MAP = {
LibraryFolderContentsIndexSortByEnum.name: lambda ldda, dataset: ldda.name,
LibraryFolderContentsIndexSortByEnum.description: lambda ldda, dataset: ldda.message,
LibraryFolderContentsIndexSortByEnum.type: lambda ldda, dataset: ldda.extension,
LibraryFolderContentsIndexSortByEnum.size: lambda ldda, dataset: dataset.file_size,
LibraryFolderContentsIndexSortByEnum.update_time: lambda ldda, dataset: ldda.update_time,
"name": lambda ldda, dataset: ldda.name,
"description": lambda ldda, dataset: ldda.message,
"type": lambda ldda, dataset: ldda.extension,
"size": lambda ldda, dataset: dataset.file_size,
"update_time": lambda ldda, dataset: ldda.update_time,
}

FOLDER_SORT_COLUMN_MAP = {
LibraryFolderContentsIndexSortByEnum.name: lambda folder: folder.name,
LibraryFolderContentsIndexSortByEnum.description: lambda folder: folder.description,
LibraryFolderContentsIndexSortByEnum.update_time: lambda folder: folder.update_time,
"name": lambda folder: folder.name,
"description": lambda folder: folder.description,
"update_time": lambda folder: folder.update_time,
}


Expand Down
15 changes: 3 additions & 12 deletions lib/galaxy/schema/schema.py
Expand Up @@ -1093,11 +1093,7 @@ class ExportHistoryArchivePayload(Model):
)


class WorkflowSortByEnum(str, Enum):
create_time = "create_time"
update_time = "update_time"
name = "name"
none = None
WorkflowSortByEnum = Literal["create_time", "update_time", "name"]


class WorkflowIndexQueryPayload(Model):
Expand Down Expand Up @@ -2718,20 +2714,15 @@ class LibraryFolderCurrentPermissions(Model):
)


class LibraryFolderContentsIndexSortByEnum(str, Enum):
name = "name"
description = "description"
type = "type"
size = "size"
update_time = "update_time"
LibraryFolderContentsIndexSortByEnum = Literal["name", "description", "type", "size", "update_time"]


class LibraryFolderContentsIndexQueryPayload(Model):
limit: int = 10
offset: int = 0
search_text: Optional[str] = None
include_deleted: Optional[bool] = None
order_by: LibraryFolderContentsIndexSortByEnum = LibraryFolderContentsIndexSortByEnum.name
order_by: LibraryFolderContentsIndexSortByEnum = "name"
sort_desc: Optional[bool] = False


Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/folder_contents.py
Expand Up @@ -54,7 +54,7 @@
)

SortByQueryParam: LibraryFolderContentsIndexSortByEnum = Query(
default=LibraryFolderContentsIndexSortByEnum.name,
default="name",
title="Sort By",
description="Sort results by specified field.",
)
Expand Down
1 change: 1 addition & 0 deletions packages/app/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/auth/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/config/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/data/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/files/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/job_execution/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/job_metrics/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/meta/setup.cfg
Expand Up @@ -14,6 +14,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Software Development
Topic :: Software Development :: Code Generators
Expand Down
1 change: 1 addition & 0 deletions packages/navigation/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/objectstore/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/selenium/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/test_api/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/test_base/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/test_driver/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/test_selenium/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/tool_util/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/tours/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down
1 change: 1 addition & 0 deletions packages/util/setup.cfg
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Testing
Expand Down