django-log-formatter-asim 0.0.4__tar.gz → 0.0.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-log-formatter-asim
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: Formats Django logs in ASIM format.
5
5
  License: MIT
6
6
  Author: Department for Business and Trade Platform Team
@@ -11,7 +11,9 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
- Requires-Dist: django (>=3,<5)
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Dist: django (>=3,<5) ; python_version >= "3.9" and python_version < "3.10"
16
+ Requires-Dist: django (>=3,<6) ; python_version >= "3.10" and python_version < "4"
15
17
  Requires-Dist: pre-commit (>=3.5.0,<4.0.0)
16
18
  Description-Content-Type: text/markdown
17
19
 
@@ -49,14 +51,20 @@ LOGGING = {
49
51
  ...
50
52
  },
51
53
  },
54
+ "root": {
55
+ "handlers": ["asim"],
56
+ ...
57
+ }
52
58
  "loggers": {
53
59
  "django": {
54
60
  "handlers": ["asim"],
61
+ "propagate": False
55
62
  ...
56
63
  },
57
64
  },
58
65
  }
59
66
  ```
67
+ In this example we assign the ASIM formatter to a `handler` and ensure both `root` and `django` loggers use this `handler`. We then set `propagate` to `False` on the `django` logger, to avoid duplicating logs at the root level.
60
68
 
61
69
  ## Dependencies
62
70
 
@@ -132,3 +140,35 @@ Run `poetry run pytest` in the root directory to run all tests.
132
140
 
133
141
  Or, run `poetry run tox` in the root directory to run all tests for multiple Python versions. See the [`tox` configuration file](tox.ini).
134
142
 
143
+ ### Publishing
144
+
145
+ 1. Acquire API token from [Passman](https://passman.ci.uktrade.digital/secret/cc82a3f7-ddfa-4312-ab56-1ff8528dadc8/).
146
+ - Request access from the SRE team.
147
+ - _Note: You will need access to the `platform` group in Passman._
148
+ 2. Run `poetry config pypi-token.pypi <token>` to add the token to your Poetry configuration.
149
+
150
+ Update the version, as the same version cannot be published to PyPI.
151
+
152
+ ```
153
+ poetry version patch
154
+ ```
155
+
156
+ More options for the `version` command can be found in the [Poetry documentation](https://python-poetry.org/docs/cli/#version). For example, for a minor version bump: `poetry version minor`.
157
+
158
+ Build the Python package.
159
+
160
+ ```
161
+ poetry build
162
+ ```
163
+
164
+ Publish the Python package.
165
+
166
+ _Note: Make sure your Pull Request (PR) is approved and contains the version upgrade in `pyproject.toml` before publishing the package._
167
+
168
+ ```
169
+ poetry publish
170
+ ```
171
+
172
+ Check the [PyPI Release history](https://pypi.org/project/django-log-formatter-asim/#history) to make sure the package has been updated.
173
+
174
+ For an optional manual check, install the package locally and test everything works as expected.
@@ -32,14 +32,20 @@ LOGGING = {
32
32
  ...
33
33
  },
34
34
  },
35
+ "root": {
36
+ "handlers": ["asim"],
37
+ ...
38
+ }
35
39
  "loggers": {
36
40
  "django": {
37
41
  "handlers": ["asim"],
42
+ "propagate": False
38
43
  ...
39
44
  },
40
45
  },
41
46
  }
42
47
  ```
48
+ In this example we assign the ASIM formatter to a `handler` and ensure both `root` and `django` loggers use this `handler`. We then set `propagate` to `False` on the `django` logger, to avoid duplicating logs at the root level.
43
49
 
44
50
  ## Dependencies
45
51
 
@@ -114,3 +120,36 @@ If you wish to create your own ASIM formatter, you can inherit from ASIMSystemFo
114
120
  Run `poetry run pytest` in the root directory to run all tests.
115
121
 
116
122
  Or, run `poetry run tox` in the root directory to run all tests for multiple Python versions. See the [`tox` configuration file](tox.ini).
123
+
124
+ ### Publishing
125
+
126
+ 1. Acquire API token from [Passman](https://passman.ci.uktrade.digital/secret/cc82a3f7-ddfa-4312-ab56-1ff8528dadc8/).
127
+ - Request access from the SRE team.
128
+ - _Note: You will need access to the `platform` group in Passman._
129
+ 2. Run `poetry config pypi-token.pypi <token>` to add the token to your Poetry configuration.
130
+
131
+ Update the version, as the same version cannot be published to PyPI.
132
+
133
+ ```
134
+ poetry version patch
135
+ ```
136
+
137
+ More options for the `version` command can be found in the [Poetry documentation](https://python-poetry.org/docs/cli/#version). For example, for a minor version bump: `poetry version minor`.
138
+
139
+ Build the Python package.
140
+
141
+ ```
142
+ poetry build
143
+ ```
144
+
145
+ Publish the Python package.
146
+
147
+ _Note: Make sure your Pull Request (PR) is approved and contains the version upgrade in `pyproject.toml` before publishing the package._
148
+
149
+ ```
150
+ poetry publish
151
+ ```
152
+
153
+ Check the [PyPI Release history](https://pypi.org/project/django-log-formatter-asim/#history) to make sure the package has been updated.
154
+
155
+ For an optional manual check, install the package locally and test everything works as expected.
@@ -3,7 +3,7 @@ line-length = 100
3
3
 
4
4
  [tool.poetry]
5
5
  name = "django-log-formatter-asim"
6
- version = "0.0.4"
6
+ version = "0.0.6"
7
7
  description = "Formats Django logs in ASIM format."
8
8
  authors = ["Department for Business and Trade Platform Team <sre-team@digital.trade.gov.uk>"]
9
9
  license = "MIT"
@@ -13,9 +13,12 @@ packages = [
13
13
  ]
14
14
 
15
15
  [tool.poetry.dependencies]
16
- django = ">=3,<5"
17
16
  python = ">=3.9,<4"
18
17
  pre-commit = "^3.5.0"
18
+ django = [
19
+ { version = ">=3,<5", python = ">=3.9,<3.10" },
20
+ { version = ">=3,<6", python = ">=3.10,<4" },
21
+ ]
19
22
 
20
23
  [tool.poetry.group.dev.dependencies]
21
24
  pre-commit = "^3.5.0"