cmsdials 1.7.0__tar.gz → 1.7.1__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 (52) hide show
  1. {cmsdials-1.7.0 → cmsdials-1.7.1}/PKG-INFO +33 -1
  2. {cmsdials-1.7.0 → cmsdials-1.7.1}/README.md +32 -0
  3. cmsdials-1.7.1/cmsdials/_version.py +1 -0
  4. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/bearer.py +7 -5
  5. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/oms_proxy/client.py +10 -4
  6. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/utils/api_client.py +1 -1
  7. {cmsdials-1.7.0 → cmsdials-1.7.1}/pyproject.toml +1 -1
  8. cmsdials-1.7.0/cmsdials/_version.py +0 -1
  9. {cmsdials-1.7.0 → cmsdials-1.7.1}/LICENSE +0 -0
  10. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/__init__.py +0 -0
  11. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/__init__.py +0 -0
  12. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/_base.py +0 -0
  13. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/client.py +0 -0
  14. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/exceptions.py +0 -0
  15. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/models.py +0 -0
  16. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/auth/secret_key.py +0 -0
  17. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/__init__.py +0 -0
  18. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/dataset_index/__init__.py +0 -0
  19. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/dataset_index/client.py +0 -0
  20. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/dataset_index/models.py +0 -0
  21. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/file_index/__init__.py +0 -0
  22. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/file_index/client.py +0 -0
  23. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/file_index/models.py +0 -0
  24. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h1d/__init__.py +0 -0
  25. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h1d/client.py +0 -0
  26. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h1d/models.py +0 -0
  27. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h2d/__init__.py +0 -0
  28. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h2d/client.py +0 -0
  29. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/h2d/models.py +0 -0
  30. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/lumisection/__init__.py +0 -0
  31. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/lumisection/client.py +0 -0
  32. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/lumisection/models.py +0 -0
  33. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/mes/__init__.py +0 -0
  34. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/mes/client.py +0 -0
  35. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/mes/models.py +0 -0
  36. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_bad_lumisection/__init__.py +0 -0
  37. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_bad_lumisection/client.py +0 -0
  38. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_bad_lumisection/models.py +0 -0
  39. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_models_index/__init__.py +0 -0
  40. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_models_index/client.py +0 -0
  41. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/ml_models_index/models.py +0 -0
  42. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/oms_proxy/__init__.py +0 -0
  43. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/oms_proxy/models.py +0 -0
  44. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/run/__init__.py +0 -0
  45. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/run/client.py +0 -0
  46. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/clients/run/models.py +0 -0
  47. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/cmsdials.py +0 -0
  48. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/filters.py +0 -0
  49. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/utils/__init__.py +0 -0
  50. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/utils/_json.py +0 -0
  51. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/utils/base_model.py +0 -0
  52. {cmsdials-1.7.0 → cmsdials-1.7.1}/cmsdials/utils/logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmsdials
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: The Python api client interface to DIALS service
5
5
  Home-page: https://github.com/cms-DQM/dials-py
6
6
  Author: Gabriel Moreira
@@ -354,3 +354,35 @@ asdf set python 3.12.9 3.11.10 3.10.13 3.9.19
354
354
 
355
355
  This will use `3.12.9` by default (if you just run `python`), but it will also put `python3.11`, `python3.10` and `python3.9` symlinks in your path so you can run those too (which is exactly what tox is looking for).
356
356
 
