pyven 112__tar.gz → 113__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 (38) hide show
  1. {pyven-112 → pyven-113}/PKG-INFO +2 -2
  2. {pyven-112 → pyven-113}/README.md +1 -1
  3. {pyven-112 → pyven-113}/pyven/README.md.aridt +4 -2
  4. {pyven-112 → pyven-113}/pyven/checks.py +43 -9
  5. {pyven-112 → pyven-113}/pyven/files.py +2 -3
  6. {pyven-112 → pyven-113}/pyven/release.py +2 -1
  7. {pyven-112 → pyven-113}/pyven.egg-info/PKG-INFO +2 -2
  8. {pyven-112 → pyven-113}/setup.py +1 -1
  9. {pyven-112 → pyven-113}/pyven/Dockerfile.aridt +0 -0
  10. {pyven-112 → pyven-113}/pyven/__init__.py +0 -0
  11. {pyven-112 → pyven-113}/pyven/bdist.py +0 -0
  12. {pyven-112 → pyven-113}/pyven/container.py +0 -0
  13. {pyven-112 → pyven-113}/pyven/execcheck.py +0 -0
  14. {pyven-112 → pyven-113}/pyven/functions.py +0 -0
  15. {pyven-112 → pyven-113}/pyven/licheck.py +0 -0
  16. {pyven-112 → pyven-113}/pyven/mainmodules.py +0 -0
  17. {pyven-112 → pyven-113}/pyven/metacheck.py +0 -0
  18. {pyven-112 → pyven-113}/pyven/minreqs.py +0 -0
  19. {pyven-112 → pyven-113}/pyven/nlcheck.py +0 -0
  20. {pyven-112 → pyven-113}/pyven/patchpolicy.py +0 -0
  21. {pyven-112 → pyven-113}/pyven/pipify.py +0 -0
  22. {pyven-112 → pyven-113}/pyven/projectinfo.arid +0 -0
  23. {pyven-112 → pyven-113}/pyven/projectinfo.py +0 -0
  24. {pyven-112 → pyven-113}/pyven/pyproject.toml.aridt +0 -0
  25. {pyven-112 → pyven-113}/pyven/release.arid +0 -0
  26. {pyven-112 → pyven-113}/pyven/setup.py.aridt +0 -0
  27. {pyven-112 → pyven-113}/pyven/setuptools.arid +0 -0
  28. {pyven-112 → pyven-113}/pyven/sourceinfo.py +0 -0
  29. {pyven-112 → pyven-113}/pyven/tasks.py +0 -0
  30. {pyven-112 → pyven-113}/pyven/tests/__init__.py +0 -0
  31. {pyven-112 → pyven-113}/pyven/tryinstall.py +0 -0
  32. {pyven-112 → pyven-113}/pyven/util.py +0 -0
  33. {pyven-112 → pyven-113}/pyven.egg-info/SOURCES.txt +0 -0
  34. {pyven-112 → pyven-113}/pyven.egg-info/dependency_links.txt +0 -0
  35. {pyven-112 → pyven-113}/pyven.egg-info/entry_points.txt +0 -0
  36. {pyven-112 → pyven-113}/pyven.egg-info/requires.txt +0 -0
  37. {pyven-112 → pyven-113}/pyven.egg-info/top_level.txt +0 -0
  38. {pyven-112 → pyven-113}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyven
3
- Version: 112
3
+ Version: 113
4
4
  Summary: Manage development of multiple Python projects
5
5
  Home-page: https://pypi.org/project/pyven/
6
6
  Author: Homsar
@@ -16,7 +16,7 @@ Requires-Dist: twine>=1.15.0
16
16
  Requires-Dist: venvpool>=18
17
17
 
18
18
  # pyven
19
- Manage development of multiple Python projects
19
+ Manage development of multiple Python projects.
20
20
 
21
21
  ## Commands
22
22
 
@@ -1,5 +1,5 @@
1
1
  # pyven
2
- Manage development of multiple Python projects
2
+ Manage development of multiple Python projects.
3
3
 
4
4
  ## Commands
5
5
 
@@ -1,5 +1,5 @@
1
1
  # $(name)
