libres 0.7.1__tar.gz → 0.7.3__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 (62) hide show
  1. {libres-0.7.1 → libres-0.7.3}/HISTORY.rst +12 -0
  2. {libres-0.7.1/src/libres.egg-info → libres-0.7.3}/PKG-INFO +14 -1
  3. {libres-0.7.1 → libres-0.7.3}/pyproject.toml +2 -1
  4. {libres-0.7.1 → libres-0.7.3}/setup.cfg +1 -0
  5. {libres-0.7.1 → libres-0.7.3}/src/libres/__init__.py +1 -1
  6. {libres-0.7.1 → libres-0.7.3}/src/libres/db/scheduler.py +10 -9
  7. {libres-0.7.1 → libres-0.7.3/src/libres.egg-info}/PKG-INFO +14 -1
  8. {libres-0.7.1 → libres-0.7.3}/LICENSE +0 -0
  9. {libres-0.7.1 → libres-0.7.3}/MANIFEST.in +0 -0
  10. {libres-0.7.1 → libres-0.7.3}/README.rst +0 -0
  11. {libres-0.7.1 → libres-0.7.3}/docs/Makefile +0 -0
  12. {libres-0.7.1 → libres-0.7.3}/docs/_static/custom.css +0 -0
  13. {libres-0.7.1 → libres-0.7.3}/docs/_static/favicon.ico +0 -0
  14. {libres-0.7.1 → libres-0.7.3}/docs/_static/logo.svg +0 -0
  15. {libres-0.7.1 → libres-0.7.3}/docs/api.rst +0 -0
  16. {libres-0.7.1 → libres-0.7.3}/docs/concepts.rst +0 -0
  17. {libres-0.7.1 → libres-0.7.3}/docs/conf.py +0 -0
  18. {libres-0.7.1 → libres-0.7.3}/docs/customizations.rst +0 -0
  19. {libres-0.7.1 → libres-0.7.3}/docs/faq.rst +0 -0
  20. {libres-0.7.1 → libres-0.7.3}/docs/index.rst +0 -0
  21. {libres-0.7.1 → libres-0.7.3}/docs/requirements.txt +0 -0
  22. {libres-0.7.1 → libres-0.7.3}/docs/under_the_hood.rst +0 -0
  23. {libres-0.7.1 → libres-0.7.3}/src/libres/.gitignore +0 -0
  24. {libres-0.7.1 → libres-0.7.3}/src/libres/context/__init__.py +0 -0
  25. {libres-0.7.1 → libres-0.7.3}/src/libres/context/core.py +0 -0
  26. {libres-0.7.1 → libres-0.7.3}/src/libres/context/exposure.py +0 -0
  27. {libres-0.7.1 → libres-0.7.3}/src/libres/context/registry.py +0 -0
  28. {libres-0.7.1 → libres-0.7.3}/src/libres/context/session.py +0 -0
  29. {libres-0.7.1 → libres-0.7.3}/src/libres/context/settings.py +0 -0
  30. {libres-0.7.1 → libres-0.7.3}/src/libres/db/__init__.py +0 -0
  31. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/__init__.py +0 -0
  32. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/allocation.py +0 -0
  33. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/base.py +0 -0
  34. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/other.py +0 -0
  35. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/reservation.py +0 -0
  36. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/reserved_slot.py +0 -0
  37. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/timestamp.py +0 -0
  38. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/types/__init__.py +0 -0
  39. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/types/json_type.py +0 -0
  40. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/types/utcdatetime.py +0 -0
  41. {libres-0.7.1 → libres-0.7.3}/src/libres/db/models/types/uuid_type.py +0 -0
  42. {libres-0.7.1 → libres-0.7.3}/src/libres/db/queries.py +0 -0
  43. {libres-0.7.1 → libres-0.7.3}/src/libres/modules/__init__.py +0 -0
  44. {libres-0.7.1 → libres-0.7.3}/src/libres/modules/errors.py +0 -0
  45. {libres-0.7.1 → libres-0.7.3}/src/libres/modules/events.py +0 -0
  46. {libres-0.7.1 → libres-0.7.3}/src/libres/modules/rasterizer.py +0 -0
  47. {libres-0.7.1 → libres-0.7.3}/src/libres/modules/utils.py +0 -0
  48. {libres-0.7.1 → libres-0.7.3}/src/libres/py.typed +0 -0
  49. {libres-0.7.1 → libres-0.7.3}/src/libres.egg-info/SOURCES.txt +0 -0
  50. {libres-0.7.1 → libres-0.7.3}/src/libres.egg-info/dependency_links.txt +0 -0
  51. {libres-0.7.1 → libres-0.7.3}/src/libres.egg-info/not-zip-safe +0 -0
  52. {libres-0.7.1 → libres-0.7.3}/src/libres.egg-info/requires.txt +0 -0
  53. {libres-0.7.1 → libres-0.7.3}/src/libres.egg-info/top_level.txt +0 -0
  54. {libres-0.7.1 → libres-0.7.3}/tests/test_allocation.py +0 -0
  55. {libres-0.7.1 → libres-0.7.3}/tests/test_registry.py +0 -0
  56. {libres-0.7.1 → libres-0.7.3}/tests/test_reservation.py +0 -0
  57. {libres-0.7.1 → libres-0.7.3}/tests/test_reserved_slot.py +0 -0
  58. {libres-0.7.1 → libres-0.7.3}/tests/test_scheduler.py +0 -0
  59. {libres-0.7.1 → libres-0.7.3}/tests/test_session.py +0 -0
  60. {libres-0.7.1 → libres-0.7.3}/tests/test_test.py +0 -0
  61. {libres-0.7.1 → libres-0.7.3}/tests/test_types.py +0 -0
  62. {libres-0.7.1 → libres-0.7.3}/tests/test_utils.py +0 -0
