update-time 0.0.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.
- update_time-0.0.1/LICENSE +201 -0
- update_time-0.0.1/PKG-INFO +29 -0
- update_time-0.0.1/README.md +2 -0
- update_time-0.0.1/pyproject.toml +87 -0
- update_time-0.0.1/setup.cfg +4 -0
- update_time-0.0.1/src/update_time.egg-info/PKG-INFO +29 -0
- update_time-0.0.1/src/update_time.egg-info/SOURCES.txt +27 -0
- update_time-0.0.1/src/update_time.egg-info/dependency_links.txt +1 -0
- update_time-0.0.1/src/update_time.egg-info/entry_points.txt +2 -0
- update_time-0.0.1/src/update_time.egg-info/requires.txt +3 -0
- update_time-0.0.1/src/update_time.egg-info/top_level.txt +1 -0
- update_time-0.0.1/tests/test_architecture.py +17 -0
- update_time-0.0.1/tests/test_changelog.py +62 -0
- update_time-0.0.1/tests/test_docker.py +117 -0
- update_time-0.0.1/tests/test_filesystem.py +152 -0
- update_time-0.0.1/tests/test_github.py +181 -0
- update_time-0.0.1/tests/test_log.py +98 -0
- update_time-0.0.1/tests/test_npmjs.py +19 -0
- update_time-0.0.1/tests/test_pypi.py +131 -0
- update_time-0.0.1/tests/test_update.py +41 -0
- update_time-0.0.1/tests/test_update_circle_ci_config.py +62 -0
- update_time-0.0.1/tests/test_update_dockerfile_base_image.py +37 -0
- update_time-0.0.1/tests/test_update_github_action.py +101 -0
- update_time-0.0.1/tests/test_update_jsdelivr.py +134 -0
- update_time-0.0.1/tests/test_update_manifest_images.py +74 -0
- update_time-0.0.1/tests/test_update_node_engine.py +101 -0
- update_time-0.0.1/tests/test_update_package_json.py +73 -0
- update_time-0.0.1/tests/test_update_pyproject_toml.py +137 -0
- update_time-0.0.1/tests/test_version.py +21 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: update-time
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Author-email: Quality-time team <quality-time@ictu.nl>
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Changelog, https://github.com/ICTU/update-time/blob/main/CHANGELOG.md
|
|
7
|
+
Project-URL: Issues, https://github.com/ICTU/update-time/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/ICTU/update-time
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.16
|
|
19
|
+
Classifier: Topic :: Software Development
|
|
20
|
+
Requires-Python: >=3.14
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: packaging==26.2
|
|
24
|
+
Requires-Dist: requests==2.34.2
|
|
25
|
+
Requires-Dist: rich==15.0.0
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# update-time
|
|
29
|
+
It's time to update your dependencies
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "setuptools.build_meta"
|
|
3
|
+
requires = [ "setuptools<81" ]
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "update-time"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
license = "Apache-2.0"
|
|
10
|
+
license-files = [ "LICENSE" ]
|
|
11
|
+
authors = [ { name = "Quality-time team", email = "quality-time@ictu.nl" } ]
|
|
12
|
+
requires-python = ">=3.14"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Natural Language :: English",
|
|
17
|
+
"Operating System :: MacOS",
|
|
18
|
+
"Operating System :: POSIX :: Linux",
|
|
19
|
+
"Programming Language :: Python",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Programming Language :: Python :: 3.15",
|
|
23
|
+
"Programming Language :: Python :: 3.16",
|
|
24
|
+
"Topic :: Software Development",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"packaging==26.2",
|
|
28
|
+
"requests==2.34.2",
|
|
29
|
+
"rich==15.0.0",
|
|
30
|
+
]
|
|
31
|
+
urls.Changelog = "https://github.com/ICTU/update-time/blob/main/CHANGELOG.md"
|
|
32
|
+
urls.Issues = "https://github.com/ICTU/update-time/issues"
|
|
33
|
+
urls.Repository = "https://github.com/ICTU/update-time"
|
|
34
|
+
scripts.update-time = "update:update_dependencies"
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = [
|
|
38
|
+
"archunitpython==1.1.1",
|
|
39
|
+
"bandit==1.9.4",
|
|
40
|
+
"codespell==2.4.2",
|
|
41
|
+
"coverage==7.14.1",
|
|
42
|
+
"fixit==2.2.1",
|
|
43
|
+
"mypy==2.1.0",
|
|
44
|
+
"pip-audit==2.10.1",
|
|
45
|
+
"pyproject-fmt==2.24.1",
|
|
46
|
+
"ruff==0.15.17",
|
|
47
|
+
"troml==0.4.1",
|
|
48
|
+
"ty==0.0.49",
|
|
49
|
+
"types-requests==2.33.0.20260518",
|
|
50
|
+
"vulture==2.16",
|
|
51
|
+
"yamllint==1.38.0",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools]
|
|
55
|
+
packages.find.where = [ "src" ]
|
|
56
|
+
|
|
57
|
+
[tool.uv]
|
|
58
|
+
override-dependencies = [
|
|
59
|
+
"msgpack==1.2.1"
|
|
60
|
+
] # GHSA-6v7p-g79w-8964: MessagePack for Python: Out-of-bounds read / crash on Unpacker reuse after a caught error
|
|
61
|
+
exclude-newer = "7 days"
|
|
62
|
+
exclude-newer-package = { msgpack = false }
|
|
63
|
+
|
|
64
|
+
[tool.ruff]
|
|
65
|
+
line-length = 120
|
|
66
|
+
src = [
|
|
67
|
+
"src",
|
|
68
|
+
]
|
|
69
|
+
lint.select = [
|
|
70
|
+
"ALL",
|
|
71
|
+
]
|
|
72
|
+
lint.ignore = [
|
|
73
|
+
"ANN201", # https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function/ - too many untyped return values atm to turn this rule on
|
|
74
|
+
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/ - this rule may cause conflicts when used with the ruff formatter
|
|
75
|
+
"D203", # https://docs.astral.sh/ruff/rules/one-blank-line-before-class/ - prevent warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`
|
|
76
|
+
"D213", # https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/ - prevent warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`
|
|
77
|
+
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/ - this rule may cause conflicts when used with the ruff formatter
|
|
78
|
+
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt - pytest isn't used
|
|
79
|
+
"TC006", # https://docs.astral.sh/ruff/rules/runtime-cast-value/ - the rule claims it's often necessary to quote the first argument passed to cast(), but that's not the case in this code base
|
|
80
|
+
]
|
|
81
|
+
lint.per-file-ignores.".vulture-whitelist.py" = [
|
|
82
|
+
"ALL",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
[tool.pyproject-fmt]
|
|
86
|
+
indent = 4
|
|
87
|
+
keep_full_version = true # Don't remove trailing zero's from version specifiers
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: update-time
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Author-email: Quality-time team <quality-time@ictu.nl>
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Changelog, https://github.com/ICTU/update-time/blob/main/CHANGELOG.md
|
|
7
|
+
Project-URL: Issues, https://github.com/ICTU/update-time/issues
|
|
8
|
+
Project-URL: Repository, https://github.com/ICTU/update-time
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.16
|
|
19
|
+
Classifier: Topic :: Software Development
|
|
20
|
+
Requires-Python: >=3.14
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: packaging==26.2
|
|
24
|
+
Requires-Dist: requests==2.34.2
|
|
25
|
+
Requires-Dist: rich==15.0.0
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# update-time
|
|
29
|
+
It's time to update your dependencies
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/update_time.egg-info/PKG-INFO
|
|
5
|
+
src/update_time.egg-info/SOURCES.txt
|
|
6
|
+
src/update_time.egg-info/dependency_links.txt
|
|
7
|
+
src/update_time.egg-info/entry_points.txt
|
|
8
|
+
src/update_time.egg-info/requires.txt
|
|
9
|
+
src/update_time.egg-info/top_level.txt
|
|
10
|
+
tests/test_architecture.py
|
|
11
|
+
tests/test_changelog.py
|
|
12
|
+
tests/test_docker.py
|
|
13
|
+
tests/test_filesystem.py
|
|
14
|
+
tests/test_github.py
|
|
15
|
+
tests/test_log.py
|
|
16
|
+
tests/test_npmjs.py
|
|
17
|
+
tests/test_pypi.py
|
|
18
|
+
tests/test_update.py
|
|
19
|
+
tests/test_update_circle_ci_config.py
|
|
20
|
+
tests/test_update_dockerfile_base_image.py
|
|
21
|
+
tests/test_update_github_action.py
|
|
22
|
+
tests/test_update_jsdelivr.py
|
|
23
|
+
tests/test_update_manifest_images.py
|
|
24
|
+
tests/test_update_node_engine.py
|
|
25
|
+
tests/test_update_package_json.py
|
|
26
|
+
tests/test_update_pyproject_toml.py
|
|
27
|
+
tests/test_version.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Test the architecture of the tool."""
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from archunitpython import assert_passes, project_files
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DependenciesTest(unittest.TestCase):
|
|
9
|
+
"""Unit test for module dependencies within the tool."""
|
|
10
|
+
|
|
11
|
+
def test_no_cyclic_dependencies(self):
|
|
12
|
+
"""Test that there are no cyclic dependencies."""
|
|
13
|
+
assert_passes(project_files("src/").should().have_no_cycles())
|
|
14
|
+
|
|
15
|
+
def test_no_script_imports(self):
|
|
16
|
+
"""Test that scripts are not imported."""
|
|
17
|
+
assert_passes(project_files("src/").should_not().depend_on_files().with_name("update_*.py"))
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Unit tests for the changelog parsing."""
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
from changelog import get_version_changes_from_changelog
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GetChangeFromChangelogTest(unittest.TestCase):
|
|
9
|
+
"""Unit tests for getting the change for a version from a changelog."""
|
|
10
|
+
|
|
11
|
+
def test_empty_changelog(self):
|
|
12
|
+
"""Test that an empty changelog results in an empty change."""
|
|
13
|
+
self.assertEqual("", get_version_changes_from_changelog("", "1.0"))
|
|
14
|
+
|
|
15
|
+
def test_non_empty_changelog(self):
|
|
16
|
+
"""Test that a changelog without the version number simply returns the changelog."""
|
|
17
|
+
self.assertEqual("Empty changelog", get_version_changes_from_changelog("Empty changelog", "1.0"))
|
|
18
|
+
|
|
19
|
+
def test_version_number_found(self):
|
|
20
|
+
"""Test that a changelog with the version number returns the text after the version number."""
|
|
21
|
+
v1_change = "Version 1.0\n\n- Fixed ...\n- Changed ..."
|
|
22
|
+
changelog = f"Changelog\n\n{v1_change}"
|
|
23
|
+
self.assertEqual(v1_change, get_version_changes_from_changelog(changelog, "1.0"))
|
|
24
|
+
|
|
25
|
+
def test_skip_older_versions(self):
|
|
26
|
+
"""Test that a older versions are not included."""
|
|
27
|
+
v1_change = "## Version 1.0\n\n- Fixed ...\n- Changed ..."
|
|
28
|
+
changelog = f"Changelog\n\n{v1_change}\n\n## Version 0.9\n\n- Fixed ...\n"
|
|
29
|
+
self.assertEqual(v1_change, get_version_changes_from_changelog(changelog, "1.0"))
|
|
30
|
+
|
|
31
|
+
def test_max_length(self):
|
|
32
|
+
"""Test the max length."""
|
|
33
|
+
v1_change = "## Version 1.0\n\n- Fixed ...\n- Changed ..."
|
|
34
|
+
text_after_v1 = "# Some other header\n\n- Some bullet point.\n"
|
|
35
|
+
changelog = f"Changelog\n\n{v1_change}\n\n{text_after_v1}"
|
|
36
|
+
expected_v1_change = "## Version 1.0\n\n- Fixed ...\n..."
|
|
37
|
+
self.assertEqual(expected_v1_change, get_version_changes_from_changelog(changelog, "1.0", max_length=3))
|
|
38
|
+
|
|
39
|
+
def test_max_length_is_not_applied_when_previous_version_is_found(self):
|
|
40
|
+
"""Test that the max length is not applied if the previous version is found."""
|
|
41
|
+
v1_change = "## Version 1.0\n\n- Fixed ...\n- Changed ..."
|
|
42
|
+
changelog = f"Changelog\n\n{v1_change}\n\n## Version 0.9\n\n- Fixed ...\n"
|
|
43
|
+
self.assertEqual(v1_change, get_version_changes_from_changelog(changelog, "1.0", max_length=3))
|
|
44
|
+
|
|
45
|
+
def test_prose_mention_of_version_does_not_anchor_parsing(self):
|
|
46
|
+
"""Test that a prose mention of the version in a newer section doesn't anchor parsing there."""
|
|
47
|
+
v2_change = "## [2.0.0]\n\n- A feature, completing the work started in 1.0.0."
|
|
48
|
+
v1_change = "## [1.0.0]\n\n- Fixed ...\n- Changed ..."
|
|
49
|
+
changelog = f"# Changelog\n\n{v2_change}\n\n{v1_change}\n\n## [0.9.0]\n\n- Fixed ...\n"
|
|
50
|
+
self.assertEqual(v1_change, get_version_changes_from_changelog(changelog, "1.0.0"))
|
|
51
|
+
|
|
52
|
+
def test_repeated_prose_mention_without_heading_anchors_on_first(self):
|
|
53
|
+
"""Test that without a heading, parsing anchors on the first of several prose mentions."""
|
|
54
|
+
changelog = "Upgrade to 1.0.0 is recommended.\nThe 1.0.0 release fixes things."
|
|
55
|
+
self.assertEqual(changelog, get_version_changes_from_changelog(changelog, "1.0.0"))
|
|
56
|
+
|
|
57
|
+
def test_version_in_footer_link_does_not_anchor_parsing(self):
|
|
58
|
+
"""Test that a version mention in a footer comparison link doesn't anchor parsing there."""
|
|
59
|
+
v1_change = "## [1.0.0]\n\n- Fixed ...\n- Changed ..."
|
|
60
|
+
footer = "[1.0.0]: https://example.org/compare/v0.9.0...v1.0.0"
|
|
61
|
+
changelog = f"# Changelog\n\n{v1_change}\n\n## [0.9.0]\n\n- Fixed ...\n\n{footer}\n"
|
|
62
|
+
self.assertEqual(v1_change, get_version_changes_from_changelog(changelog, "1.0.0"))
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"""Unit tests for the Docker module."""
|
|
2
|
+
|
|
3
|
+
from datetime import UTC, datetime, timedelta
|
|
4
|
+
from unittest.mock import Mock, patch
|
|
5
|
+
|
|
6
|
+
from docker import get_latest_tag
|
|
7
|
+
|
|
8
|
+
from .fixtures import DIGEST, DIGEST1, DIGEST2, DIGEST3
|
|
9
|
+
from .helpers import CacheClearingTestCase, mock_response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@patch.dict("os.environ", {}, clear=True)
|
|
13
|
+
@patch("requests.get")
|
|
14
|
+
class GetLatestTagTest(CacheClearingTestCase):
|
|
15
|
+
"""Unit tests for getting the latest tag."""
|
|
16
|
+
|
|
17
|
+
def test_invalid_current_tag(self, mock_get: Mock):
|
|
18
|
+
"""Test that the current tag is returned without querying Docker Hub if it's not a valid version."""
|
|
19
|
+
self.assertEqual("invalid version", get_latest_tag("image", "invalid version").version)
|
|
20
|
+
mock_get.assert_not_called()
|
|
21
|
+
|
|
22
|
+
def test_no_results(self, mock_get: Mock):
|
|
23
|
+
"""Test that the current tag is returned if Docker Hub has no results."""
|
|
24
|
+
mock_get.return_value = mock_response({})
|
|
25
|
+
self.assertEqual("1.0", get_latest_tag("no_results", "1.0").version)
|
|
26
|
+
|
|
27
|
+
def test_empty_results(self, mock_get: Mock):
|
|
28
|
+
"""Test that the current tag is returned if Docker Hub has an empty results list."""
|
|
29
|
+
mock_get.return_value = mock_response({"results": []})
|
|
30
|
+
self.assertEqual("1.0", get_latest_tag("empty_results", "1.0").version)
|
|
31
|
+
|
|
32
|
+
def test_up_to_date(self, mock_get: Mock):
|
|
33
|
+
"""Test that the current tag is returned if it's up to date."""
|
|
34
|
+
mock_get.return_value = mock_response({"results": [{"name": "1.0", "digest": DIGEST}]})
|
|
35
|
+
self.assertEqual("1.0", get_latest_tag("up_to_date", "1.0").version)
|
|
36
|
+
|
|
37
|
+
def test_newer(self, mock_get: Mock):
|
|
38
|
+
"""Test that the current tag is returned if it's newer than the newest tag available."""
|
|
39
|
+
mock_get.return_value = mock_response({"results": [{"name": "1.0", "digest": DIGEST}]})
|
|
40
|
+
self.assertEqual("1.1", get_latest_tag("newer", "1.1").version)
|
|
41
|
+
|
|
42
|
+
def test_new_version_available(self, mock_get: Mock):
|
|
43
|
+
"""Test that the new tag is returned if it's newer, without a publication date when the push date is unknown."""
|
|
44
|
+
mock_get.return_value = mock_response({"results": [{"name": "2.1", "digest": DIGEST}]})
|
|
45
|
+
latest = get_latest_tag("new_version_available", "1.2")
|
|
46
|
+
self.assertEqual("2.1", latest.version)
|
|
47
|
+
self.assertIsNone(latest.published)
|
|
48
|
+
|
|
49
|
+
def test_multiple_new_versions_available(self, mock_get: Mock):
|
|
50
|
+
"""Test that the newest tag is returned if multiple newer tags are available."""
|
|
51
|
+
mock_get.return_value = mock_response(
|
|
52
|
+
{
|
|
53
|
+
"results": [
|
|
54
|
+
{"name": "2.2", "digest": DIGEST2},
|
|
55
|
+
{"name": "2.1", "digest": DIGEST1},
|
|
56
|
+
{"name": "2.3", "digest": DIGEST3},
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
)
|
|
60
|
+
self.assertEqual("2.3", get_latest_tag("new_versions_available", "1.2").version)
|
|
61
|
+
|
|
62
|
+
def test_ignore_tags_without_digest(self, mock_get: Mock):
|
|
63
|
+
"""Test that tags without digests are ignored."""
|
|
64
|
+
mock_get.return_value = mock_response({"results": [{"name": "2.2", "digest": DIGEST}, {"name": "2.3"}]})
|
|
65
|
+
self.assertEqual("2.2", get_latest_tag("ignore_tags_without_digest", "1.2").version)
|
|
66
|
+
|
|
67
|
+
def test_multiple_new_versions_available_across_pages(self, mock_get: Mock):
|
|
68
|
+
"""Test that the newest tag is returned even if the results are paginated."""
|
|
69
|
+
page1 = mock_response(
|
|
70
|
+
{"results": [{"name": "2.1", "digest": DIGEST1}], "next": "https://example.org/next_page"}
|
|
71
|
+
)
|
|
72
|
+
page2 = mock_response({"results": [{"name": "2.2", "digest": DIGEST2}]})
|
|
73
|
+
mock_get.side_effect = [page1, page2]
|
|
74
|
+
self.assertEqual("2.2", get_latest_tag("pagination", "1.2").version)
|
|
75
|
+
|
|
76
|
+
def test_invalid_new_tag(self, mock_get: Mock):
|
|
77
|
+
"""Test that invalid new tags are ignored."""
|
|
78
|
+
mock_get.return_value = mock_response({"results": [{"name": "invalid", "digest": DIGEST}]})
|
|
79
|
+
self.assertEqual("1.3", get_latest_tag("invalid_new_tag", "1.3").version)
|
|
80
|
+
|
|
81
|
+
def test_prerelease(self, mock_get: Mock):
|
|
82
|
+
"""Test that prerelease tags are ignored."""
|
|
83
|
+
mock_get.return_value = mock_response({"results": [{"name": "1.4a1", "digest": DIGEST}]})
|
|
84
|
+
self.assertEqual("1.3", get_latest_tag("prerelease", "1.3").version)
|
|
85
|
+
|
|
86
|
+
def test_different_suffix(self, mock_get: Mock):
|
|
87
|
+
"""Test that tags for different suffixes are ignored."""
|
|
88
|
+
mock_get.return_value = mock_response({"results": [{"name": "1.4-windows", "digest": DIGEST}]})
|
|
89
|
+
self.assertEqual("1.3", get_latest_tag("different_suffix", "1.3").version)
|
|
90
|
+
|
|
91
|
+
def test_within_cooldown(self, mock_get: Mock):
|
|
92
|
+
"""Test that tags pushed within the cooldown period are ignored."""
|
|
93
|
+
recent = (datetime.now(UTC) - timedelta(days=1)).isoformat()
|
|
94
|
+
mock_get.return_value = mock_response(
|
|
95
|
+
{"results": [{"name": "1.4", "digest": DIGEST, "tag_last_pushed": recent}]}
|
|
96
|
+
)
|
|
97
|
+
self.assertEqual("1.3", get_latest_tag("within_cooldown", "1.3").version)
|
|
98
|
+
|
|
99
|
+
def test_outside_cooldown(self, mock_get: Mock):
|
|
100
|
+
"""Test that tags pushed before the cooldown are considered, with the push date as publication date."""
|
|
101
|
+
old = (datetime.now(UTC) - timedelta(days=10)).isoformat()
|
|
102
|
+
mock_get.return_value = mock_response({"results": [{"name": "1.4", "digest": DIGEST, "tag_last_pushed": old}]})
|
|
103
|
+
latest = get_latest_tag("outside_cooldown", "1.3")
|
|
104
|
+
self.assertEqual("1.4", latest.version)
|
|
105
|
+
self.assertEqual(datetime.fromisoformat(old), latest.published)
|
|
106
|
+
|
|
107
|
+
@patch.dict("os.environ", {"DOCKER_HUB_USERNAME": "joe_doe", "DOCKER_HUB_TOKEN": "pat123"}) # nosec
|
|
108
|
+
@patch("requests.post")
|
|
109
|
+
def test_user_bearer_token(self, mock_post: Mock, mock_get: Mock):
|
|
110
|
+
"""Test that a bearer token is retrieved when Docker Hub credentials are set."""
|
|
111
|
+
mock_get.return_value = mock_response({"results": [{"name": "2.1", "digest": DIGEST}]})
|
|
112
|
+
self.assertEqual("2.1", get_latest_tag("new_version_available_with_credentials", "1.2").version)
|
|
113
|
+
mock_post.assert_called_once_with(
|
|
114
|
+
"https://hub.docker.com/v2/auth/token",
|
|
115
|
+
timeout=10,
|
|
116
|
+
json={"identifier": "joe_doe", "secret": "pat123"}, # nosec
|
|
117
|
+
)
|