357
+ ## Releasing the package on PyPI
358
+
359
+ ### Build
360
+
361
+ You can use poetry to build the package using:
362
+
363
+ ```bash
364
+ poetry build
365
+ ```
366
+
367
+ The build system requires `poetry-dynamic-versioning` plugin installed to update the package version during build time. To install this plugin simply:
368
+
369
+ ```
370
+ poetry self add "poetry-dynamic-versioning[plugin]"
371
+ ```
372
+
373
+ The build system will automatically update the package version based on the git tag of the current commit.
374
+
375
+ ### Publish
376
+
377
+ To publish the package will need maintainer rights to the `cmsdials` page in PyPI and configure your poetry installation to publish with a PyPI api token. Provided you have already generate a PyPI api token in your account you can configure your poetry installation using:
378
+
379
+ ```
380
+ poetry config pypi-token.pypi <your-api-token>
381
+ ```
382
+
383
+ Then, to build and publish in one go you can do:
384
+
385
+ ```bash
386
+ poetry publish --build
387
+ ```
388
+
@@ -326,3 +326,35 @@ asdf set python 3.12.9 3.11.10 3.10.13 3.9.19
326
326
  ```
327
327
 
328
328
  This will use `3.12.9` by default (if you just run `python`), but it will also put `python3.11`, `python3.10` and `python3.9` symlinks in your path so you can run those too (which is exactly what tox is looking for).
329
+
330
+ ## Releasing the package on PyPI
331
+
332
+ ### Build
333
+
334
+ You can use poetry to build the package using:
335
+
336
+ ```bash
337
+ poetry build
338
+ ```
339
+
340
+ The build system requires `poetry-dynamic-versioning` plugin installed to update the package version during build time. To install this plugin simply:
341
+
342
+ ```
343
+ poetry self add "poetry-dynamic-versioning[plugin]"
344
+ ```
345
+
346
+ The build system will automatically update the package version based on the git tag of the current commit.
347
+
348
+ ### Publish
349
+
350
+ To publish the package will need maintainer rights to the `cmsdials` page in PyPI and configure your poetry installation to publish with a PyPI api token. Provided you have already generate a PyPI api token in your account you can configure your poetry installation using:
351
+
352
+ ```
353
+ poetry config pypi-token.pypi <your-api-token>
354
+ ```
355
+
356
+ Then, to build and publish in one go you can do:
357
+
358
+ ```bash
359
+ poetry publish --build
360
+ ```
@@ -0,0 +1 @@
1
+ __version__ = "1.7.1"
@@ -31,7 +31,7 @@ class Credentials(BaseCredentials):
31
31
  refresh_expires_in: int,
32
32
  refresh_token: str,
33
33
  token_type: str,
34
- cache_dir: str = DEFAULT_CACHE_DIR,
34
+ cache_dir: Optional[str] = None,
35
35
  client: Optional[AuthClient] = None,
36
36
  ):
37
37
  # Load parent class and overwrite token attributes
@@ -45,7 +45,7 @@ class Credentials(BaseCredentials):
45
45
  self.token_type = token_type
46
46
 
47
47
  # Setup dir for caching credentials and authentication client
48
- self.cache_dir = cache_dir
48
+ self.cache_dir = cache_dir or DEFAULT_CACHE_DIR
49
49
  self.client = client or AuthClient()
50
50
 
51
51
  # If loaded token is expired, immediately refresh
@@ -75,7 +75,7 @@ class Credentials(BaseCredentials):
75
75
  )
76
76
 
77
77
  @staticmethod
78
- def _handle_creds_filepath(cache_dir: str = DEFAULT_CACHE_DIR):
78
+ def _handle_creds_filepath(cache_dir: Optional[str] = None):
79
79
  cache_dir = cache_dir or DEFAULT_CACHE_DIR
80
80
  if os.path.isabs(cache_dir) is False:
81
81
  cache_dir = os.path.join(os.getcwd(), cache_dir)
@@ -85,9 +85,10 @@ class Credentials(BaseCredentials):
85
85
 
86
86
  @staticmethod
87
87
  def from_authclient_token(
88
- token: Token, cache_dir: str = DEFAULT_CACHE_DIR, client: Optional[AuthClient] = None
88
+ token: Token, cache_dir: Optional[str] = None, client: Optional[AuthClient] = None
89
89
  ) -> "Credentials":
90
90
  client = client or AuthClient()
91
+ cache_dir = cache_dir or DEFAULT_CACHE_DIR
91
92
  return Credentials(
92
93
  token=token.access_token,
93
94
  expires_in=token.expires_in,
@@ -101,8 +102,9 @@ class Credentials(BaseCredentials):
101
102
  )
102
103
 
103
104
  @staticmethod
104
- def from_creds_file(cache_dir: str = DEFAULT_CACHE_DIR, client: Optional[AuthClient] = None) -> "Credentials":
105
+ def from_creds_file(cache_dir: Optional[str] = None, client: Optional[AuthClient] = None) -> "Credentials":
105
106
  client = client or AuthClient()
107
+ cache_dir = cache_dir or DEFAULT_CACHE_DIR
106
108
  fpath = Credentials._handle_creds_filepath(cache_dir)
107
109
  try:
108
110
  with open(fpath) as filebuffer:
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
- import requests
4
3
  from requests.exceptions import HTTPError
4
+ from requests.adapters import DEFAULT_RETRIES
5
5
 
6
6
  from ...auth._base import BaseCredentials
7
7
  from ...utils.api_client import BaseAPIClient
@@ -24,13 +24,13 @@ class OMSProxyClient(BaseAPIClient):
24
24
 
25
25
  def _build_headers(self) -> dict:
26
26
  base = {
27
- "accept": "application/json",
27
+ "Accept": "application/json",
28
28
  "User-Agent": self._build_user_agent()
29
29
  }
30
30
  self.creds.before_request(base)
31
31
  return base
32
32
 
33
- def query(self, endpoint: str, filters: list[OMSFilter], pages: Optional[list[OMSPage]] = None):
33
+ def query(self, endpoint: str, filters: list[OMSFilter], pages: Optional[list[OMSPage]] = None, retries=DEFAULT_RETRIES):
34
34
  headers = self._build_headers()
35
35
  endpoint_url = self.api_url + self.lookup_url
36
36
 
@@ -39,7 +39,13 @@ class OMSProxyClient(BaseAPIClient):
39
39
  pages = {f"page[{page.attribute_name}]": page.value for page in pages} if pages and len(pages) > 0 else {}
40
40
  params = {"endpoint": endpoint, **filters, **pages}
41
41
 
42
- response = requests.get(endpoint_url, headers=headers, params=params, timeout=self.default_timeout)
42
+ response = self._requests_get_retriable(
43
+ endpoint_url,
44
+ headers=headers,
45
+ params=params,
46
+ timeout=self.default_timeout,
47
+ retries=retries,
48
+ )
43
49
  try:
44
50
  response.raise_for_status()
45
51
  except HTTPError as err:
@@ -85,7 +85,7 @@ class BaseAuthorizedAPIClient(BaseAPIClient):
85
85
 
86
86
  def _build_headers(self) -> dict:
87
87
  base = {
88
- "accept": "application/json",
88
+ "Accept": "application/json",
89
89
  "User-Agent": self._build_user_agent()
90
90
  }
91
91
  if self.workspace is not None:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cmsdials"
3
- version = "1.7.0"
3
+ version = "1.7.1"
4
4
  description = "The Python api client interface to DIALS service"
5
5
  authors = ["Gabriel Moreira <gabrielmscampos@gmail.com>"]
6
6
  readme = "README.md"
@@ -1 +0,0 @@
1
- __version__ = "1.7.0"
File without changes
File without changes
File without changes
File without changes