@@ -1,6 +1,18 @@
1
1
  Changelog
2
2
  ---------
3
3
 
4
+ 0.7.3 (2024-08-21)
5
+ ~~~~~~~~~~~~~~~~~~~
6
+
7
+ - Adds support for Python 3.12.
8
+ [Daverball]
9
+
10
+ 0.7.2 (2024-02-07)
11
+ ~~~~~~~~~~~~~~~~~~~
12
+
13
+ - Fixes another incorrect type annotation in `Scheduler`.
14
+ [Daverball]
15
+
4
16
  0.7.1 (2024-01-18)
5
17
  ~~~~~~~~~~~~~~~~~~~
6
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libres
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: A library to reserve things
5
5
  Home-page: http://github.com/seantis/libres/
6
6
  Author: Denis Krienbühl
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Requires-Python: >=3.8
23
24
  Description-Content-Type: text/x-rst
@@ -135,6 +136,18 @@ After this, create a new release on Github.
135
136
  Changelog
136
137
  ---------
137
138
 
139
+ 0.7.3 (2024-08-21)
140
+ ~~~~~~~~~~~~~~~~~~~
141
+
142
+ - Adds support for Python 3.12.
143
+ [Daverball]
144
+
145
+ 0.7.2 (2024-02-07)
146
+ ~~~~~~~~~~~~~~~~~~~
147
+
148
+ - Fixes another incorrect type annotation in `Scheduler`.
149
+ [Daverball]
150
+
138
151
  0.7.1 (2024-01-18)
139
152
  ~~~~~~~~~~~~~~~~~~~
140
153
 
@@ -40,11 +40,12 @@ python =
40
40
  3.9: py39
41
41
  3.10: py310,flake8,bandit,mypy
42
42
  3.11: py311
43
+ 3.12: py312
43
44
 
44
45
  [testenv]
45
46
  usedevelop = true
46
47
  setenv =
47
- py{38,39,310,311}: COVERAGE_FILE = .coverage.{envname}
48
+ py{38,39,310,311,312}: COVERAGE_FILE = .coverage.{envname}
48
49
  deps =
49
50
  -e{toxinidir}[test]
50
51
  commands = pytest --cov --cov-report= {posargs}
@@ -22,6 +22,7 @@ classifiers =
22
22
  Programming Language :: Python :: 3.9
