Skip to content

Commit

Permalink
Split into multiple namespace packages
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Nov 4, 2023
1 parent d3b1652 commit e896d85
Show file tree
Hide file tree
Showing 128 changed files with 276 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
30 changes: 30 additions & 0 deletions diracx-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions diracx-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions diracx-client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions diracx-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions diracx-db/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions diracx-routers/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions diracx-testing/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ".."
File renamed without changes.
File renamed without changes.
28 changes: 16 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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"]
Expand All @@ -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"
Loading

0 comments on commit e896d85

Please sign in to comment.