2
- $(tagline)$try($.($(verbose_blank)
2
+ $(tagline).$try($.($(verbose_blank)
3
3
 
4
4
  ## Install
5
5
  These are generic installation instructions.
@@ -29,7 +29,9 @@ Get codebase and install executables:
29
29
  git clone git@github.com:$(github account)/$(name).git
30
30
  motivate $(name)
31
31
  ```
32
- Requirements will be satisfied just in time, using sibling projects with matching .egg-info if any.) $.())$try($join$list$first$map($(commands) $.[
32
+ Requirements will be satisfied just in time, using sibling projects with matching .egg-info if any.) $.(
33
+
34
+ This README is auto-generated, see [project wiki]($(wiki_url)) for details.) $.())$try($join$list$first$map($(commands) $.[
33
35
 
34
36
  ## Commands]) $.())$join$map($(commands) $.[
35
37
 
@@ -7,16 +7,20 @@ from argparse import ArgumentParser
7
7
  from aridity.config import ConfigCtrl
8
8
  from aridity.util import NoSuchPathException, openresource
9
9
  from diapyr.util import singleton
10
+ from http import HTTPStatus
10
11
  from itertools import chain
11
- from lagoon.text import diff, pydoc_markdown
12
+ from lagoon.text import diff, pydoc_markdown, tidy
13
+ from lagoon.url import URL
12
14
  from pathlib import Path
13
15
  from setuptools import find_packages
14
16
  from shutil import copy2, copytree, ignore_patterns
17
+ from subprocess import DEVNULL
15
18
  from tempfile import NamedTemporaryFile
16
- from urllib.request import urlopen
19
+ from urllib.error import HTTPError
20
+ from urllib.parse import unquote
17
21
  from venvpool import dotpy, initlogging, Pool, TemporaryDirectory
18
22
  from xml.sax.saxutils import escape as xml_escape
19
- import logging, os, re, sys
23
+ import xml.etree.ElementTree as ET, logging, os, re, sys
20
24
 
21
25
  log = logging.getLogger(__name__)
22
26
  commentregex = ' \N{NUMBER SIGN} .+'
@@ -52,7 +56,7 @@ class EveryVersion:
52
56
  self.transient = transient
53
57
 
54
58
  def allchecks(self, exclude = ()):
55
- for check in self.licheck, self.nlcheck, self.execcheck, self.metacheck, self.pyflakes, self.nose, self.readme, self.github, self.linktree:
59
+ for check in self.licheck, self.nlcheck, self.execcheck, self.metacheck, self.pyflakes, self.nose, self.readme, self.github, self.linktree, self.wiki:
56
60
  if check.__name__ in exclude:
57
61
  log.warning("Exclude: %s", check.__name__)
58
62
  else:
@@ -88,9 +92,31 @@ class EveryVersion:
88
92
  venv.run('check_call', [], 'pyflakes', paths)
89
93
  _runcheck(3, pyflakes)
90
94
 
91
- basenoseargs = '--capture-output', '--exe', '-v', '--with-doctest', '--doctest-extension', '.md', '--with-cov', '--cov-report', 'term-missing', '--with-xunit'
95
+ basenoseargs = '--capture-output', '--exe', '-v', '--with-doctest', '--doctest-extension', '.mediawiki', '--with-cov', '--cov-report', 'term-missing', '--with-xunit'
96
+
97
+ def _spokeurl(self):
98
+ try:
99
+ url = self.info.config.wiki_url
100
+ except AttributeError:
101
+ return
102
+ return URL.text(url[:url.index('/w/')])
92
103
 
93
104
  def nose(self):
105
+ url = self._spokeurl()
106
+ doctestpath = self.info.projectdir / 'var' / 'doctest.mediawiki'
107
+ doctestpath.parent.mkdir(exist_ok = True)
108
+ with doctestpath.open('w') as f:
109
+ if url is not None:
110
+ try:
111
+ result = tidy._asxml(check = False, input = url.w(f"Category:Doctest/{self.info.config.name}"), stderr = DEVNULL)
112
+ except HTTPError as e:
113
+ if e.code != HTTPStatus.NOT_FOUND:
114
+ raise
115
+ else:
116
+ assert result.returncode in {0, 1}
117
+ for a in ET.fromstring(result.stdout).findall('''.//{http://www.w3.org/1999/xhtml}div[@class='mw-category-group']//{http://www.w3.org/1999/xhtml}a'''):
118
+ uri = a.get('href')
119
+ f.write(url('index.php', query = dict(action = 'raw', title = unquote(uri[uri.index('/w/') + 3:]))))
94
120
  upstream_devel_packages = list(self.info.config.upstream.devel.packages)
95
121
  upstream_devel_scripts = list(self.info.config.upstream.devel.scripts) if self.userepo else []
96
122
  # TODO: Facility to freeze test requirements graph.
@@ -98,6 +124,7 @@ class EveryVersion:
98
124
  reportsdir = self.info.projectdir / 'var' / '3'
99
125
  reportsdir.mkdir(exist_ok = True, parents = True)
100
126
  xmlpath = reportsdir / 'nosetests.xml'
127
+ testpaths = self.files.testpaths([doctestpath], xmlpath)
101
128
  if self.docker:
102
129
  coveragepath = self.info.projectdir / '.coverage'
103
130
  with bgcontainer('-v', "{0}:{0}".format('/var/run/docker.sock'), '--network', 'host', '-v', f"{os.path.abspath(self.info.projectdir)}:{Container.workdir}", pyimage(self.info.pyversiontags[0], upstream_devel_packages, upstream_devel_scripts, *installdeps.corereqslayers())) as container:
@@ -106,14 +133,14 @@ class EveryVersion:
106
133
  cpath = lambda p: os.path.relpath(p, self.info.projectdir).replace(os.sep, '/')
107
134
  status = container.inworkdir.nosetests[print](
108
135
  *self.basenoseargs, '--xunit-file', cpath(xmlpath),
109
- *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(cpath, self.files.testpaths(xmlpath)), *self.noseargs,
136
+ *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(cpath, testpaths), *self.noseargs,
110
137
  check = False)
111
138
  else:
112
139
  coveragepath = Path('.coverage')
113
140
  with Pool().readonlyortransient[self.transient](installdeps) as venv:
114
141
  status = venv.run('call', installdeps.localreqs, 'nose', [
115
142
  *self.basenoseargs, '--xunit-file', xmlpath,
116
- *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(str, self.files.testpaths(xmlpath)), *self.noseargs,
143
+ *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(str, testpaths), *self.noseargs,
117
144
  ])
118
145
  if coveragepath.exists():
119
146
  copy2(coveragepath, reportsdir / 'coverage') # Replace whatever the status, as if we configured the location.
@@ -186,10 +213,17 @@ class EveryVersion:
186
213
  account = self.info.config.linktree.account
187
214
  if account is None:
188
215
  return skip
189
- with urlopen(f"https://linktr.ee/{account}") as f: # TODO: Percent-encode.
190
- assert f">{xml_escape(self.info.config.name)} \N{BULLET} {xml_escape(self.info.config.tagline)}<" in f.read().decode('utf-8') # TODO: Deduce encoding, consider lagoon URL.
216
+ assert f">{xml_escape(self.info.config.name)} \N{BULLET} {xml_escape(self.info.config.tagline)}<" in URL.text('https://linktr.ee')(account)
191
217
  _runcheck('*', linktree)
192
218
 
219
+ def wiki(self):
220
+ def wiki():
221
+ url = self._spokeurl()
222
+ if url is None:
223
+ return skip
224
+ assert url('index.php', query = dict(action = 'raw', title = f"Template:{self.info.config.name}/tagline")) == self.info.config.tagline
225
+ _runcheck('*', wiki)
226
+
193
227
  def main():
194
228
  initlogging()
195
229
  parser = ArgumentParser()
@@ -29,12 +29,11 @@ class Files:
29
29
  def __init__(self, root):
30
30
  srcsuffixes = [x for s in ['.py', '.py3', '.pyx', '.s', '.sh', '.h', '.cpp', '.cxx', '.arid', '.gradle', '.java', '.mk', '.md'] for x in [s, f"{s}.aridt"]]
31
31
  self.allsrcpaths = [root / p for p in self.relpaths(root, srcsuffixes, ['Dockerfile', 'Makefile'])]
32
- self.docpaths = [p for p in self.allsrcpaths if p.name.endswith('.md')]
33
32
  self.pypaths = [p for p in self.allsrcpaths if p.name.endswith('.py')]
34
33
  self.root = root
35
34
 
36
- def testpaths(self, reportpath):
37
- paths = [p for p in self.pypaths if os.path.basename(p).startswith('test_')] + self.docpaths
35
+ def testpaths(self, docpaths, reportpath):
36
+ paths = [p for p in self.pypaths if os.path.basename(p).startswith('test_')] + docpaths
38
37
  if reportpath.exists():
39
38
  with reportpath.open() as f:
40
39
  doc = dom.parse(f)
@@ -100,6 +100,7 @@ def _textcontent(node):
100
100
 
101
101
  def _nextversionno(name):
102
102
  pattern = re.compile('-([0-9]+)[-.]')
103
+ log.debug('Check PyPI for existing release.')
103
104
  try:
104
105
  with urlopen(f"https://pypi.org/simple/{name}/") as f:
105
106
  doc = dom.parseString(tidy._asxml(input = f.read()))
@@ -165,7 +166,7 @@ def main():
165
166
  initlogging()
166
167
  config = ConfigCtrl().loadappconfig(main, 'release.arid')
167
168
  parser = ArgumentParser()
168
- parser.add_argument('--retry', action = 'store_true')
169
+ parser.add_argument('--retry', action = 'store_true', help = 'use artifacts in dist dir')
169
170
  parser.add_argument('--upload', action = 'store_true')
170
171
  parser.add_argument('path', nargs = '?', default = '.')
171
172
  parser.parse_args(namespace = config.cli)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyven
3
- Version: 112
3
+ Version: 113
4
4
  Summary: Manage development of multiple Python projects
5
5
  Home-page: https://pypi.org/project/pyven/
6
6
  Author: Homsar
@@ -16,7 +16,7 @@ Requires-Dist: twine>=1.15.0
16
16
  Requires-Dist: venvpool>=18
17
17
 
18
18
  # pyven
19
- Manage development of multiple Python projects
19
+ Manage development of multiple Python projects.
20
20
 
21
21
  ## Commands
22
22
 
@@ -49,7 +49,7 @@ class SourceInfo:
49
49
  sourceinfo = SourceInfo('.')
50
50
  setup(
51
51
  name = 'pyven',
52
- version = '112',
52
+ version = '113',
53
53
  description = 'Manage development of multiple Python projects',
54
54
  url = 'https://pypi.org/project/pyven/',
55
55
  author = 'Homsar',
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
File without changes
File without changes