Skip to content

Commit

Permalink
Merge pull request galaxyproject#16954 from common-workflow-lab/pytho…
Browse files Browse the repository at this point in the history
…n3.8

Python 3.8 as minimum
  • Loading branch information
dannon authored Nov 29, 2023
2 parents 63cc7bc + d6edde3 commit 426e24f
Show file tree
Hide file tree
Showing 236 changed files with 857 additions and 1,137 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variables:
jobs:
get_code:
docker:
- image: cimg/python:3.7
- image: cimg/python:3.8
<<: *set_workdir
steps:
# Replace standard code checkout with shallow clone to speed things up.
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- ~/repo
validate_test_tools:
docker:
- image: cimg/python:3.7
- image: cimg/python:3.8
<<: *set_workdir
steps:
- *restore_repo_cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
chunk: [0, 1]
services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_test_class_names.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/converter_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- if: github.event_name == 'schedule'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cwl_conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
marker: ['green', 'red and required', 'red and not required']
conformance-version: ['cwl_conformance_v1_0'] #, 'cwl_conformance_v1_1', 'cwl_conformance_v1_2']
services:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/db_indexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
matrix:
db: ['postgresql', 'sqlite']
postgresql-version: ['13']
python-version: ['3.7']
python-version: ['3.8']
include:
- db: postgresql
postgresql-version: '9.6'
python-version: '3.7'
python-version: '3.8'
services:
postgres:
image: postgres:${{ matrix.postgresql-version }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# poetry requires Python >=3.8, but lint requirements currently need
# to be generated with `pip freeze`` on the oldest Python version
# supported by Galaxy.
python-version: |
${{ matrix.python-version }}
3.8
python-version: ${{ matrix.python-version }}
- name: Update dependencies
run: |
python -m venv .venv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- name: Get target branch name (push)
if: github.event_name == 'push'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/first_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
services:
postgres:
image: postgres:13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
chunk: ['0', '1', '2', '3']
services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration_selenium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
services:
postgres:
image: postgres:13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '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/lint_openapi_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mulled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/osx_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
services:
postgres:
image: postgres:13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.8']
steps:
- uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reports_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/selenium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
chunk: [0, 1, 2]
services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_galaxy_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_galaxy_packages_for_pulsar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.7'] # don't upgrade, see https://github.com/galaxyproject/galaxy/pull/16649
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toolshed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
shed-api: ['v1', 'v2']
test-install-client: ['galaxy_api', 'standalone']
services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
services:
postgres:
image: postgres:13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ format: ## Format Python code base
remove-unused-imports: ## Remove unused imports in Python code base
$(IN_VENV) autoflake --in-place --remove-all-unused-imports --recursive --verbose lib/ test/

pyupgrade: ## Convert older code patterns to Python3.7/3.8 idiomatic ones
ack --type=python -f | grep -v '^lib/galaxy/schema/bco/\|^lib/galaxy/schema/drs/\|^lib/tool_shed_client/schema/trs\|^tools/\|^.venv/\|^.tox/\|^lib/galaxy/files/sources/\|^lib/galaxy/job_metrics/\|^lib/galaxy/objectstore/\|^lib/galaxy/tool_util/\|^lib/galaxy/util/\|^test/functional/tools/cwl_tools/' | xargs pyupgrade --py38-plus
ack --type=python -f | grep -v '^lib/galaxy/schema/bco/\|^lib/galaxy/schema/drs/\|^lib/tool_shed_client/schema/trs\|^tools/\|^.venv/\|^.tox/\|^lib/galaxy/files/sources/\|^lib/galaxy/job_metrics/\|^lib/galaxy/objectstore/\|^lib/galaxy/tool_util/\|^lib/galaxy/util/\|^test/functional/tools/cwl_tools/' | xargs auto-walrus
ack --type=python -f lib/galaxy/files/sources/ lib/galaxy/job_metrics/ lib/galaxy/objectstore/ lib/galaxy/tool_util/ lib/galaxy/util/ | xargs pyupgrade --py37-plus

docs-slides-ready:
test -f plantuml.jar || wget http://jaist.dl.sourceforge.net/project/plantuml/plantuml.jar
java -jar plantuml.jar -c $(DOC_SOURCE_DIR)/slideshow/architecture/images/plantuml_options.txt -tsvg $(SLIDESHOW_DIR)/architecture/images/ *.plantuml.txt
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Community support is available at `Galaxy Help <https://help.galaxyproject.org/>
Galaxy Quickstart
=================

Galaxy requires Python 3.7 . To check your Python version, run:
Galaxy requires Python 3.8 . To check your Python version, run:

.. code:: console
$ python -V
Python 3.7.6
Python 3.8.18
Start Galaxy:

Expand Down
4 changes: 2 additions & 2 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2422,8 +2422,8 @@ export interface components {
/**
* Type
* @description The digest method used to create the checksum.
* The value (e.g. `sha-256`) SHOULD be listed as `Hash Name String` in the https://www.iana.org/assignments/named-information/named-information.xhtml#hash-alg[IANA Named Information Hash Algorithm Registry]. Other values MAY be used, as long as implementors are aware of the issues discussed in https://tools.ietf.org/html/rfc6920#section-9.4[RFC6920].
* GA4GH may provide more explicit guidance for use of non-IANA-registered algorithms in the future. Until then, if implementors do choose such an algorithm (e.g. because it's implemented by their storage provider), they SHOULD use an existing standard `type` value such as `md5`, `etag`, `crc32c`, `trunc512`, or `sha1`.
* The value (e.g. `sha-256`) SHOULD be listed as `Hash Name String` in the https://www.iana.org/assignments/named-information/named-information.xhtml#hash-alg[IANA Named Information Hash Algorithm Registry]. Other values MAY be used, as long as implementers are aware of the issues discussed in https://tools.ietf.org/html/rfc6920#section-9.4[RFC6920].
* GA4GH may provide more explicit guidance for use of non-IANA-registered algorithms in the future. Until then, if implementers do choose such an algorithm (e.g. because it's implemented by their storage provider), they SHOULD use an existing standard `type` value such as `md5`, `etag`, `crc32c`, `trunc512`, or `sha1`.
* @example sha-256
*/
type: string;
Expand Down
3 changes: 1 addition & 2 deletions doc/parse_gx_xsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def _build_tag(tag, hide_attributes):
assertions_buffer.write(f"#### ``{element.attrib['name']}``:\n\n{doc}\n\n")
text = text.replace(line, assertions_buffer.getvalue())
tag_help.write(text)
best_practices = _get_bp_link(annotation_el)
if best_practices:
if best_practices := _get_bp_link(annotation_el):
tag_help.write("\n\n### Best Practices\n")
tag_help.write(
"""
Expand Down
2 changes: 1 addition & 1 deletion doc/source/admin/python.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Supported Python versions

Galaxy's core functionality is currently supported on Python **>=3.7** .
Galaxy's core functionality is currently supported on Python **>=3.8** .

If Galaxy complains about the version of Python you are using:

Expand Down
2 changes: 1 addition & 1 deletion doc/source/dev/debugging_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ index 6647588dfb..c8d82957a1 100644
@@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.8']
- subset: ['upload_datatype', 'extended_metadata', 'kubernetes', 'not (upload_datatype or extended_metadata or kubernetes)']
+ subset: ['not (upload_datatype or extended_metadata or kubernetes)']
services:
Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy/actions/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ def _get_path_paste_uploaded_datasets(self, trans, params, library_bunch, respon
return uploaded_datasets, 200, None

def _get_path_files_and_folders(self, params, preserve_dirs):
problem_response = self._check_path_paste_params(params)
if problem_response:
if problem_response := self._check_path_paste_params(params):
return problem_response
files_and_folders = []
for line, path in self._paths_list(params):
Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,7 @@ def to_str(self, **kwd):

class ExecutionTimerFactory:
def __init__(self, config):
statsd_host = getattr(config, "statsd_host", None)
if statsd_host:
if statsd_host := getattr(config, "statsd_host", None):
from galaxy.web.statsd_client import GalaxyStatsdClient

self.galaxy_statsd_client: Optional[GalaxyStatsdClient] = GalaxyStatsdClient(
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/app_unittest_utils/tools_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class MockContext:
def __init__(self, model_objects=None):
self.expunged_all = False
self.flushed = False
self.model_objects = model_objects or defaultdict(lambda: {})
self.model_objects = model_objects or defaultdict(dict)
self.created_objects = []
self.current = self

Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def active_authenticators(self, email, username, password):

def _get_allow_register(d):
s = d.get("allow-register", True)
lower_s = str(s).lower()
if lower_s == "challenge":
if (lower_s := str(s).lower()) == "challenge":
return lower_s
else:
return string_as_bool(s)
3 changes: 1 addition & 2 deletions lib/galaxy/celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ def get_galaxy_app():

@lru_cache(maxsize=1)
def build_app():
kwargs = get_app_properties()
if kwargs:
if kwargs := get_app_properties():
kwargs["check_migrate_databases"] = False
kwargs["use_display_applications"] = False
kwargs["use_converters"] = False
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/celery/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
log = get_logger(__name__)


@lru_cache()
@lru_cache
def setup_data_table_manager(app):
app._configure_tool_data_tables(from_shed_config=False)


@lru_cache()
@lru_cache
def cached_create_tool_from_representation(app, raw_tool_source):
return create_tool_from_representation(
app=app, raw_tool_source=raw_tool_source, tool_dir="", tool_source_class="XmlToolSource"
Expand Down
Loading

0 comments on commit 426e24f

Please sign in to comment.