23
23
  Programming Language :: Python :: 3.10
24
24
  Programming Language :: Python :: 3.11
25
+ Programming Language :: Python :: 3.12
25
26
  Topic :: Software Development :: Libraries :: Python Modules
26
27
 
27
28
  [options]
@@ -3,7 +3,7 @@ from libres.db import new_scheduler
3
3
 
4
4
  registry = create_default_registry()
5
5
 
6
- __version__ = '0.7.1'
6
+ __version__ = '0.7.3'
7
7
  __all__ = (
8
8
  'new_scheduler',
9
9
  'registry'
@@ -18,6 +18,7 @@ from libres.modules import utils
18
18
 
19
19
  import typing as _t
20
20
  if _t.TYPE_CHECKING:
21
+ from sedate.types import DateLike
21
22
  from sqlalchemy.orm import Query
22
23
  from typing_extensions import NotRequired, Self, TypeAlias, TypedDict
23
24
 
@@ -893,8 +894,8 @@ class Scheduler(ContextServicesMixin):
893
894
 
894
895
  def remove_unused_allocations(
895
896
  self,
896
- start: datetime,
897
- end: datetime,
897
+ start: 'DateLike',
898
+ end: 'DateLike',
898
899
  days: _t.Optional[_t.Iterable[_t.Union['Day', 'DayNumber']]] = None,
899
900
  exclude_groups: bool = False
900
901
  ) -> int:
@@ -916,7 +917,7 @@ class Scheduler(ContextServicesMixin):
916
917
  be excluded, regardless of what this parameter is set to.
917
918
  """
918
919
 
919
- start, end = self._prepare_range(
920
+ start_dt, end_dt = self._prepare_range(
920
921
  sedate.as_datetime(start),
921
922
  sedate.as_datetime(end)
922
923
  )
@@ -957,22 +958,22 @@ class Scheduler(ContextServicesMixin):
957
958
  groups = groups.having(
958
959
  and_(
959
960
  func.count(Allocation.id) == 1,
960
- start <= func.min(Allocation._start),
961
- func.max(Allocation._end) <= end
961
+ start_dt <= func.min(Allocation._start),
962
+ func.max(Allocation._end) <= end_dt
962
963
  )
963
964
  )
964
965
  else:
965
966
  groups = groups.having(
966
967
  and_(
967
- start <= func.min(Allocation._start),
968
- func.max(Allocation._end) <= end
968
+ start_dt <= func.min(Allocation._start),
969
+ func.max(Allocation._end) <= end_dt
969
970
  )
970
971
  )
971
972
 
972
973
  # all allocations
973
974
  candidates = self.managed_allocations()
974
- candidates = candidates.filter(start <= Allocation._start)
975
- candidates = candidates.filter(Allocation._end <= end)
975
+ candidates = candidates.filter(start_dt <= Allocation._start)
976
+ candidates = candidates.filter(Allocation._end <= end_dt)
976
977
 
977
978
  # .. without the ones with slots
978
979
  candidates = candidates.filter(not_(Allocation.id.in_(slots)))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libres
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: A library to reserve things
5
5
  Home-page: http://github.com/seantis/libres/
6
6
  Author: Denis Krienbühl
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Requires-Python: >=3.8
23
24
  Description-Content-Type: text/x-rst
@@ -135,6 +136,18 @@ After this, create a new release on Github.
135
136
  Changelog
136
137
  ---------
137
138
 
139
+ 0.7.3 (2024-08-21)
140
+ ~~~~~~~~~~~~~~~~~~~
141
+
142
+ - Adds support for Python 3.12.
143
+ [Daverball]
144
+
145
+ 0.7.2 (2024-02-07)
146
+ ~~~~~~~~~~~~~~~~~~~
147
+
148
+ - Fixes another incorrect type annotation in `Scheduler`.
149
+ [Daverball]
150
+
138
151
  0.7.1 (2024-01-18)
139
152
  ~~~~~~~~~~~~~~~~~~~
140
153
 
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
File without changes
File without changes
File without changes
File without changes