poxy 0.16.0__py3-none-any.whl → 0.17.1__py3-none-any.whl

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.
poxy/main.py CHANGED
@@ -141,7 +141,7 @@ def multi_version_git_tags(args: argparse.Namespace):
141
141
  tags = sorted(tags, key=lambda t: t[1], reverse=True)
142
142
  tags.insert(0, (default_branch, (999999, 999999, 999999, 999999)))
143
143
 
144
- if 0:
144
+ if args.squash_patches:
145
145
  # squash patch/rev differences
146
146
  seen_versions = set()
147
147
  for i in range(len(tags)):
@@ -152,6 +152,25 @@ def multi_version_git_tags(args: argparse.Namespace):
152
152
  seen_versions.add(normalized_version)
153
153
  tags = [t for t in tags if t]
154
154
 
155
+ if args.min_version is not None:
156
+ args.min_version = re.sub(r'[ \t]+', '', str(args.min_version).strip())
157
+ m = re.fullmatch(r'^[vV]?([0-9]+)(?:[.]([0-9]+)(?:[.]([0-9]+)(?:[.]([0-9]+))?)?)?$', args.min_version)
158
+ if m:
159
+ min_ver = (
160
+ (int(m[1] if m[1] else 0)),
161
+ (int(m[2] if m[2] else 0)),
162
+ (int(m[3] if m[3] else 0)),
163
+ (int(m[4] if m[4] else 0)),
164
+ )
165
+ tags = [t for t in tags if t[1] >= min_ver]
166
+ else:
167
+ try:
168
+ max_vers = int(args.min_version)
169
+ assert max_vers < 0
170
+ tags = tags[:-max_vers]
171
+ except:
172
+ raise Error(rf'min-version: expected semver tag or negative integer')
173
+
155
174
  tags = [t for t, _ in tags]
156
175
  print("Versions:")
157
176
  print("\n".join([rf' {t}' for t in tags]))
@@ -159,7 +178,16 @@ def multi_version_git_tags(args: argparse.Namespace):
159
178
  worker_args = [
160
179
  arg
161
180
  for arg in sys.argv[1:]
162
- if arg not in (r'--bug-report', r'--git-tags', r'--worker', r'--versions-in-navbar', r'--verbose', r'-v')
181
+ if arg
182
+ not in (
183
+ r'--bug-report',
184
+ r'--git-tags',
185
+ r'--worker',
186
+ r'--versions-in-navbar',
187
+ r'--verbose',
188
+ r'-v',
189
+ r'--higest-patch-only',
190
+ )
163
191
  ]
164
192
  for key in (r'--output-dir', r'--temp-dir', r'--copy-config-to'):
165
193
  pos = -1
@@ -430,7 +458,7 @@ def main(invoker=True):
430
458
  type=str,
431
459
  default=None,
432
460
  metavar=r'<regex>',
433
- help=r"pattern matching HTML file names to exclude from post-processing (default: none)",
461
+ help=r"pattern matching HTML file names to exclude from post-processing (default: %(default)s)",
434
462
  )
