diracx-db 0.0.1a16__tar.gz → 0.0.1a17__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/PKG-INFO +3 -3
  2. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/pyproject.toml +2 -2
  3. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/jobs/status_utility.py +1 -1
  4. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/utils.py +4 -2
  5. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/PKG-INFO +3 -3
  6. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/requires.txt +2 -2
  7. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/test_sandbox_metadata.py +5 -2
  8. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/README.md +0 -0
  9. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/setup.cfg +0 -0
  10. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/__init__.py +0 -0
  11. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/__main__.py +0 -0
  12. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/exceptions.py +0 -0
  13. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/os/__init__.py +0 -0
  14. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/os/job_parameters.py +0 -0
  15. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/os/utils.py +0 -0
  16. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/py.typed +0 -0
  17. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/__init__.py +0 -0
  18. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/auth/__init__.py +0 -0
  19. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/auth/db.py +0 -0
  20. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/auth/schema.py +0 -0
  21. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/dummy/__init__.py +0 -0
  22. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/dummy/db.py +0 -0
  23. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/dummy/schema.py +0 -0
  24. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/jobs/__init__.py +0 -0
  25. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/jobs/db.py +0 -0
  26. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/jobs/schema.py +0 -0
  27. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/sandbox_metadata/__init__.py +0 -0
  28. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/sandbox_metadata/db.py +0 -0
  29. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx/db/sql/sandbox_metadata/schema.py +0 -0
  30. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/SOURCES.txt +0 -0
  31. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/dependency_links.txt +0 -0
  32. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/entry_points.txt +0 -0
  33. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/src/diracx_db.egg-info/top_level.txt +0 -0
  34. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/auth/test_authorization_flow.py +0 -0
  35. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/auth/test_device_flow.py +0 -0
  36. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/auth/test_refresh_token.py +0 -0
  37. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/jobs/test_jobDB.py +0 -0
  38. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/jobs/test_jobLoggingDB.py +0 -0
  39. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/opensearch/test_connection.py +0 -0
  40. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/opensearch/test_index_template.py +0 -0
  41. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/opensearch/test_search.py +0 -0
  42. {diracx_db-0.0.1a16 → diracx_db-0.0.1a17}/tests/test_dummyDB.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diracx-db
3
- Version: 0.0.1a16
3
+ Version: 0.0.1a17
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -14,7 +14,7 @@ Requires-Dist: dirac
14
14
  Requires-Dist: diracx-core
15
15
  Requires-Dist: fastapi
16
16
  Requires-Dist: opensearch-py[async]
17
- Requires-Dist: pydantic
18
- Requires-Dist: sqlalchemy[aiomysql,aiosqlite]
17
+ Requires-Dist: pydantic>=2.4
18
+ Requires-Dist: sqlalchemy[aiomysql,aiosqlite]>=2
19
19
  Provides-Extra: testing
20
20
  Requires-Dist: diracx-testing; extra == "testing"
@@ -17,8 +17,8 @@ dependencies = [
17
17
  "diracx-core",
18
18
  "fastapi",
19
19
  "opensearch-py[async]",
20
- "pydantic",
21
- "sqlalchemy[aiomysql,aiosqlite]",
20
+ "pydantic >=2.4",
21
+ "sqlalchemy[aiomysql,aiosqlite] >= 2",
22
22
  ]
23
23
  dynamic = ["version"]
24
24
 
@@ -41,7 +41,7 @@ async def set_job_status(
41
41
  # transform JobStateUpdate objects into dicts
42
42
  statusDict = {}
43
43
  for key, value in status.items():
44
- statusDict[key] = {k: v for k, v in value.dict().items() if v is not None}
44
+ statusDict[key] = {k: v for k, v in value.model_dump().items() if v is not None}
45
45
 
46
46
  _, res = await job_db.search(
47
47
  parameters=["Status", "StartExecTime", "EndExecTime"],
@@ -11,7 +11,7 @@ from datetime import datetime, timedelta, timezone
11
11
  from functools import partial
12
12
  from typing import TYPE_CHECKING, AsyncIterator, Self, cast
13
13
 
14
- from pydantic import parse_obj_as
14
+ from pydantic import TypeAdapter
15
15
  from sqlalchemy import Column as RawColumn
16
16
  from sqlalchemy import DateTime, Enum, MetaData, select
17
17
  from sqlalchemy.exc import OperationalError
@@ -123,7 +123,9 @@ class BaseSQLDB(metaclass=ABCMeta):
123
123
  if db_url == "sqlite+aiosqlite:///:memory:":
124
124
  db_urls[db_name] = db_url
125
125
  else:
126
- db_urls[db_name] = parse_obj_as(SqlalchemyDsn, db_url)
126
+ db_urls[db_name] = str(
127
+ TypeAdapter(SqlalchemyDsn).validate_python(db_url)
128
+ )
127
129
  except Exception:
128
130
  logger.error("Error loading URL for %s", db_name)
129
131
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diracx-db
3
- Version: 0.0.1a16
3
+ Version: 0.0.1a17
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -14,7 +14,7 @@ Requires-Dist: dirac
14
14
  Requires-Dist: diracx-core
15
15
  Requires-Dist: fastapi
16
16
  Requires-Dist: opensearch-py[async]
17
- Requires-Dist: pydantic
18
- Requires-Dist: sqlalchemy[aiomysql,aiosqlite]
17
+ Requires-Dist: pydantic>=2.4
18
+ Requires-Dist: sqlalchemy[aiomysql,aiosqlite]>=2
19
19
  Provides-Extra: testing
20
20
  Requires-Dist: diracx-testing; extra == "testing"
@@ -2,8 +2,8 @@ dirac
2
2
  diracx-core
3
3
  fastapi
4
4
  opensearch-py[async]
5
- pydantic
6
- sqlalchemy[aiomysql,aiosqlite]
5
+ pydantic>=2.4
6
+ sqlalchemy[aiomysql,aiosqlite]>=2
7
7
 
8
8
  [testing]
9
9
  diracx-testing
@@ -26,13 +26,16 @@ def test_get_pfn(sandbox_metadata_db: SandboxMetadataDB):
26
26
  sub="vo:sub", preferred_username="user1", dirac_group="group1", vo="vo"
27
27
  )
28
28
  sandbox_info = SandboxInfo(
29
- checksum="checksum",
29
+ checksum="90e0ba6763c91a905bb9fd6e025aac1952ae742e6d756a31a0963aa7df7cd7b1",
30
30
  checksum_algorithm="sha256",
31
31
  format="tar.bz2",
32
32
  size=100,
33
33
  )
34
34
  pfn = sandbox_metadata_db.get_pfn("bucket1", user_info, sandbox_info)
35
- assert pfn == "/S3/bucket1/vo/group1/user1/sha256:checksum.tar.bz2"
35
+ assert pfn == (
36
+ "/S3/bucket1/vo/group1/user1/"
37
+ "sha256:90e0ba6763c91a905bb9fd6e025aac1952ae742e6d756a31a0963aa7df7cd7b1.tar.bz2"
38
+ )
36
39
 
37
40
 
38
41
  async def test_insert_sandbox(sandbox_metadata_db: SandboxMetadataDB):
File without changes
File without changes