python packages: convert to pure namespace packages

only directories in `lib/galaxy` & `packages/*/galaxy`
All other files removed or moved to their own module
All references to those files updated, especially galaxy/version.py
This commit is contained in:
Michael R. Crusoe
2026-03-03 17:37:43 +01:00
parent 78603081b2
commit dbfcdb8bc9
137 changed files with 102 additions and 110 deletions
+2 -2
View File
@@ -4,14 +4,14 @@ on:
paths:
- '.github/workflows/test_galaxy_release.yaml'
- lib/galaxy/dependencies/**
- lib/galaxy/version.py
- lib/galaxy/version/__init__.py
- scripts/release.sh
- test/release.sh
pull_request:
paths:
- '.github/workflows/test_galaxy_release.yaml'
- lib/galaxy/dependencies/**
- lib/galaxy/version.py
- lib/galaxy/version/__init__.py
- scripts/release.sh
- test/release.sh
concurrency:
+3
View File
@@ -273,6 +273,9 @@ release-create: ## Create a release branch
release-create-point: release-create ## Create a point release
mypy:
cd lib && mypy . ../test
.PHONY: help
help:
+3 -3
View File
@@ -155,7 +155,7 @@ To work on this package:
3. Synchronize the version with Galaxy:
```bash
# Update the version in package.json from Galaxy's version.py
# Update the version in package.json from Galaxy's version/__init__.py
npm run sync-version
```
@@ -174,7 +174,7 @@ To work on this package:
### Version Synchronization
This package maintains version parity with Galaxy to indicate API compatibility. The version number in `package.json` is derived from Galaxy's `lib/galaxy/version.py` file but formatted to comply with npm's semver requirements.
This package maintains version parity with Galaxy to indicate API compatibility. The version number in `package.json` is derived from Galaxy's `lib/galaxy/version/__init__.py` file but formatted to comply with npm's semver requirements.
**Important:** npm does not allow republishing the same version, even for development versions. When making changes to the client API during development:
@@ -201,7 +201,7 @@ npm run sync-version
The script will:
1. Read the version from Galaxy's `version.py` file
1. Read the version from Galaxy's `version/__init__.py` file
2. Convert it to npm-compatible semver format
3. Update the version in `package.json` if different
+4 -4
View File
@@ -3,7 +3,7 @@
/**
* Galaxy Client API Version Synchronization Script
*
* Reads Galaxy's version.py and updates package.json with a semver-compatible version.
* Reads Galaxy's version/__init__.py and updates package.json with a semver-compatible version.
*/
import fs from "fs";
@@ -17,10 +17,10 @@ const galaxyRoot = process.env.GALAXY_ROOT || path.resolve(__dirname, "../..");
const clientApiRoot = path.resolve(__dirname, "..");
// File paths
const galaxyVersionPath = path.join(galaxyRoot, "lib/galaxy/version.py");
const galaxyVersionPath = path.join(galaxyRoot, "lib/galaxy/version/__init__.py");
const packageJsonPath = path.join(clientApiRoot, "package.json");
// Check if Galaxy version.py exists
// Check if Galaxy version/__init__.py exists
if (!fs.existsSync(galaxyVersionPath)) {
console.error(`Galaxy version file not found at ${galaxyVersionPath}`);
process.exit(1);
@@ -32,7 +32,7 @@ const majorMatch = versionPy.match(/VERSION_MAJOR\s*=\s*"([^"]+)"/);
const minorMatch = versionPy.match(/VERSION_MINOR\s*=\s*"([^"]+)"/);
if (!majorMatch) {
console.error("Could not find VERSION_MAJOR in version.py");
console.error("Could not find VERSION_MAJOR in version/__init__.py");
process.exit(1);
}
+2 -2
View File
@@ -18,7 +18,7 @@ The command is shipped with the `galaxy-release-util <https://pypi.org/project/g
`galaxy-release-util create-release` will:
- update lib/galaxy/version.py
- update lib/galaxy/version/__init__.py
- create HISTORY.rst entries for all packages
- build all packages
- stage and commit all changes
@@ -28,7 +28,7 @@ The command is shipped with the `galaxy-release-util <https://pypi.org/project/g
The script has 2 important arguments:
- `--new-version` is the new version as it will appear for PyPI packages and in lib/galaxy/version.py
- `--new-version` is the new version as it will appear for PyPI packages and in lib/galaxy/version/__init__.py
- `--last-commit` indicates the first commit from which changes are to be included in the changelog.
Before starting make sure local branches (all release branches and dev) are up to date and clean, and all release branches have been merged forward,
-7
View File
@@ -1,7 +0,0 @@
"""
Galaxy root package -- this is a namespace package.
"""
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
@@ -41,6 +41,7 @@ from galaxy.celery.base_task import (
from galaxy.config import GalaxyAppConfiguration
from galaxy.config_watchers import ConfigWatchers
from galaxy.datatypes.registry import Registry
from galaxy.di import Container
from galaxy.files import (
ConfiguredFileSources,
ConfiguredFileSourcesConf,
@@ -141,6 +142,11 @@ from galaxy.short_term_storage import (
ShortTermStorageManager,
ShortTermStorageMonitor,
)
from galaxy.structured_app import (
BasicSharedApp,
MinimalManagerApp,
StructuredApp,
)
from galaxy.tool_shed.cache import ToolShedRepositoryCache
from galaxy.tool_shed.galaxy_install.client import InstallationTarget
from galaxy.tool_shed.galaxy_install.installed_repository_manager import InstalledRepositoryManager
@@ -185,12 +191,6 @@ from galaxy.workflow import scheduling_manager
from galaxy.workflow.completion_hooks import WorkflowCompletionHookRegistry
from galaxy.workflow.completion_monitor import WorkflowCompletionMonitor
from galaxy.workflow.trs_proxy import TrsProxy
from .di import Container
from .structured_app import (
BasicSharedApp,
MinimalManagerApp,
StructuredApp,
)
log = logging.getLogger(__name__)
app = None
+1 -1
View File
@@ -22,6 +22,7 @@ from sqlalchemy import func
from sqlalchemy.exc import IntegrityError
from galaxy import exceptions as galaxy_exceptions
from galaxy.config import GalaxyAppConfiguration
from galaxy.exceptions import MalformedContents
from galaxy.managers import users as user_managers
from galaxy.model import (
@@ -44,7 +45,6 @@ from .oidc_utils import (
is_oidc_backend,
verify_oidc_response,
)
from ..config import GalaxyAppConfiguration
if TYPE_CHECKING:
from social_core.backends.oauth import BaseOAuth2
+1 -1
View File
@@ -54,7 +54,7 @@ from galaxy.util.resources import (
resource_path,
)
from galaxy.util.themes import flatten_theme
from ..version import (
from galaxy.version import (
VERSION_MAJOR,
VERSION_MINOR,
)
+6 -6
View File
@@ -5,18 +5,18 @@ Triple format classes
import logging
import re
from galaxy.datatypes import (
binary,
data,
text,
xml,
)
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes.protocols import DatasetProtocol
from galaxy.datatypes.sniff import (
build_sniff_from_prefix,
FilePrefix,
)
from . import (
binary,
data,
text,
xml,
)
log = logging.getLogger(__name__)
-1
View File
@@ -1 +0,0 @@
../../scripts/galaxy-main
+1
View File
@@ -0,0 +1 @@
../../../scripts/galaxy-main
View File
View File
+1 -1
View File
@@ -48,6 +48,7 @@ from sqlalchemy.orm.scoping import scoped_session
from sqlalchemy.sql import expression
from typing_extensions import Protocol
from galaxy import model
from galaxy.datatypes.registry import Registry
from galaxy.exceptions import (
MalformedContents,
@@ -122,7 +123,6 @@ from ..item_attrs import (
add_item_annotation,
get_item_annotation_str,
)
from ... import model
if TYPE_CHECKING:
from galaxy.managers.workflows import WorkflowContentsManager
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -196,7 +196,7 @@ class NicerConfigParser(ConfigParser):
def _running_from_source():
paths = ["run.sh", "lib/galaxy/__init__.py", "scripts/common_startup.sh"]
paths = ["run.sh", "lib/galaxy", "scripts/common_startup.sh"]
return all(map(os.path.exists, paths))
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
+1
View File
@@ -17,6 +17,7 @@ warn_redundant_casts = True
warn_unreachable = True
warn_unused_ignores = True
platform = linux
explicit_package_bases = True
# green list - work on growing these please!
[mypy-galaxy.jobs.job_destination]
+1 -1
View File
@@ -1,4 +1,4 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
include galaxy/carbon_emissions/carbon_intensity.csv
include galaxy/dependencies/*.txt
include galaxy/dependencies/*.sh
-1
View File
@@ -1 +0,0 @@
../../package.__init__.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/app
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/app.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/config_watchers
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/config_watchers.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/di
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/di.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/main
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/main.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/main_config
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/main_config.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/queue_worker
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/queue_worker.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/queues
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/queues.py
+1
View File
@@ -0,0 +1 @@
../../../lib/galaxy/structured_app
-1
View File
@@ -1 +0,0 @@
../../../lib/galaxy/structured_app.py
+1 -1
View File
@@ -1 +1 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
-1
View File
@@ -1 +0,0 @@
../../package.__init__.py
+1 -1
View File
@@ -1,4 +1,4 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
include galaxy/config/schemas/*.yml
include galaxy/config/sample/*.sample*
graft galaxy/config/templates/
-1
View File
@@ -1 +0,0 @@
../../package.__init__.py
+1 -1
View File
@@ -1,4 +1,4 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
include galaxy/datatypes/set_metadata_tool.xml
include galaxy/datatypes/converters/*.xml
graft galaxy/datatypes/display_applications/configs/
-1
View File
@@ -1 +0,0 @@
../../package.__init__.py
+1 -1
View File
@@ -1,2 +1,2 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
include galaxy/files/templates/examples/*yml
-1
View File
@@ -1 +0,0 @@
../../package.__init__.py
+1 -1
View File
@@ -1,2 +1,2 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed
@@ -1 +0,0 @@
../../package.__init__.py
+1 -1
View File
@@ -1 +1 @@
include *.rst *.txt LICENSE */py.typed
include *.rst *.txt LICENSE galaxy/*/py.typed

Some files were not shown because too many files have changed in this diff Show More