435
463
  args.add_argument(
436
464
  r'--theme', #
@@ -456,6 +484,19 @@ def main(invoker=True):
456
484
  args.add_argument(
457
485
  r'--git-tags', action=r'store_true', help=r"add git-tag-based semver version switcher to the generated HTML" #
458
486
  )
487
+ make_boolean_optional_arg(
488
+ args,
489
+ r'squash-patches',
490
+ default=True,
491
+ help='when using --git-tags and two version tags differ by a patch number,\ngenerate docs for the highest one only (default: %(default)s)',
492
+ )
493
+ args.add_argument(
494
+ r'--min-version',
495
+ type=str,
496
+ default=None,
497
+ metavar='<version>',
498
+ help='sets the minimum version number to emit when using --git-tags,\nor a negative integer to mean "the last N versions". (default: %(default)s)',
499
+ )
459
500
 
460
501
  # --------------------------------------------------------------
461
502
  # hidden/developer-only/deprecated/diagnostic arguments
poxy/project.py CHANGED
@@ -7,6 +7,7 @@
7
7
  Everything relating to the 'project context' object that describes the project for which the documentation is being generated.
8
8
  """
9
9
 
10
+ import sys
10
11
  import copy
11
12
  import os
12
13
 
@@ -1222,7 +1223,10 @@ class Context(object):
1222
1223
  html_exclude = re.compile(str(html_exclude))
1223
1224
  self.html_exclude = html_exclude
1224
1225
 
1225
- self.now = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc)
1226
+ if (sys.version_info[0], sys.version_info[1]) >= (3, 11):
1227
+ self.now = datetime.datetime.now(datetime.UTC).replace(microsecond=0)
1228
+ else:
1229
+ self.now = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc)
1226
1230
 
1227
1231
  self.verbose_value(r'dirs.PACKAGE', paths.PACKAGE)
1228
1232
  self.verbose_value(r'dirs.CSS', paths.CSS)
@@ -1657,7 +1661,7 @@ class Context(object):
1657
1661
  if source and dest:
1658
1662
  if is_uri(source):
1659
1663
  file = Path(
1660
- paths.TEMP, rf'tagfile_{sha1(source)}_{self.now.year}_{self.now.isocalendar().week}.xml'
1664
+ paths.TEMP, rf'tagfile_{sha1(source)}_{self.now.year}_{self.now.isocalendar()[1]}.xml'
1661
1665
  )
1662
1666
  self.tagfiles[source] = (file, dest)
1663
1667
  self.unresolved_tagfiles = True
poxy/version.txt CHANGED
@@ -1 +1 @@
1
- 0.16.0
1
+ 0.17.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: poxy
3
- Version: 0.16.0
3
+ Version: 0.17.1
4
4
  Summary: Documentation generator for C++.
5
5
  Author-email: Mark Gillard <mark.gillard@outlook.com.au>
6
6
  License: MIT
@@ -101,14 +101,16 @@ Poxy is a command-line application.
101
101
  ```
102
102
  usage: poxy [-h] [-v] [--html | --no-html] [--ppinclude <regex>] [--ppexclude <regex>]
103
103
  [--theme {light,dark,custom}] [--threads N] [--version] [--xml | --no-xml]
104
- [--werror | --no-werror] [--bug-report] [--git-tags] [config]
104
+ [--werror | --no-werror] [--bug-report] [--git-tags]
105
+ [--squash-patches | --no-squash-patches] [--min-version <version>]
106
+ [config]
105
107
 
106
108
  _ __ _____ ___ _
107
109
  | '_ \ / _ \ \/ / | | |
108
110
  | |_) | (_) > <| |_| |
109
111
  | .__/ \___/_/\_\\__, |
110
112
  | | __/ |
111
- |_| |___/ v0.16.0 - github.com/marzer/poxy
113
+ |_| |___/ v0.17.0 - github.com/marzer/poxy
112
114
 
113
115
  Generate fancy C++ documentation.
114
116
 
@@ -120,15 +122,22 @@ options:
120
122
  -v, --verbose enable very noisy diagnostic output
121
123
  --html, --no-html specify whether HTML output is required
122
124
  --ppinclude <regex> pattern matching HTML file names to post-process (default: all)
123
- --ppexclude <regex> pattern matching HTML file names to exclude from post-processing (default: none)
125
+ --ppexclude <regex> pattern matching HTML file names to exclude from post-processing (default: None)
124
126
  --theme {light,dark,custom}
125
127
  sets the default visual theme (default: read from config)
126
128
  --threads N set the number of threads to use (default: automatic)
127
129
  --version print the version and exit
128
130
  --xml, --no-xml specify whether XML output is required
129
- --werror, --no-werror treat warnings as errors (default: read from config)
131
+ --werror, --no-werror
132
+ treat warnings as errors (default: read from config)
130
133
  --bug-report captures all output in a zip file for easier bug reporting.
131
134
  --git-tags add git-tag-based semver version switcher to the generated HTML
135
+ --squash-patches, --no-squash-patches
136
+ when using --git-tags and two version tags differ by a patch number,
137
+ generate docs for the highest one only (default: True)
138
+ --min-version <version>
139
+ sets the minimum version number to emit when using --git-tags,
140
+ or a negative integer to mean "the last N versions". (default: None)
132
141
  ```
133
142
 
134
143
  The basic three-step to using Poxy is similar to Doxygen:
@@ -212,6 +221,14 @@ Poxy bundles a fork of m.css, used per the [MIT/Expat license](https://github.co
212
221
 
213
222
  # Changelog
214
223
 
224
+ ## v0.17.1 - 2024-06-14
225
+
226
+ - Fixed `'tuple' object has no attribute 'week'` error on Python &lt;= 3.8
227
+
228
+ ## v0.17.0 - 2024-04-21
229
+
230
+ - added arguments `--min-version` and `--squash-patches` for more control over `--git-tags` mode
231
+
215
232
  ## v0.16.0 - 2024-01-28
216
233
 
217
234
  - added multi-version mode argument `--git-tags`
@@ -5,10 +5,10 @@ poxy/doxygen.py,sha256=nHygTYfKqh4M0hcdomWK5J3T16GZ7owM5oaWa141Ky4,46372
5
5
  poxy/emoji.py,sha256=Vj2ZbUq1MewLMVoLtH2xP_jZToRoNi52AgrIg3VhUuU,3410
6
6
  poxy/fixers.py,sha256=aUIQu4YEaygDK4YIaQJ9HsbP6uUKR3XYfroJQeps64M,44783
7
7
  poxy/graph.py,sha256=xI7xoV6-yTM-gh2OBARakANLHzGYBwwhwJHchQz2EKw,31959
8
- poxy/main.py,sha256=vSJWm54MNx9yDwobwL-qrTImSAU-bZsj_O3rOcZobYo,25482
8
+ poxy/main.py,sha256=X8IvjjEnxwV0oT2lv5cP24CQjxHKpsxDmfByoPP2gxg,26937
9
9
  poxy/mcss.py,sha256=j9PmkfjcwaKdKBauwiPKhSeKGNmGiBt0i_WcnVAV3Hk,2157
10
10
  poxy/paths.py,sha256=OqyP9bIIhW0zyWL6PV2TVV9zsrtvnb25_XNmHlFJmQ8,1540
11
- poxy/project.py,sha256=TMb3kiMhlvvu4X4XsdtwrhbF2vWOZoeAKu15aMu3bbY,96377
11
+ poxy/project.py,sha256=MdaRQKL2w9BQ-QS8h7P2TKJy-hopFeYmYv2X54jlhvk,96552
12
12
  poxy/repos.py,sha256=rUOVTvR6KxrkSvEA0S340OzMStbSk2SBJUEzKEIynzc,3945
13
13
  poxy/run.py,sha256=ze2A5YI26KXFrh-t1wGODgIJQRo5lR9-9eQhvhnloZc,77049
14
14
  poxy/schemas.py,sha256=57qLWubeIWQUwwTpjRBggPBy70PTQS5JWKzUDKRuBkQ,2490
@@ -16,7 +16,7 @@ poxy/soup.py,sha256=gMXKigNJDuJWWFhPpD5Gu9gbeyVVXo7SrjL1GcsqlMs,7678
16
16
  poxy/svg.py,sha256=tsMcKIxQ8OVmXEabqwKDkdEqYV4zI5wM0AJ-E1EXmVo,2657
17
17
  poxy/utils.py,sha256=0_HRU6GxlwJ5TXPJId2j8zQJnUZ8TJBiBU6wqgrMjrI,5748
18
18
  poxy/version.py,sha256=N5I7nr5zcmAy-hhgZFi7KfFPV-lB_ueD_Xx6R7XQ-tk,668
19
- poxy/version.txt,sha256=qgN0VLXoMgUhoysnij9K_wX8eQCatVA_XUobmjOzjEc,7
19
+ poxy/version.txt,sha256=zYHsGXZ_-4B7rabUhXihjXeimts5TgnpzfzV6p7rtqI,7
20
20
  poxy/xml_utils.py,sha256=dJEtHyp4lORHhmBt1E9miRH48PpPM6WRlLEdMhn0Yi8,2183
21
21
  poxy/css/m-special.css,sha256=dLVigwqsg_Htm6CESQGemyOKjb-plBlFk54dsAoOd_A,4644
22
22
  poxy/css/m-theme-dark.css,sha256=UbAEz9JAgJ1PJJG-Oy9UG2_DUqYTaPJm1cDvVGy5kYk,4186
@@ -176,10 +176,10 @@ poxy/mcss/plugins/m/plots.py,sha256=tiPvTZDkJ-Ab7xSVUhi5CFf_KvO017ZEtxS-ZQYJPiM,
176
176
  poxy/mcss/plugins/m/qr.py,sha256=EpYTecbB0m6IzJMDNpIeMjh3-bxisGw6sCdQgL3_Zl4,4183
177
177
  poxy/mcss/plugins/m/sphinx.py,sha256=OZHtZ0qVHYHGxJVpSARk_WQiIr6o9B-CTqx2Limfyuw,30965
178
178
  poxy/mcss/plugins/m/vk.py,sha256=MiZeFEagOkMBHfNXYf1YEaooCbgoGBtFY9K16CDqdaw,3108
179
- poxy-0.16.0.dist-info/LICENSE.txt,sha256=kp84JW_RPClTO5Hz6yHQ9jKPfUMerlHHAeyU0VpXV_E,1064
180
- poxy-0.16.0.dist-info/METADATA,sha256=3mZOiXlYggf6eJ-K9UO2zHe6nTYxq7Bn4YuqHYSJCkQ,19029
181
- poxy-0.16.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
182
- poxy-0.16.0.dist-info/entry_points.txt,sha256=yWiOmptj1Ga_dDEU9ch16hRgmzDE8bgrtDkGbH7VFYc,66
183
- poxy-0.16.0.dist-info/top_level.txt,sha256=vAxxbZDX_cQ6rfRZ1SYSStSdMMlsHEP-zgzBSB0gPco,5
184
- poxy-0.16.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
185
- poxy-0.16.0.dist-info/RECORD,,
179
+ poxy-0.17.1.dist-info/LICENSE.txt,sha256=kp84JW_RPClTO5Hz6yHQ9jKPfUMerlHHAeyU0VpXV_E,1064
180
+ poxy-0.17.1.dist-info/METADATA,sha256=yS00SWelUhU8TJlpJ4uclV0SxpIXKpxHHsHPU9byEPs,19807
181
+ poxy-0.17.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
182
+ poxy-0.17.1.dist-info/entry_points.txt,sha256=yWiOmptj1Ga_dDEU9ch16hRgmzDE8bgrtDkGbH7VFYc,66
183
+ poxy-0.17.1.dist-info/top_level.txt,sha256=vAxxbZDX_cQ6rfRZ1SYSStSdMMlsHEP-zgzBSB0gPco,5
184
+ poxy-0.17.1.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
185
+ poxy-0.17.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5