libres 0.10.1__tar.gz → 0.10.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {libres-0.10.1 → libres-0.10.2}/HISTORY.rst +6 -0
  2. {libres-0.10.1/src/libres.egg-info → libres-0.10.2}/PKG-INFO +7 -1
  3. {libres-0.10.1 → libres-0.10.2}/pyproject.toml +1 -1
  4. {libres-0.10.1 → libres-0.10.2}/src/libres/__init__.py +1 -1
  5. {libres-0.10.1 → libres-0.10.2}/src/libres/context/session.py +9 -8
  6. libres-0.10.2/src/libres/db/models/base.py +11 -0
  7. {libres-0.10.1 → libres-0.10.2/src/libres.egg-info}/PKG-INFO +7 -1
  8. libres-0.10.1/src/libres/db/models/base.py +0 -5
  9. {libres-0.10.1 → libres-0.10.2}/LICENSE +0 -0
  10. {libres-0.10.1 → libres-0.10.2}/MANIFEST.in +0 -0
  11. {libres-0.10.1 → libres-0.10.2}/README.rst +0 -0
  12. {libres-0.10.1 → libres-0.10.2}/docs/Makefile +0 -0
  13. {libres-0.10.1 → libres-0.10.2}/docs/_static/custom.css +0 -0
  14. {libres-0.10.1 → libres-0.10.2}/docs/_static/favicon.ico +0 -0
  15. {libres-0.10.1 → libres-0.10.2}/docs/_static/logo.svg +0 -0
  16. {libres-0.10.1 → libres-0.10.2}/docs/api.rst +0 -0
  17. {libres-0.10.1 → libres-0.10.2}/docs/concepts.rst +0 -0
  18. {libres-0.10.1 → libres-0.10.2}/docs/conf.py +0 -0
  19. {libres-0.10.1 → libres-0.10.2}/docs/customizations.rst +0 -0
  20. {libres-0.10.1 → libres-0.10.2}/docs/faq.rst +0 -0
  21. {libres-0.10.1 → libres-0.10.2}/docs/index.rst +0 -0
  22. {libres-0.10.1 → libres-0.10.2}/docs/requirements.txt +0 -0
  23. {libres-0.10.1 → libres-0.10.2}/docs/under_the_hood.rst +0 -0
  24. {libres-0.10.1 → libres-0.10.2}/setup.cfg +0 -0
  25. {libres-0.10.1 → libres-0.10.2}/src/libres/.gitignore +0 -0
  26. {libres-0.10.1 → libres-0.10.2}/src/libres/context/__init__.py +0 -0
  27. {libres-0.10.1 → libres-0.10.2}/src/libres/context/core.py +0 -0
  28. {libres-0.10.1 → libres-0.10.2}/src/libres/context/exposure.py +0 -0
  29. {libres-0.10.1 → libres-0.10.2}/src/libres/context/registry.py +0 -0
  30. {libres-0.10.1 → libres-0.10.2}/src/libres/context/settings.py +0 -0
  31. {libres-0.10.1 → libres-0.10.2}/src/libres/db/__init__.py +0 -0
  32. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/__init__.py +0 -0
  33. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/allocation.py +0 -0
  34. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/blocker.py +0 -0
  35. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/other.py +0 -0
  36. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/reservation.py +0 -0
  37. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/reserved_slot.py +0 -0
  38. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/timespan.py +0 -0
  39. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/timestamp.py +0 -0
  40. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/types/__init__.py +0 -0
  41. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/types/json_type.py +0 -0
  42. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/types/utcdatetime.py +0 -0
  43. {libres-0.10.1 → libres-0.10.2}/src/libres/db/models/types/uuid_type.py +0 -0
  44. {libres-0.10.1 → libres-0.10.2}/src/libres/db/queries.py +0 -0
  45. {libres-0.10.1 → libres-0.10.2}/src/libres/db/scheduler.py +0 -0
  46. {libres-0.10.1 → libres-0.10.2}/src/libres/modules/__init__.py +0 -0
  47. {libres-0.10.1 → libres-0.10.2}/src/libres/modules/errors.py +0 -0
  48. {libres-0.10.1 → libres-0.10.2}/src/libres/modules/events.py +0 -0
  49. {libres-0.10.1 → libres-0.10.2}/src/libres/modules/rasterizer.py +0 -0
  50. {libres-0.10.1 → libres-0.10.2}/src/libres/modules/utils.py +0 -0
  51. {libres-0.10.1 → libres-0.10.2}/src/libres/py.typed +0 -0
  52. {libres-0.10.1 → libres-0.10.2}/src/libres.egg-info/SOURCES.txt +0 -0
  53. {libres-0.10.1 → libres-0.10.2}/src/libres.egg-info/dependency_links.txt +0 -0
  54. {libres-0.10.1 → libres-0.10.2}/src/libres.egg-info/not-zip-safe +0 -0
  55. {libres-0.10.1 → libres-0.10.2}/src/libres.egg-info/requires.txt +0 -0
  56. {libres-0.10.1 → libres-0.10.2}/src/libres.egg-info/top_level.txt +0 -0
  57. {libres-0.10.1 → libres-0.10.2}/tests/test_allocation.py +0 -0
  58. {libres-0.10.1 → libres-0.10.2}/tests/test_registry.py +0 -0
  59. {libres-0.10.1 → libres-0.10.2}/tests/test_reservation.py +0 -0
  60. {libres-0.10.1 → libres-0.10.2}/tests/test_reserved_slot.py +0 -0
  61. {libres-0.10.1 → libres-0.10.2}/tests/test_scheduler.py +0 -0
  62. {libres-0.10.1 → libres-0.10.2}/tests/test_scheduler_blockers.py +0 -0
  63. {libres-0.10.1 → libres-0.10.2}/tests/test_session.py +0 -0
  64. {libres-0.10.1 → libres-0.10.2}/tests/test_test.py +0 -0
  65. {libres-0.10.1 → libres-0.10.2}/tests/test_types.py +0 -0
  66. {libres-0.10.1 → libres-0.10.2}/tests/test_utils.py +0 -0
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  ---------
3
3
 
