From e896d8553a5d5fc78107bc28bb0c442f25f6e3a7 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Thu, 2 Nov 2023 17:12:12 +0100 Subject: [PATCH] Split into multiple namespace packages --- .pre-commit-config.yaml | 2 +- diracx-api/pyproject.toml | 30 ++++++ .../src}/diracx/api/__init__.py | 0 {src => diracx-api/src}/diracx/api/jobs.py | 0 {src => diracx-api/src}/diracx/api/utils.py | 0 .../core => diracx-api/tests/api}/__init__.py | 0 {tests => diracx-api/tests}/api/test_jobs.py | 0 {tests => diracx-api/tests}/api/test_utils.py | 0 diracx-cli/pyproject.toml | 39 ++++++++ .../src}/diracx/cli/__init__.py | 0 .../src/diracx/cli}/__main__.py | 0 .../src}/diracx/cli/internal/__init__.py | 0 .../src}/diracx/cli/internal/legacy.py | 0 {src => diracx-cli/src}/diracx/cli/jobs.py | 0 {src => diracx-cli/src}/diracx/cli/utils.py | 0 .../auth => diracx-cli/tests/cli}/__init__.py | 0 .../cs_sync/convert_integration_test.yaml | 0 .../cli/legacy/cs_sync/integration_test.cfg | 0 .../cli/legacy/cs_sync/integration_test.yaml | 0 .../cs_sync/integration_test_secret.cfg | 0 .../tests}/cli/legacy/cs_sync/test_cssync.py | 0 .../tests}/cli/legacy/test_legacy.py | 0 .../tests}/cli/test_internal.py | 0 {tests => diracx-cli/tests}/cli/test_jobs.py | 0 {tests => diracx-cli/tests}/cli/test_login.py | 0 diracx-client/pyproject.toml | 31 +++++++ .../src}/diracx/client/__init__.py | 0 .../src}/diracx/client/_client.py | 0 .../src}/diracx/client/_configuration.py | 0 .../src}/diracx/client/_patch.py | 0 .../src}/diracx/client/_serialization.py | 0 .../src}/diracx/client/_vendor.py | 0 .../src}/diracx/client/aio/__init__.py | 0 .../src}/diracx/client/aio/_client.py | 0 .../src}/diracx/client/aio/_configuration.py | 0 .../src}/diracx/client/aio/_patch.py | 0 .../src}/diracx/client/aio/_vendor.py | 0 .../diracx/client/aio/operations/__init__.py | 0 .../client/aio/operations/_operations.py | 0 .../diracx/client/aio/operations/_patch.py | 0 .../src}/diracx/client/models/__init__.py | 0 .../src}/diracx/client/models/_enums.py | 0 .../src}/diracx/client/models/_models.py | 0 .../src}/diracx/client/models/_patch.py | 0 .../src}/diracx/client/operations/__init__.py | 0 .../diracx/client/operations/_operations.py | 0 .../src}/diracx/client/operations/_patch.py | 0 .../src}/diracx/client/py.typed | 0 .../tests/client}/__init__.py | 0 .../tests}/client/test_regenerate.py | 0 diracx-core/pyproject.toml | 37 ++++++++ .../src/diracx/core}/__init__.py | 0 .../src}/diracx/core/config/__init__.py | 0 .../src}/diracx/core/config/schema.py | 0 .../src}/diracx/core/exceptions.py | 0 .../src}/diracx/core/extensions.py | 0 .../src}/diracx/core/models.py | 0 .../src}/diracx/core/preferences.py | 0 .../src}/diracx/core/properties.py | 0 {src => diracx-core/src}/diracx/core/s3.py | 0 .../src}/diracx/core/settings.py | 0 {src => diracx-core/src}/diracx/core/utils.py | 0 .../tests/core}/__init__.py | 0 .../tests}/core/test_extensions.py | 0 {tests => diracx-core/tests}/core/test_s3.py | 0 .../tests}/core/test_secrets.py | 0 .../tests}/core/test_utils.py | 0 diracx-db/pyproject.toml | 43 +++++++++ {src => diracx-db/src}/diracx/db/__init__.py | 0 {src => diracx-db/src}/diracx/db/__main__.py | 0 .../src}/diracx/db/exceptions.py | 0 .../src}/diracx/db/os/__init__.py | 0 .../src}/diracx/db/os/job_parameters.py | 0 {src => diracx-db/src}/diracx/db/os/utils.py | 0 .../src}/diracx/db/sql/__init__.py | 0 .../src/diracx/db/sql/auth}/__init__.py | 0 .../src}/diracx/db/sql/auth/db.py | 0 .../src}/diracx/db/sql/auth/schema.py | 0 .../src/diracx/db/sql/dummy}/__init__.py | 0 .../src}/diracx/db/sql/dummy/db.py | 0 .../src}/diracx/db/sql/dummy/schema.py | 4 +- .../src/diracx/db/sql/jobs}/__init__.py | 0 .../src}/diracx/db/sql/jobs/db.py | 0 .../src}/diracx/db/sql/jobs/schema.py | 0 .../src}/diracx/db/sql/jobs/status_utility.py | 0 .../db/sql/sandbox_metadata}/__init__.py | 0 .../src}/diracx/db/sql/sandbox_metadata/db.py | 0 .../diracx/db/sql/sandbox_metadata/schema.py | 0 {src => diracx-db/src}/diracx/db/sql/utils.py | 0 {tests => diracx-db/tests}/db/__init__.py | 0 .../tests}/db/auth/test_authorization_flow.py | 0 .../tests}/db/auth/test_device_flow.py | 0 .../tests}/db/auth/test_refresh_token.py | 0 .../tests}/db/jobs/test_jobDB.py | 0 .../tests}/db/jobs/test_jobLoggingDB.py | 0 .../tests}/db/opensearch/test_connection.py | 3 +- .../db/opensearch/test_index_template.py | 2 +- .../tests}/db/opensearch/test_search.py | 3 +- {tests => diracx-db/tests}/db/test_dummyDB.py | 0 .../tests}/db/test_sandbox_metadata.py | 0 diracx-routers/pyproject.toml | 45 +++++++++ .../src}/diracx/routers/__init__.py | 0 .../src}/diracx/routers/auth.py | 0 .../src}/diracx/routers/configuration.py | 0 .../src}/diracx/routers/dependencies.py | 0 .../src}/diracx/routers/fastapi_classes.py | 0 .../diracx/routers/job_manager/__init__.py | 0 .../diracx/routers/job_manager/sandboxes.py | 0 .../src}/diracx/routers/well_known.py | 0 .../tests/routers}/__init__.py | 0 .../routers/auth/test_legacy_exchange.py | 0 .../tests}/routers/auth/test_standard.py | 2 +- .../.well-known/openid-configuration | 0 .../tests}/routers/jobs/test_sandboxes.py | 0 .../tests}/routers/test_config_manager.py | 0 .../tests}/routers/test_generic.py | 0 .../tests}/routers/test_job_manager.py | 0 diracx-testing/pyproject.toml | 28 ++++++ .../src/diracx/testing/__init__.py | 0 .../src/diracx/testing/os.py | 0 pyproject.toml | 28 +++--- setup.cfg | 91 ------------------- src/diracx/__init__.py | 12 --- src/diracx/py.typed | 0 tests/db/opensearch/__init__.py | 0 tests/routers/__init__.py | 0 tests/routers/auth/__init__.py | 0 tests/routers/jobs/__init__.py | 0 128 files changed, 276 insertions(+), 124 deletions(-) create mode 100644 diracx-api/pyproject.toml rename {src => diracx-api/src}/diracx/api/__init__.py (100%) rename {src => diracx-api/src}/diracx/api/jobs.py (100%) rename {src => diracx-api/src}/diracx/api/utils.py (100%) rename {src/diracx/core => diracx-api/tests/api}/__init__.py (100%) rename {tests => diracx-api/tests}/api/test_jobs.py (100%) rename {tests => diracx-api/tests}/api/test_utils.py (100%) create mode 100644 diracx-cli/pyproject.toml rename {src => diracx-cli/src}/diracx/cli/__init__.py (100%) rename {src/diracx => diracx-cli/src/diracx/cli}/__main__.py (100%) rename {src => diracx-cli/src}/diracx/cli/internal/__init__.py (100%) rename {src => diracx-cli/src}/diracx/cli/internal/legacy.py (100%) rename {src => diracx-cli/src}/diracx/cli/jobs.py (100%) rename {src => diracx-cli/src}/diracx/cli/utils.py (100%) rename {src/diracx/db/sql/auth => diracx-cli/tests/cli}/__init__.py (100%) rename {tests => diracx-cli/tests}/cli/legacy/cs_sync/convert_integration_test.yaml (100%) rename {tests => diracx-cli/tests}/cli/legacy/cs_sync/integration_test.cfg (100%) rename {tests => diracx-cli/tests}/cli/legacy/cs_sync/integration_test.yaml (100%) rename {tests => diracx-cli/tests}/cli/legacy/cs_sync/integration_test_secret.cfg (100%) rename {tests => diracx-cli/tests}/cli/legacy/cs_sync/test_cssync.py (100%) rename {tests => diracx-cli/tests}/cli/legacy/test_legacy.py (100%) rename {tests => diracx-cli/tests}/cli/test_internal.py (100%) rename {tests => diracx-cli/tests}/cli/test_jobs.py (100%) rename {tests => diracx-cli/tests}/cli/test_login.py (100%) create mode 100644 diracx-client/pyproject.toml rename {src => diracx-client/src}/diracx/client/__init__.py (100%) rename {src => diracx-client/src}/diracx/client/_client.py (100%) rename {src => diracx-client/src}/diracx/client/_configuration.py (100%) rename {src => diracx-client/src}/diracx/client/_patch.py (100%) rename {src => diracx-client/src}/diracx/client/_serialization.py (100%) rename {src => diracx-client/src}/diracx/client/_vendor.py (100%) rename {src => diracx-client/src}/diracx/client/aio/__init__.py (100%) rename {src => diracx-client/src}/diracx/client/aio/_client.py (100%) rename {src => diracx-client/src}/diracx/client/aio/_configuration.py (100%) rename {src => diracx-client/src}/diracx/client/aio/_patch.py (100%) rename {src => diracx-client/src}/diracx/client/aio/_vendor.py (100%) rename {src => diracx-client/src}/diracx/client/aio/operations/__init__.py (100%) rename {src => diracx-client/src}/diracx/client/aio/operations/_operations.py (100%) rename {src => diracx-client/src}/diracx/client/aio/operations/_patch.py (100%) rename {src => diracx-client/src}/diracx/client/models/__init__.py (100%) rename {src => diracx-client/src}/diracx/client/models/_enums.py (100%) rename {src => diracx-client/src}/diracx/client/models/_models.py (100%) rename {src => diracx-client/src}/diracx/client/models/_patch.py (100%) rename {src => diracx-client/src}/diracx/client/operations/__init__.py (100%) rename {src => diracx-client/src}/diracx/client/operations/_operations.py (100%) rename {src => diracx-client/src}/diracx/client/operations/_patch.py (100%) rename {src => diracx-client/src}/diracx/client/py.typed (100%) rename {src/diracx/db/sql/dummy => diracx-client/tests/client}/__init__.py (100%) rename {tests => diracx-client/tests}/client/test_regenerate.py (100%) create mode 100644 diracx-core/pyproject.toml rename {src/diracx/db/sql/jobs => diracx-core/src/diracx/core}/__init__.py (100%) rename {src => diracx-core/src}/diracx/core/config/__init__.py (100%) rename {src => diracx-core/src}/diracx/core/config/schema.py (100%) rename {src => diracx-core/src}/diracx/core/exceptions.py (100%) rename {src => diracx-core/src}/diracx/core/extensions.py (100%) rename {src => diracx-core/src}/diracx/core/models.py (100%) rename {src => diracx-core/src}/diracx/core/preferences.py (100%) rename {src => diracx-core/src}/diracx/core/properties.py (100%) rename {src => diracx-core/src}/diracx/core/s3.py (100%) rename {src => diracx-core/src}/diracx/core/settings.py (100%) rename {src => diracx-core/src}/diracx/core/utils.py (100%) rename {src/diracx/db/sql/sandbox_metadata => diracx-core/tests/core}/__init__.py (100%) rename {tests => diracx-core/tests}/core/test_extensions.py (100%) rename {tests => diracx-core/tests}/core/test_s3.py (100%) rename {tests => diracx-core/tests}/core/test_secrets.py (100%) rename {tests => diracx-core/tests}/core/test_utils.py (100%) create mode 100644 diracx-db/pyproject.toml rename {src => diracx-db/src}/diracx/db/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/__main__.py (100%) rename {src => diracx-db/src}/diracx/db/exceptions.py (100%) rename {src => diracx-db/src}/diracx/db/os/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/os/job_parameters.py (100%) rename {src => diracx-db/src}/diracx/db/os/utils.py (100%) rename {src => diracx-db/src}/diracx/db/sql/__init__.py (100%) rename {tests/api => diracx-db/src/diracx/db/sql/auth}/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/sql/auth/db.py (100%) rename {src => diracx-db/src}/diracx/db/sql/auth/schema.py (100%) rename {tests/cli => diracx-db/src/diracx/db/sql/dummy}/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/sql/dummy/db.py (100%) rename {src => diracx-db/src}/diracx/db/sql/dummy/schema.py (100%) rename {tests/cli/legacy => diracx-db/src/diracx/db/sql/jobs}/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/sql/jobs/db.py (100%) rename {src => diracx-db/src}/diracx/db/sql/jobs/schema.py (100%) rename {src => diracx-db/src}/diracx/db/sql/jobs/status_utility.py (100%) rename {tests/cli/legacy/cs_sync => diracx-db/src/diracx/db/sql/sandbox_metadata}/__init__.py (100%) rename {src => diracx-db/src}/diracx/db/sql/sandbox_metadata/db.py (100%) rename {src => diracx-db/src}/diracx/db/sql/sandbox_metadata/schema.py (100%) rename {src => diracx-db/src}/diracx/db/sql/utils.py (100%) rename {tests => diracx-db/tests}/db/__init__.py (100%) rename {tests => diracx-db/tests}/db/auth/test_authorization_flow.py (100%) rename {tests => diracx-db/tests}/db/auth/test_device_flow.py (100%) rename {tests => diracx-db/tests}/db/auth/test_refresh_token.py (100%) rename {tests => diracx-db/tests}/db/jobs/test_jobDB.py (100%) rename {tests => diracx-db/tests}/db/jobs/test_jobLoggingDB.py (100%) rename {tests => diracx-db/tests}/db/opensearch/test_connection.py (97%) rename {tests => diracx-db/tests}/db/opensearch/test_index_template.py (97%) rename {tests => diracx-db/tests}/db/opensearch/test_search.py (99%) rename {tests => diracx-db/tests}/db/test_dummyDB.py (100%) rename {tests => diracx-db/tests}/db/test_sandbox_metadata.py (100%) create mode 100644 diracx-routers/pyproject.toml rename {src => diracx-routers/src}/diracx/routers/__init__.py (100%) rename {src => diracx-routers/src}/diracx/routers/auth.py (100%) rename {src => diracx-routers/src}/diracx/routers/configuration.py (100%) rename {src => diracx-routers/src}/diracx/routers/dependencies.py (100%) rename {src => diracx-routers/src}/diracx/routers/fastapi_classes.py (100%) rename {src => diracx-routers/src}/diracx/routers/job_manager/__init__.py (100%) rename {src => diracx-routers/src}/diracx/routers/job_manager/sandboxes.py (100%) rename {src => diracx-routers/src}/diracx/routers/well_known.py (100%) rename {tests/db/auth => diracx-routers/tests/routers}/__init__.py (100%) rename {tests => diracx-routers/tests}/routers/auth/test_legacy_exchange.py (100%) rename {tests => diracx-routers/tests}/routers/auth/test_standard.py (99%) rename {tests => diracx-routers/tests/routers}/data/lhcb-auth.web.cern.ch/.well-known/openid-configuration (100%) rename {tests => diracx-routers/tests}/routers/jobs/test_sandboxes.py (100%) rename {tests => diracx-routers/tests}/routers/test_config_manager.py (100%) rename {tests => diracx-routers/tests}/routers/test_generic.py (100%) rename {tests => diracx-routers/tests}/routers/test_job_manager.py (100%) create mode 100644 diracx-testing/pyproject.toml rename tests/conftest.py => diracx-testing/src/diracx/testing/__init__.py (100%) rename tests/db/opensearch/conftest.py => diracx-testing/src/diracx/testing/os.py (100%) delete mode 100644 setup.cfg delete mode 100644 src/diracx/__init__.py delete mode 100644 src/diracx/py.typed delete mode 100644 tests/db/opensearch/__init__.py delete mode 100644 tests/routers/__init__.py delete mode 100644 tests/routers/auth/__init__.py delete mode 100644 tests/routers/jobs/__init__.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc2d6dae3..d5968d65b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,4 +35,4 @@ repos: - types-requests - types-aiobotocore[essential] - boto3-stubs[essential] - exclude: ^(src/diracx/client/|tests/|build) + exclude: ^(diracx-client/src/diracx/client/|diracx-[a-z]+/tests/|diracx-testing/|build) diff --git a/diracx-api/pyproject.toml b/diracx-api/pyproject.toml new file mode 100644 index 000000000..66f15deaa --- /dev/null +++ b/diracx-api/pyproject.toml @@ -0,0 +1,30 @@ +[project] +name = "diracx-api" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "diracx-client", + "diracx-core", + "httpx", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/api/__init__.py b/diracx-api/src/diracx/api/__init__.py similarity index 100% rename from src/diracx/api/__init__.py rename to diracx-api/src/diracx/api/__init__.py diff --git a/src/diracx/api/jobs.py b/diracx-api/src/diracx/api/jobs.py similarity index 100% rename from src/diracx/api/jobs.py rename to diracx-api/src/diracx/api/jobs.py diff --git a/src/diracx/api/utils.py b/diracx-api/src/diracx/api/utils.py similarity index 100% rename from src/diracx/api/utils.py rename to diracx-api/src/diracx/api/utils.py diff --git a/src/diracx/core/__init__.py b/diracx-api/tests/api/__init__.py similarity index 100% rename from src/diracx/core/__init__.py rename to diracx-api/tests/api/__init__.py diff --git a/tests/api/test_jobs.py b/diracx-api/tests/api/test_jobs.py similarity index 100% rename from tests/api/test_jobs.py rename to diracx-api/tests/api/test_jobs.py diff --git a/tests/api/test_utils.py b/diracx-api/tests/api/test_utils.py similarity index 100% rename from tests/api/test_utils.py rename to diracx-api/tests/api/test_utils.py diff --git a/diracx-cli/pyproject.toml b/diracx-cli/pyproject.toml new file mode 100644 index 000000000..19c2d3094 --- /dev/null +++ b/diracx-cli/pyproject.toml @@ -0,0 +1,39 @@ +[project] +name = "diracx-cli" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "diraccfg", # TODO: Should this be an extra + "diracx-api", + "diracx-client", + "diracx-core", + "gitpython", + "pydantic", + "rich", + "typer", + "pyyaml", +] +dynamic = ["version"] + +[project.scripts] +dirac = "diracx.cli:app" + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/cli/__init__.py b/diracx-cli/src/diracx/cli/__init__.py similarity index 100% rename from src/diracx/cli/__init__.py rename to diracx-cli/src/diracx/cli/__init__.py diff --git a/src/diracx/__main__.py b/diracx-cli/src/diracx/cli/__main__.py similarity index 100% rename from src/diracx/__main__.py rename to diracx-cli/src/diracx/cli/__main__.py diff --git a/src/diracx/cli/internal/__init__.py b/diracx-cli/src/diracx/cli/internal/__init__.py similarity index 100% rename from src/diracx/cli/internal/__init__.py rename to diracx-cli/src/diracx/cli/internal/__init__.py diff --git a/src/diracx/cli/internal/legacy.py b/diracx-cli/src/diracx/cli/internal/legacy.py similarity index 100% rename from src/diracx/cli/internal/legacy.py rename to diracx-cli/src/diracx/cli/internal/legacy.py diff --git a/src/diracx/cli/jobs.py b/diracx-cli/src/diracx/cli/jobs.py similarity index 100% rename from src/diracx/cli/jobs.py rename to diracx-cli/src/diracx/cli/jobs.py diff --git a/src/diracx/cli/utils.py b/diracx-cli/src/diracx/cli/utils.py similarity index 100% rename from src/diracx/cli/utils.py rename to diracx-cli/src/diracx/cli/utils.py diff --git a/src/diracx/db/sql/auth/__init__.py b/diracx-cli/tests/cli/__init__.py similarity index 100% rename from src/diracx/db/sql/auth/__init__.py rename to diracx-cli/tests/cli/__init__.py diff --git a/tests/cli/legacy/cs_sync/convert_integration_test.yaml b/diracx-cli/tests/cli/legacy/cs_sync/convert_integration_test.yaml similarity index 100% rename from tests/cli/legacy/cs_sync/convert_integration_test.yaml rename to diracx-cli/tests/cli/legacy/cs_sync/convert_integration_test.yaml diff --git a/tests/cli/legacy/cs_sync/integration_test.cfg b/diracx-cli/tests/cli/legacy/cs_sync/integration_test.cfg similarity index 100% rename from tests/cli/legacy/cs_sync/integration_test.cfg rename to diracx-cli/tests/cli/legacy/cs_sync/integration_test.cfg diff --git a/tests/cli/legacy/cs_sync/integration_test.yaml b/diracx-cli/tests/cli/legacy/cs_sync/integration_test.yaml similarity index 100% rename from tests/cli/legacy/cs_sync/integration_test.yaml rename to diracx-cli/tests/cli/legacy/cs_sync/integration_test.yaml diff --git a/tests/cli/legacy/cs_sync/integration_test_secret.cfg b/diracx-cli/tests/cli/legacy/cs_sync/integration_test_secret.cfg similarity index 100% rename from tests/cli/legacy/cs_sync/integration_test_secret.cfg rename to diracx-cli/tests/cli/legacy/cs_sync/integration_test_secret.cfg diff --git a/tests/cli/legacy/cs_sync/test_cssync.py b/diracx-cli/tests/cli/legacy/cs_sync/test_cssync.py similarity index 100% rename from tests/cli/legacy/cs_sync/test_cssync.py rename to diracx-cli/tests/cli/legacy/cs_sync/test_cssync.py diff --git a/tests/cli/legacy/test_legacy.py b/diracx-cli/tests/cli/legacy/test_legacy.py similarity index 100% rename from tests/cli/legacy/test_legacy.py rename to diracx-cli/tests/cli/legacy/test_legacy.py diff --git a/tests/cli/test_internal.py b/diracx-cli/tests/cli/test_internal.py similarity index 100% rename from tests/cli/test_internal.py rename to diracx-cli/tests/cli/test_internal.py diff --git a/tests/cli/test_jobs.py b/diracx-cli/tests/cli/test_jobs.py similarity index 100% rename from tests/cli/test_jobs.py rename to diracx-cli/tests/cli/test_jobs.py diff --git a/tests/cli/test_login.py b/diracx-cli/tests/cli/test_login.py similarity index 100% rename from tests/cli/test_login.py rename to diracx-cli/tests/cli/test_login.py diff --git a/diracx-client/pyproject.toml b/diracx-client/pyproject.toml new file mode 100644 index 000000000..d5755c670 --- /dev/null +++ b/diracx-client/pyproject.toml @@ -0,0 +1,31 @@ +[project] +name = "diracx-client" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "azure-core", + "diracx-core", + "isodate", + "requests", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/client/__init__.py b/diracx-client/src/diracx/client/__init__.py similarity index 100% rename from src/diracx/client/__init__.py rename to diracx-client/src/diracx/client/__init__.py diff --git a/src/diracx/client/_client.py b/diracx-client/src/diracx/client/_client.py similarity index 100% rename from src/diracx/client/_client.py rename to diracx-client/src/diracx/client/_client.py diff --git a/src/diracx/client/_configuration.py b/diracx-client/src/diracx/client/_configuration.py similarity index 100% rename from src/diracx/client/_configuration.py rename to diracx-client/src/diracx/client/_configuration.py diff --git a/src/diracx/client/_patch.py b/diracx-client/src/diracx/client/_patch.py similarity index 100% rename from src/diracx/client/_patch.py rename to diracx-client/src/diracx/client/_patch.py diff --git a/src/diracx/client/_serialization.py b/diracx-client/src/diracx/client/_serialization.py similarity index 100% rename from src/diracx/client/_serialization.py rename to diracx-client/src/diracx/client/_serialization.py diff --git a/src/diracx/client/_vendor.py b/diracx-client/src/diracx/client/_vendor.py similarity index 100% rename from src/diracx/client/_vendor.py rename to diracx-client/src/diracx/client/_vendor.py diff --git a/src/diracx/client/aio/__init__.py b/diracx-client/src/diracx/client/aio/__init__.py similarity index 100% rename from src/diracx/client/aio/__init__.py rename to diracx-client/src/diracx/client/aio/__init__.py diff --git a/src/diracx/client/aio/_client.py b/diracx-client/src/diracx/client/aio/_client.py similarity index 100% rename from src/diracx/client/aio/_client.py rename to diracx-client/src/diracx/client/aio/_client.py diff --git a/src/diracx/client/aio/_configuration.py b/diracx-client/src/diracx/client/aio/_configuration.py similarity index 100% rename from src/diracx/client/aio/_configuration.py rename to diracx-client/src/diracx/client/aio/_configuration.py diff --git a/src/diracx/client/aio/_patch.py b/diracx-client/src/diracx/client/aio/_patch.py similarity index 100% rename from src/diracx/client/aio/_patch.py rename to diracx-client/src/diracx/client/aio/_patch.py diff --git a/src/diracx/client/aio/_vendor.py b/diracx-client/src/diracx/client/aio/_vendor.py similarity index 100% rename from src/diracx/client/aio/_vendor.py rename to diracx-client/src/diracx/client/aio/_vendor.py diff --git a/src/diracx/client/aio/operations/__init__.py b/diracx-client/src/diracx/client/aio/operations/__init__.py similarity index 100% rename from src/diracx/client/aio/operations/__init__.py rename to diracx-client/src/diracx/client/aio/operations/__init__.py diff --git a/src/diracx/client/aio/operations/_operations.py b/diracx-client/src/diracx/client/aio/operations/_operations.py similarity index 100% rename from src/diracx/client/aio/operations/_operations.py rename to diracx-client/src/diracx/client/aio/operations/_operations.py diff --git a/src/diracx/client/aio/operations/_patch.py b/diracx-client/src/diracx/client/aio/operations/_patch.py similarity index 100% rename from src/diracx/client/aio/operations/_patch.py rename to diracx-client/src/diracx/client/aio/operations/_patch.py diff --git a/src/diracx/client/models/__init__.py b/diracx-client/src/diracx/client/models/__init__.py similarity index 100% rename from src/diracx/client/models/__init__.py rename to diracx-client/src/diracx/client/models/__init__.py diff --git a/src/diracx/client/models/_enums.py b/diracx-client/src/diracx/client/models/_enums.py similarity index 100% rename from src/diracx/client/models/_enums.py rename to diracx-client/src/diracx/client/models/_enums.py diff --git a/src/diracx/client/models/_models.py b/diracx-client/src/diracx/client/models/_models.py similarity index 100% rename from src/diracx/client/models/_models.py rename to diracx-client/src/diracx/client/models/_models.py diff --git a/src/diracx/client/models/_patch.py b/diracx-client/src/diracx/client/models/_patch.py similarity index 100% rename from src/diracx/client/models/_patch.py rename to diracx-client/src/diracx/client/models/_patch.py diff --git a/src/diracx/client/operations/__init__.py b/diracx-client/src/diracx/client/operations/__init__.py similarity index 100% rename from src/diracx/client/operations/__init__.py rename to diracx-client/src/diracx/client/operations/__init__.py diff --git a/src/diracx/client/operations/_operations.py b/diracx-client/src/diracx/client/operations/_operations.py similarity index 100% rename from src/diracx/client/operations/_operations.py rename to diracx-client/src/diracx/client/operations/_operations.py diff --git a/src/diracx/client/operations/_patch.py b/diracx-client/src/diracx/client/operations/_patch.py similarity index 100% rename from src/diracx/client/operations/_patch.py rename to diracx-client/src/diracx/client/operations/_patch.py diff --git a/src/diracx/client/py.typed b/diracx-client/src/diracx/client/py.typed similarity index 100% rename from src/diracx/client/py.typed rename to diracx-client/src/diracx/client/py.typed diff --git a/src/diracx/db/sql/dummy/__init__.py b/diracx-client/tests/client/__init__.py similarity index 100% rename from src/diracx/db/sql/dummy/__init__.py rename to diracx-client/tests/client/__init__.py diff --git a/tests/client/test_regenerate.py b/diracx-client/tests/client/test_regenerate.py similarity index 100% rename from tests/client/test_regenerate.py rename to diracx-client/tests/client/test_regenerate.py diff --git a/diracx-core/pyproject.toml b/diracx-core/pyproject.toml new file mode 100644 index 000000000..b2653cc54 --- /dev/null +++ b/diracx-core/pyproject.toml @@ -0,0 +1,37 @@ +[project] +name = "diracx-core" +description = "Common code used by all DiracX packages" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "authlib", + "botocore", + "cachetools", + "fastapi", + "gitpython", + "pydantic", + "pyyaml", +] +dynamic = ["version"] + +[project.entry-points."diracx"] +properties_module = "diracx.core:properties" + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/db/sql/jobs/__init__.py b/diracx-core/src/diracx/core/__init__.py similarity index 100% rename from src/diracx/db/sql/jobs/__init__.py rename to diracx-core/src/diracx/core/__init__.py diff --git a/src/diracx/core/config/__init__.py b/diracx-core/src/diracx/core/config/__init__.py similarity index 100% rename from src/diracx/core/config/__init__.py rename to diracx-core/src/diracx/core/config/__init__.py diff --git a/src/diracx/core/config/schema.py b/diracx-core/src/diracx/core/config/schema.py similarity index 100% rename from src/diracx/core/config/schema.py rename to diracx-core/src/diracx/core/config/schema.py diff --git a/src/diracx/core/exceptions.py b/diracx-core/src/diracx/core/exceptions.py similarity index 100% rename from src/diracx/core/exceptions.py rename to diracx-core/src/diracx/core/exceptions.py diff --git a/src/diracx/core/extensions.py b/diracx-core/src/diracx/core/extensions.py similarity index 100% rename from src/diracx/core/extensions.py rename to diracx-core/src/diracx/core/extensions.py diff --git a/src/diracx/core/models.py b/diracx-core/src/diracx/core/models.py similarity index 100% rename from src/diracx/core/models.py rename to diracx-core/src/diracx/core/models.py diff --git a/src/diracx/core/preferences.py b/diracx-core/src/diracx/core/preferences.py similarity index 100% rename from src/diracx/core/preferences.py rename to diracx-core/src/diracx/core/preferences.py diff --git a/src/diracx/core/properties.py b/diracx-core/src/diracx/core/properties.py similarity index 100% rename from src/diracx/core/properties.py rename to diracx-core/src/diracx/core/properties.py diff --git a/src/diracx/core/s3.py b/diracx-core/src/diracx/core/s3.py similarity index 100% rename from src/diracx/core/s3.py rename to diracx-core/src/diracx/core/s3.py diff --git a/src/diracx/core/settings.py b/diracx-core/src/diracx/core/settings.py similarity index 100% rename from src/diracx/core/settings.py rename to diracx-core/src/diracx/core/settings.py diff --git a/src/diracx/core/utils.py b/diracx-core/src/diracx/core/utils.py similarity index 100% rename from src/diracx/core/utils.py rename to diracx-core/src/diracx/core/utils.py diff --git a/src/diracx/db/sql/sandbox_metadata/__init__.py b/diracx-core/tests/core/__init__.py similarity index 100% rename from src/diracx/db/sql/sandbox_metadata/__init__.py rename to diracx-core/tests/core/__init__.py diff --git a/tests/core/test_extensions.py b/diracx-core/tests/core/test_extensions.py similarity index 100% rename from tests/core/test_extensions.py rename to diracx-core/tests/core/test_extensions.py diff --git a/tests/core/test_s3.py b/diracx-core/tests/core/test_s3.py similarity index 100% rename from tests/core/test_s3.py rename to diracx-core/tests/core/test_s3.py diff --git a/tests/core/test_secrets.py b/diracx-core/tests/core/test_secrets.py similarity index 100% rename from tests/core/test_secrets.py rename to diracx-core/tests/core/test_secrets.py diff --git a/tests/core/test_utils.py b/diracx-core/tests/core/test_utils.py similarity index 100% rename from tests/core/test_utils.py rename to diracx-core/tests/core/test_utils.py diff --git a/diracx-db/pyproject.toml b/diracx-db/pyproject.toml new file mode 100644 index 000000000..6df5cd5da --- /dev/null +++ b/diracx-db/pyproject.toml @@ -0,0 +1,43 @@ +[project] +name = "diracx-db" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "dirac", + "diracx-core", + "fastapi", + "opensearch-py", + "pydantic", + "sqlalchemy", +] +dynamic = ["version"] + +[project.entry-points."diracx.db.sql"] +AuthDB = "diracx.db.sql:AuthDB" +JobDB = "diracx.db.sql:JobDB" +JobLoggingDB = "diracx.db.sql:JobLoggingDB" +SandboxMetadataDB = "diracx.db.sql:SandboxMetadataDB" +TaskQueueDB = "diracx.db.sql:TaskQueueDB" + +[project.entry-points."diracx.db.os"] +JobParametersDB = "diracx.db.os:JobParametersDB" + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/db/__init__.py b/diracx-db/src/diracx/db/__init__.py similarity index 100% rename from src/diracx/db/__init__.py rename to diracx-db/src/diracx/db/__init__.py diff --git a/src/diracx/db/__main__.py b/diracx-db/src/diracx/db/__main__.py similarity index 100% rename from src/diracx/db/__main__.py rename to diracx-db/src/diracx/db/__main__.py diff --git a/src/diracx/db/exceptions.py b/diracx-db/src/diracx/db/exceptions.py similarity index 100% rename from src/diracx/db/exceptions.py rename to diracx-db/src/diracx/db/exceptions.py diff --git a/src/diracx/db/os/__init__.py b/diracx-db/src/diracx/db/os/__init__.py similarity index 100% rename from src/diracx/db/os/__init__.py rename to diracx-db/src/diracx/db/os/__init__.py diff --git a/src/diracx/db/os/job_parameters.py b/diracx-db/src/diracx/db/os/job_parameters.py similarity index 100% rename from src/diracx/db/os/job_parameters.py rename to diracx-db/src/diracx/db/os/job_parameters.py diff --git a/src/diracx/db/os/utils.py b/diracx-db/src/diracx/db/os/utils.py similarity index 100% rename from src/diracx/db/os/utils.py rename to diracx-db/src/diracx/db/os/utils.py diff --git a/src/diracx/db/sql/__init__.py b/diracx-db/src/diracx/db/sql/__init__.py similarity index 100% rename from src/diracx/db/sql/__init__.py rename to diracx-db/src/diracx/db/sql/__init__.py diff --git a/tests/api/__init__.py b/diracx-db/src/diracx/db/sql/auth/__init__.py similarity index 100% rename from tests/api/__init__.py rename to diracx-db/src/diracx/db/sql/auth/__init__.py diff --git a/src/diracx/db/sql/auth/db.py b/diracx-db/src/diracx/db/sql/auth/db.py similarity index 100% rename from src/diracx/db/sql/auth/db.py rename to diracx-db/src/diracx/db/sql/auth/db.py diff --git a/src/diracx/db/sql/auth/schema.py b/diracx-db/src/diracx/db/sql/auth/schema.py similarity index 100% rename from src/diracx/db/sql/auth/schema.py rename to diracx-db/src/diracx/db/sql/auth/schema.py diff --git a/tests/cli/__init__.py b/diracx-db/src/diracx/db/sql/dummy/__init__.py similarity index 100% rename from tests/cli/__init__.py rename to diracx-db/src/diracx/db/sql/dummy/__init__.py diff --git a/src/diracx/db/sql/dummy/db.py b/diracx-db/src/diracx/db/sql/dummy/db.py similarity index 100% rename from src/diracx/db/sql/dummy/db.py rename to diracx-db/src/diracx/db/sql/dummy/db.py diff --git a/src/diracx/db/sql/dummy/schema.py b/diracx-db/src/diracx/db/sql/dummy/schema.py similarity index 100% rename from src/diracx/db/sql/dummy/schema.py rename to diracx-db/src/diracx/db/sql/dummy/schema.py index d81e0a8f0..ebb37b8d1 100644 --- a/src/diracx/db/sql/dummy/schema.py +++ b/diracx-db/src/diracx/db/sql/dummy/schema.py @@ -1,8 +1,8 @@ +# The utils class define some boilerplate types that should be used +# in place of the SQLAlchemy one. Have a look at them from sqlalchemy import ForeignKey, Integer, String, Uuid from sqlalchemy.orm import declarative_base -# The utils class define some boilerplate types that should be used -# in place of the SQLAlchemy one. Have a look at them from diracx.db.sql.utils import Column, DateNowColumn Base = declarative_base() diff --git a/tests/cli/legacy/__init__.py b/diracx-db/src/diracx/db/sql/jobs/__init__.py similarity index 100% rename from tests/cli/legacy/__init__.py rename to diracx-db/src/diracx/db/sql/jobs/__init__.py diff --git a/src/diracx/db/sql/jobs/db.py b/diracx-db/src/diracx/db/sql/jobs/db.py similarity index 100% rename from src/diracx/db/sql/jobs/db.py rename to diracx-db/src/diracx/db/sql/jobs/db.py diff --git a/src/diracx/db/sql/jobs/schema.py b/diracx-db/src/diracx/db/sql/jobs/schema.py similarity index 100% rename from src/diracx/db/sql/jobs/schema.py rename to diracx-db/src/diracx/db/sql/jobs/schema.py diff --git a/src/diracx/db/sql/jobs/status_utility.py b/diracx-db/src/diracx/db/sql/jobs/status_utility.py similarity index 100% rename from src/diracx/db/sql/jobs/status_utility.py rename to diracx-db/src/diracx/db/sql/jobs/status_utility.py diff --git a/tests/cli/legacy/cs_sync/__init__.py b/diracx-db/src/diracx/db/sql/sandbox_metadata/__init__.py similarity index 100% rename from tests/cli/legacy/cs_sync/__init__.py rename to diracx-db/src/diracx/db/sql/sandbox_metadata/__init__.py diff --git a/src/diracx/db/sql/sandbox_metadata/db.py b/diracx-db/src/diracx/db/sql/sandbox_metadata/db.py similarity index 100% rename from src/diracx/db/sql/sandbox_metadata/db.py rename to diracx-db/src/diracx/db/sql/sandbox_metadata/db.py diff --git a/src/diracx/db/sql/sandbox_metadata/schema.py b/diracx-db/src/diracx/db/sql/sandbox_metadata/schema.py similarity index 100% rename from src/diracx/db/sql/sandbox_metadata/schema.py rename to diracx-db/src/diracx/db/sql/sandbox_metadata/schema.py diff --git a/src/diracx/db/sql/utils.py b/diracx-db/src/diracx/db/sql/utils.py similarity index 100% rename from src/diracx/db/sql/utils.py rename to diracx-db/src/diracx/db/sql/utils.py diff --git a/tests/db/__init__.py b/diracx-db/tests/db/__init__.py similarity index 100% rename from tests/db/__init__.py rename to diracx-db/tests/db/__init__.py diff --git a/tests/db/auth/test_authorization_flow.py b/diracx-db/tests/db/auth/test_authorization_flow.py similarity index 100% rename from tests/db/auth/test_authorization_flow.py rename to diracx-db/tests/db/auth/test_authorization_flow.py diff --git a/tests/db/auth/test_device_flow.py b/diracx-db/tests/db/auth/test_device_flow.py similarity index 100% rename from tests/db/auth/test_device_flow.py rename to diracx-db/tests/db/auth/test_device_flow.py diff --git a/tests/db/auth/test_refresh_token.py b/diracx-db/tests/db/auth/test_refresh_token.py similarity index 100% rename from tests/db/auth/test_refresh_token.py rename to diracx-db/tests/db/auth/test_refresh_token.py diff --git a/tests/db/jobs/test_jobDB.py b/diracx-db/tests/db/jobs/test_jobDB.py similarity index 100% rename from tests/db/jobs/test_jobDB.py rename to diracx-db/tests/db/jobs/test_jobDB.py diff --git a/tests/db/jobs/test_jobLoggingDB.py b/diracx-db/tests/db/jobs/test_jobLoggingDB.py similarity index 100% rename from tests/db/jobs/test_jobLoggingDB.py rename to diracx-db/tests/db/jobs/test_jobLoggingDB.py diff --git a/tests/db/opensearch/test_connection.py b/diracx-db/tests/db/opensearch/test_connection.py similarity index 97% rename from tests/db/opensearch/test_connection.py rename to diracx-db/tests/db/opensearch/test_connection.py index 953cb6d19..5a376b027 100644 --- a/tests/db/opensearch/test_connection.py +++ b/diracx-db/tests/db/opensearch/test_connection.py @@ -3,8 +3,7 @@ import pytest from diracx.db.os.utils import OpenSearchDBUnavailable - -from .conftest import OPENSEARCH_PORT, DummyOSDB, require_port_availability +from diracx.testing.os import OPENSEARCH_PORT, DummyOSDB, require_port_availability async def _ensure_db_unavailable(db: DummyOSDB): diff --git a/tests/db/opensearch/test_index_template.py b/diracx-db/tests/db/opensearch/test_index_template.py similarity index 97% rename from tests/db/opensearch/test_index_template.py rename to diracx-db/tests/db/opensearch/test_index_template.py index 5760ee451..8f8ad0ad7 100644 --- a/tests/db/opensearch/test_index_template.py +++ b/diracx-db/tests/db/opensearch/test_index_template.py @@ -5,7 +5,7 @@ import opensearchpy import pytest -from .conftest import DummyOSDB +from diracx.testing.os import DummyOSDB DUMMY_DOCUMENT = { "DateField": datetime.now(tz=timezone.utc), diff --git a/tests/db/opensearch/test_search.py b/diracx-db/tests/db/opensearch/test_search.py similarity index 99% rename from tests/db/opensearch/test_search.py rename to diracx-db/tests/db/opensearch/test_search.py index da6a4ba19..d1b6b5f6b 100644 --- a/tests/db/opensearch/test_search.py +++ b/diracx-db/tests/db/opensearch/test_search.py @@ -5,8 +5,7 @@ import pytest from diracx.core.exceptions import InvalidQueryError - -from .conftest import DummyOSDB +from diracx.testing.os import DummyOSDB DOC1 = { "DateField": datetime.now(tz=timezone.utc), diff --git a/tests/db/test_dummyDB.py b/diracx-db/tests/db/test_dummyDB.py similarity index 100% rename from tests/db/test_dummyDB.py rename to diracx-db/tests/db/test_dummyDB.py diff --git a/tests/db/test_sandbox_metadata.py b/diracx-db/tests/db/test_sandbox_metadata.py similarity index 100% rename from tests/db/test_sandbox_metadata.py rename to diracx-db/tests/db/test_sandbox_metadata.py diff --git a/diracx-routers/pyproject.toml b/diracx-routers/pyproject.toml new file mode 100644 index 000000000..aba3bf57c --- /dev/null +++ b/diracx-routers/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "diracx-routers" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "aiobotocore", + "authlib", + "botocore", + "cachetools", + "dirac", + "diracx-core", + "diracx-db", + "python-dotenv", # TODO: We might not need this + "fastapi", + "httpx", + "pydantic", + "sqlalchemy", +] +dynamic = ["version"] + +[project.entry-points."diracx.services"] +jobs = "diracx.routers.job_manager:router" +config = "diracx.routers.configuration:router" +auth = "diracx.routers.auth:router" +".well-known" = "diracx.routers.well_known:router" + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/src/diracx/routers/__init__.py b/diracx-routers/src/diracx/routers/__init__.py similarity index 100% rename from src/diracx/routers/__init__.py rename to diracx-routers/src/diracx/routers/__init__.py diff --git a/src/diracx/routers/auth.py b/diracx-routers/src/diracx/routers/auth.py similarity index 100% rename from src/diracx/routers/auth.py rename to diracx-routers/src/diracx/routers/auth.py diff --git a/src/diracx/routers/configuration.py b/diracx-routers/src/diracx/routers/configuration.py similarity index 100% rename from src/diracx/routers/configuration.py rename to diracx-routers/src/diracx/routers/configuration.py diff --git a/src/diracx/routers/dependencies.py b/diracx-routers/src/diracx/routers/dependencies.py similarity index 100% rename from src/diracx/routers/dependencies.py rename to diracx-routers/src/diracx/routers/dependencies.py diff --git a/src/diracx/routers/fastapi_classes.py b/diracx-routers/src/diracx/routers/fastapi_classes.py similarity index 100% rename from src/diracx/routers/fastapi_classes.py rename to diracx-routers/src/diracx/routers/fastapi_classes.py diff --git a/src/diracx/routers/job_manager/__init__.py b/diracx-routers/src/diracx/routers/job_manager/__init__.py similarity index 100% rename from src/diracx/routers/job_manager/__init__.py rename to diracx-routers/src/diracx/routers/job_manager/__init__.py diff --git a/src/diracx/routers/job_manager/sandboxes.py b/diracx-routers/src/diracx/routers/job_manager/sandboxes.py similarity index 100% rename from src/diracx/routers/job_manager/sandboxes.py rename to diracx-routers/src/diracx/routers/job_manager/sandboxes.py diff --git a/src/diracx/routers/well_known.py b/diracx-routers/src/diracx/routers/well_known.py similarity index 100% rename from src/diracx/routers/well_known.py rename to diracx-routers/src/diracx/routers/well_known.py diff --git a/tests/db/auth/__init__.py b/diracx-routers/tests/routers/__init__.py similarity index 100% rename from tests/db/auth/__init__.py rename to diracx-routers/tests/routers/__init__.py diff --git a/tests/routers/auth/test_legacy_exchange.py b/diracx-routers/tests/routers/auth/test_legacy_exchange.py similarity index 100% rename from tests/routers/auth/test_legacy_exchange.py rename to diracx-routers/tests/routers/auth/test_legacy_exchange.py diff --git a/tests/routers/auth/test_standard.py b/diracx-routers/tests/routers/auth/test_standard.py similarity index 99% rename from tests/routers/auth/test_standard.py rename to diracx-routers/tests/routers/auth/test_standard.py index 6f384455b..6cc58a147 100644 --- a/tests/routers/auth/test_standard.py +++ b/diracx-routers/tests/routers/auth/test_standard.py @@ -32,7 +32,7 @@ def non_mocked_hosts(test_client) -> list[str]: @pytest.fixture async def auth_httpx_mock(httpx_mock: HTTPXMock, monkeypatch): - data_dir = Path(__file__).parent.parent.parent / "data" + data_dir = Path(__file__).parent.parent / "data" path = "lhcb-auth.web.cern.ch/.well-known/openid-configuration" httpx_mock.add_response(url=f"https://{path}", text=(data_dir / path).read_text()) diff --git a/tests/data/lhcb-auth.web.cern.ch/.well-known/openid-configuration b/diracx-routers/tests/routers/data/lhcb-auth.web.cern.ch/.well-known/openid-configuration similarity index 100% rename from tests/data/lhcb-auth.web.cern.ch/.well-known/openid-configuration rename to diracx-routers/tests/routers/data/lhcb-auth.web.cern.ch/.well-known/openid-configuration diff --git a/tests/routers/jobs/test_sandboxes.py b/diracx-routers/tests/routers/jobs/test_sandboxes.py similarity index 100% rename from tests/routers/jobs/test_sandboxes.py rename to diracx-routers/tests/routers/jobs/test_sandboxes.py diff --git a/tests/routers/test_config_manager.py b/diracx-routers/tests/routers/test_config_manager.py similarity index 100% rename from tests/routers/test_config_manager.py rename to diracx-routers/tests/routers/test_config_manager.py diff --git a/tests/routers/test_generic.py b/diracx-routers/tests/routers/test_generic.py similarity index 100% rename from tests/routers/test_generic.py rename to diracx-routers/tests/routers/test_generic.py diff --git a/tests/routers/test_job_manager.py b/diracx-routers/tests/routers/test_job_manager.py similarity index 100% rename from tests/routers/test_job_manager.py rename to diracx-routers/tests/routers/test_job_manager.py diff --git a/diracx-testing/pyproject.toml b/diracx-testing/pyproject.toml new file mode 100644 index 000000000..c2eb6cb84 --- /dev/null +++ b/diracx-testing/pyproject.toml @@ -0,0 +1,28 @@ +[project] +name = "diracx-testing" +description = "TODO" +# readme = "../README.md" +requires-python = ">=3.10" +keywords = [] +license = {text = "GPL-3.0-only"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering", + "Topic :: System :: Distributed Computing", +] +dependencies = [ + "pytest", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +root = ".." diff --git a/tests/conftest.py b/diracx-testing/src/diracx/testing/__init__.py similarity index 100% rename from tests/conftest.py rename to diracx-testing/src/diracx/testing/__init__.py diff --git a/tests/db/opensearch/conftest.py b/diracx-testing/src/diracx/testing/os.py similarity index 100% rename from tests/db/opensearch/conftest.py rename to diracx-testing/src/diracx/testing/os.py diff --git a/pyproject.toml b/pyproject.toml index 599daabdd..4356550c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,3 @@ -[build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] -build-backend = "setuptools.build_meta" - -# Enable setuptools_scm to compute the version number from the most recent tag -# https://github.com/pypa/setuptools_scm/#pyprojecttoml-usage -[tool.setuptools_scm] - [tool.ruff] select = [ "E", # pycodestyle errrors @@ -18,8 +10,8 @@ select = [ ] ignore = ["B905", "B008", "B006"] line-length = 120 -src = ["src", "tests"] -exclude = ["src/diracx/client/"] +src = ["diracx-*/src", "diracx-*/tests"] +exclude = ["diracx-client/src/diracx/client/"] [tool.isort] profile = "black" @@ -30,7 +22,7 @@ extend-immutable-calls = ["fastapi.Depends", "fastapi.Query", "fastapi.Path", "f [tool.mypy] plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"] -exclude = ["^src/diracx/client", "^tests/", "^build/"] +exclude = ["^diracx-client/src/diracx/client", "^diracx-[a-z]+/tests/", "^diracx-testing/", "^build/"] allow_redefinition = true # strict = true enable_error_code = ["import", "attr-defined"] @@ -44,5 +36,17 @@ module = 'authlib.*' ignore_missing_imports = true [tool.pytest.ini_options] -addopts = ["-v", "--cov=diracx", "--cov-report=term-missing"] +testpaths = [ + "diracx-api/tests", + "diracx-cli/tests", + "diracx-client/tests", + "diracx-core/tests", + "diracx-db/tests", + "diracx-routers/tests", +] +addopts = [ + "-v", + "--cov=diracx", "--cov-report=term-missing", + "-pdiracx.testing", "-pdiracx.testing.os" +] asyncio_mode = "auto" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0006c3161..000000000 --- a/setup.cfg +++ /dev/null @@ -1,91 +0,0 @@ -[metadata] -name = diracx -author = DIRAC consortium -description = DiracX is the nextGen implementation of DIRAC (https://github.com/DIRACGrid/DIRAC/) -long_description = file:README.md -long_description_content_type = text/markdown -url = https://github.com/DIRACGrid/diracx -license = GPL-3.0-only -license_files = LICENSE -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Science/Research - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering - Topic :: System :: Distributed Computing -# keywords = CPAN PyPI distutils eggs package management -# project_urls = -# Documentation = https://setuptools.pypa.io/ -# Changelog = https://setuptools.pypa.io/en/stable/history.html - -[options] -packages = find_namespace: -package_dir = - = src -python_requires = >=3.10 -install_requires = - aiobotocore - authlib - aiohttp - aiomysql - aiosqlite - azure-core - cachetools - m2crypto >=0.38.0 - importlib_resources - email-validator - fastapi - gitpython - httpx - isodate - mypy - opensearch-py - pydantic ==1.10.13 - python-dotenv - python-jose - python-multipart - pyyaml - requests - rich - sqlalchemy - typer - types-cachetools - types-PyYAML - types-requests - uvicorn - - -[options.packages.find] -where = src - -[options.extras_require] -testing = - pytest >= 6 - -testing-integration = - pytest - -docs = - sphinx >= 3.5 - -[options.entry_points] -console_scripts = - dirac = diracx.cli:app -diracx = - properties_module = diracx.core:properties -diracx.db.sql = - AuthDB = diracx.db.sql:AuthDB - JobDB = diracx.db.sql:JobDB - JobLoggingDB = diracx.db.sql:JobLoggingDB - SandboxMetadataDB = diracx.db.sql:SandboxMetadataDB - TaskQueueDB = diracx.db.sql:TaskQueueDB - #DummyDB = diracx.db.sql:DummyDB -diracx.db.os = - JobParametersDB = diracx.db.os:JobParametersDB -diracx.services = - jobs = diracx.routers.job_manager:router - config = diracx.routers.configuration:router - auth = diracx.routers.auth:router - .well-known = diracx.routers.well_known:router diff --git a/src/diracx/__init__.py b/src/diracx/__init__.py deleted file mode 100644 index f80e8bebc..000000000 --- a/src/diracx/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -import logging -from importlib.metadata import PackageNotFoundError, version - -logging.basicConfig( - level=logging.WARNING, format="%(asctime)s | %(name)s | %(levelname)s | %(message)s" -) - -try: - __version__ = version("diracx") -except PackageNotFoundError: - # package is not installed - pass diff --git a/src/diracx/py.typed b/src/diracx/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/db/opensearch/__init__.py b/tests/db/opensearch/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/routers/__init__.py b/tests/routers/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/routers/auth/__init__.py b/tests/routers/auth/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/routers/jobs/__init__.py b/tests/routers/jobs/__init__.py deleted file mode 100644 index e69de29bb..000000000