Skip to content

Commit

Permalink
Merge pull request #18301 from nsoranzo/release_24.1_fix_packages
Browse files Browse the repository at this point in the history
[24.1] Fix various packages' issues
  • Loading branch information
mvdbeek authored Jun 3, 2024
2 parents fa9af6f + 80701f4 commit 60fbf43
Show file tree
Hide file tree
Showing 39 changed files with 68 additions and 24 deletions.
5 changes: 5 additions & 0 deletions lib/galaxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
jobs,
tools,
)
from galaxy.carbon_emissions import get_carbon_intensity_entry
from galaxy.celery.base_task import (
GalaxyTaskBeforeStart,
GalaxyTaskBeforeStartUserRateLimitPostgres,
Expand Down Expand Up @@ -556,6 +557,10 @@ def __init__(self, configure_logging=True, use_converters=True, use_display_appl
self.application_stack = self._register_singleton(ApplicationStack, application_stack_instance(app=self))
if configure_logging:
config.configure_logging(self.config, self.application_stack.facts)
# Carbon emissions configuration
carbon_intensity_entry = get_carbon_intensity_entry(self.config.geographical_server_location_code)
self.carbon_intensity = carbon_intensity_entry["carbon_intensity"]
self.geographical_server_location_name = carbon_intensity_entry["location_name"]
# Initialize job metrics manager, needs to be in place before
# config so per-destination modifications can be made.
self.job_metrics = self._register_singleton(
Expand Down
8 changes: 0 additions & 8 deletions lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import yaml

from galaxy.carbon_emissions import get_carbon_intensity_entry
from galaxy.config.schema import AppSchema
from galaxy.exceptions import ConfigurationError
from galaxy.util import (
Expand Down Expand Up @@ -700,15 +699,13 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):

allowed_origin_hostnames: List[str]
builds_file_path: str
carbon_intensity: float
container_resolvers_config_file: str
database_connection: str
drmaa_external_runjob_script: str
email_from: Optional[str]
enable_tool_shed_check: bool
galaxy_data_manager_data_path: str
galaxy_infrastructure_url: str
geographical_server_location_name: str
hours_between_check: int
integrated_tool_panel_config: str
involucro_path: str
Expand Down Expand Up @@ -814,11 +811,6 @@ def _process_config(self, kwargs: Dict[str, Any]) -> None:
else:
self.version_extra = extra_info

# Carbon emissions configuration
carbon_intensity_entry = get_carbon_intensity_entry(kwargs.get("geographical_server_location_code", ""))
self.carbon_intensity = carbon_intensity_entry["carbon_intensity"]
self.geographical_server_location_name = carbon_intensity_entry["location_name"]

# Database related configuration
self.check_migrate_databases = string_as_bool(kwargs.get("check_migrate_databases", True))
if not self.database_connection: # Provide default if not supplied by user
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/managers/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def _config_is_truthy(item, key, **context):
"interactivetools_enable": _use_config,
"aws_estimate": _use_config,
"carbon_emission_estimates": _defaults_to(True),
"carbon_intensity": _use_config,
"geographical_server_location_name": _use_config,
"carbon_intensity": lambda item, key, **context: self.app.carbon_intensity,
"geographical_server_location_name": lambda item, key, **context: self.app.geographical_server_location_name,
"geographical_server_location_code": _use_config,
"power_usage_effectiveness": _use_config,
"message_box_content": _use_config,
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/structured_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ class MinimalApp(BasicSharedApp):

class MinimalManagerApp(MinimalApp):
# Minimal App that is sufficient to run Celery tasks
carbon_intensity: float
file_sources: ConfiguredFileSources
genome_builds: GenomeBuilds
geographical_server_location_name: str
dataset_collection_manager: "DatasetCollectionManager"
tool_data_tables: "ToolDataTableManager"
history_manager: "HistoryManager"
Expand Down
2 changes: 0 additions & 2 deletions packages/app/pytest.ini

This file was deleted.

1 change: 1 addition & 0 deletions packages/app/pytest.ini
1 change: 1 addition & 0 deletions packages/auth/pytest.ini
1 change: 1 addition & 0 deletions packages/config/pytest.ini
1 change: 1 addition & 0 deletions packages/data/pytest.ini
1 change: 1 addition & 0 deletions packages/files/pytest.ini
1 change: 1 addition & 0 deletions packages/job_execution/pytest.ini
1 change: 1 addition & 0 deletions packages/job_metrics/pytest.ini
1 change: 1 addition & 0 deletions packages/meta/pytest.ini
1 change: 1 addition & 0 deletions packages/navigation/pytest.ini
1 change: 1 addition & 0 deletions packages/objectstore/pytest.ini
6 changes: 6 additions & 0 deletions packages/package-pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
# Prevent execution of alembic/env.py at test collection stage (alembic.context not set).
# Also ignore functional tests (galaxy_test/ and tool_shed/test/).
addopts = --doctest-modules --ignore=galaxy/model/migrations/alembic/ --ignore=galaxy/tools/bundled/ --ignore=galaxy_test/ --ignore=tool_shed/test/ --ignore=tool_shed/webapp/model/migrations/alembic/ --doctest-continue-on-failure --verbosity=1
asyncio_mode = auto
log_level = DEBUG
1 change: 1 addition & 0 deletions packages/schema/pytest.ini
1 change: 1 addition & 0 deletions packages/selenium/pytest.ini
5 changes: 1 addition & 4 deletions packages/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow.
else
marker_args=()
fi
# Prevent execution of alembic/env.py at test collection stage (alembic.context not set)
# Also ignore functional tests (galaxy_test/ and tool_shed/test/).
unit_extra=(--doctest-modules --ignore=galaxy/model/migrations/alembic/ --ignore=galaxy_test/ --ignore=tool_shed/test/ --ignore=tool_shed/webapp/model/migrations/alembic/ "${marker_args[@]}")
# Ignore exit code 5 (no tests ran)
pytest "${unit_extra[@]}" . || test $? -eq 5
pytest "${marker_args[@]}" . || test $? -eq 5
if [ $FOR_PULSAR -eq 0 ]; then
make mypy
fi
Expand Down
1 change: 1 addition & 0 deletions packages/test_api/pytest.ini
1 change: 1 addition & 0 deletions packages/test_base/pytest.ini
1 change: 1 addition & 0 deletions packages/test_driver/pytest.ini
2 changes: 0 additions & 2 deletions packages/test_driver/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ install_requires =
galaxy-util
galaxy-web-apps
pytest
graphene-sqlalchemy==3.0.0rc1 # these are only needed by tool shed - which we've split out but the test driver loads
starlette-graphene3
packages = find:
python_requires = >=3.8

Expand Down
1 change: 1 addition & 0 deletions packages/test_selenium/pytest.ini
1 change: 1 addition & 0 deletions packages/tool_shed/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include *.rst *.txt LICENSE */py.typed
graft tool_shed/webapp/templates/
1 change: 1 addition & 0 deletions packages/tool_shed/pytest.ini
25 changes: 25 additions & 0 deletions packages/tool_shed/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,33 @@ version = 23.2.dev0
[options]
include_package_data = True
install_requires =
galaxy-app
galaxy-auth
galaxy-config
galaxy-data
galaxy-util
galaxy-web-framework
galaxy-web-stack
galaxy-web-apps
a2wsgi
alembic
fastapi>=0.101.0
graphene
graphene-sqlalchemy>=3.0.0rc1
graphql-core
Mako
MarkupSafe
mercurial
Paste
pydantic>=2,!=2.6.0,!=2.6.1
Routes
SQLAlchemy>=2.0,<2.1
starlette
starlette-context
starlette-graphene3
typing-extensions
WebOb
Whoosh
packages = find:
python_requires = >=3.8

Expand Down
1 change: 1 addition & 0 deletions packages/tool_util/pytest.ini
1 change: 1 addition & 0 deletions packages/tours/pytest.ini
1 change: 1 addition & 0 deletions packages/util/pytest.ini
2 changes: 0 additions & 2 deletions packages/web_apps/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ prune galaxy/webapps/base/static/plugins/
exclude galaxy/webapps/base/static/style/base.css
exclude galaxy/webapps/base/static/welcome.html
graft galaxy/webapps/base/templates/
include tool_shed/webapp/model/migrate/migrate.cfg
graft tool_shed/webapp/templates/

This file was deleted.

1 change: 1 addition & 0 deletions packages/web_apps/pytest.ini
2 changes: 0 additions & 2 deletions packages/web_apps/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ install_requires =
importlib-resources;python_version<'3.9'
Mako
MarkupSafe
mercurial
Paste
pydantic>=2,!=2.6.0,!=2.6.1
PyJWT
Expand All @@ -67,7 +66,6 @@ install_requires =
uvicorn
uvloop
WebOb
Whoosh
packages = find:
python_requires = >=3.8

Expand Down
1 change: 1 addition & 0 deletions packages/web_framework/pytest.ini
1 change: 1 addition & 0 deletions packages/web_stack/pytest.ini
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ fastapi-slim = ">=0.111.0"
fs = "*"
future = ">=1.0.0" # Python 3.12 support
galaxy_sequence_utils = "*"
graphene-sqlalchemy = "3.0.0rc1" # need a beta release to be compat. with starlette plugin
graphene = "*"
graphene-sqlalchemy = ">=3.0.0rc1" # need a beta release to be compat. with starlette plugin
graphql-core = "*"
gravity = ">=1.0.4"
gunicorn = "*"
gxformat2 = "*"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 60fbf43

Please sign in to comment.