4
+ 0.10.2 (05.02.2026)
5
+ ~~~~~~~~~~~~~~~~~~~
6
+
7
+ - Prepares for SQLAlchemy 2.0 support
8
+ [Daverball]
9
+
4
10
  0.10.1 (21.01.2026)
5
11
  ~~~~~~~~~~~~~~~~~~~
6
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libres
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: A library to reserve things
5
5
  Home-page: http://github.com/seantis/libres/
6
6
  Author: Denis Krienbühl
@@ -142,6 +142,12 @@ After this, create a new release on Github.
142
142
  Changelog
143
143
  ---------
144
144
 
145
+ 0.10.2 (05.02.2026)
146
+ ~~~~~~~~~~~~~~~~~~~
147
+
148
+ - Prepares for SQLAlchemy 2.0 support
149
+ [Daverball]
150
+
145
151
  0.10.1 (21.01.2026)
146
152
  ~~~~~~~~~~~~~~~~~~~
147
153
 
@@ -11,7 +11,7 @@ branch = true
11
11
  source = ["src"]
12
12
 
13
13
  [tool.bumpversion]
14
- current_version = "0.10.1"
14
+ current_version = "0.10.2"
15
15
  commit = true
16
16
  message = "Release {new_version}"
17
17
  tag = true
@@ -5,7 +5,7 @@ from libres.db import new_scheduler
5
5
 
6
6
  registry = create_default_registry() # noqa: RUF067
7
7
 
8
- __version__ = '0.10.1'
8
+ __version__ = '0.10.2'
9
9
  __all__ = (
10
10
  'new_scheduler',
11
11
  'registry'
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from sqlalchemy import create_engine
3
+ from sqlalchemy import create_engine, text
4
4
  from sqlalchemy.pool import QueuePool
5
5
  from sqlalchemy.orm import scoped_session, sessionmaker
6
6
 
@@ -34,12 +34,12 @@ class SessionProvider(StoppableService):
34
34
 
35
35
  self.engine = create_engine(
36
36
  dsn, poolclass=QueuePool, pool_size=5, max_overflow=5,
37
- isolation_level=SERIALIZABLE,
37
+ isolation_level=SERIALIZABLE, future=True,
38
38
  **(engine_config or {})
39
39
  )
40
40
 
41
41
  self.session = scoped_session(sessionmaker(
42
- bind=self.engine, **(session_config or {})
42
+ bind=self.engine, future=True, **(session_config or {}),
43
43
  ))
44
44
 
45
45
  def stop_service(self) -> None:
@@ -58,20 +58,21 @@ class SessionProvider(StoppableService):
58
58
  def get_postgres_version(self, dsn: str) -> tuple[str, int]:
59
59
  """ Returns the postgres version as a tuple (string, integer).
60
60
 
61
- Uses it's own connection to be independent from any session.
61
+ Uses its own connection to be independent from any session.
62
62
 
63
63
  """
64
64
  assert 'postgres' in dsn, 'Not a postgres database'
65
65
 
66
- query = """
66
+ query = text("""
67
67
  SELECT current_setting('server_version'),
68
68
  current_setting('server_version_num')
69
- """
69
+ """)
70
70
 
71
- engine = create_engine(dsn)
71
+ engine = create_engine(dsn, future=True)
72
72
 
73
73
  try:
74
- result = engine.execute(query).first()
74
+ with engine.connect() as conn:
75
+ result = conn.execute(query).first()
75
76
  assert result is not None
76
77
  version, number = result
77
78
  return version, int(number)
@@ -0,0 +1,11 @@
1
+ from __future__ import annotations
2
+
3
+
4
+ from typing import TYPE_CHECKING
5
+ if TYPE_CHECKING:
6
+ from sqlalchemy.ext.declarative import declarative_base
7
+ else:
8
+ # FIXME: Move this import out when dropping 1.4 support
9
+ from sqlalchemy.orm import declarative_base
10
+
11
+ ORMBase = declarative_base()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libres
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: A library to reserve things
5
5
  Home-page: http://github.com/seantis/libres/
6
6
  Author: Denis Krienbühl
@@ -142,6 +142,12 @@ After this, create a new release on Github.
142
142
  Changelog
143
143
  ---------
144
144
 
145
+ 0.10.2 (05.02.2026)
146
+ ~~~~~~~~~~~~~~~~~~~
147
+
148
+ - Prepares for SQLAlchemy 2.0 support
149
+ [Daverball]
150
+
145
151
  0.10.1 (21.01.2026)
146
152
  ~~~~~~~~~~~~~~~~~~~
147
153
 
@@ -1,5 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from sqlalchemy.ext import declarative
4
-
5
- ORMBase = declarative.declarative_base()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes