pyven 115__tar.gz → 117__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-115 → pyven-117}/PKG-INFO +12 -4
  2. {pyven-115 → pyven-117}/pyven/checks.py +14 -9
  3. {pyven-115 → pyven-117}/pyven/files.py +2 -2
  4. {pyven-115 → pyven-117}/pyven/pipify.py +6 -7
  5. {pyven-115 → pyven-117}/pyven/projectinfo.py +6 -10
  6. {pyven-115 → pyven-117}/pyven/release.py +4 -4
  7. {pyven-115 → pyven-117}/pyven.egg-info/PKG-INFO +12 -4
  8. {pyven-115 → pyven-117}/pyven.egg-info/requires.txt +3 -2
  9. {pyven-115 → pyven-117}/setup.py +2 -2
  10. {pyven-115 → pyven-117}/README.md +0 -0
  11. {pyven-115 → pyven-117}/pyven/Dockerfile.aridt +0 -0
  12. {pyven-115 → pyven-117}/pyven/README.md.aridt +0 -0
  13. {pyven-115 → pyven-117}/pyven/__init__.py +0 -0
  14. {pyven-115 → pyven-117}/pyven/bdist.py +0 -0
  15. {pyven-115 → pyven-117}/pyven/container.py +0 -0
  16. {pyven-115 → pyven-117}/pyven/execcheck.py +0 -0
  17. {pyven-115 → pyven-117}/pyven/functions.py +0 -0
  18. {pyven-115 → pyven-117}/pyven/licheck.py +0 -0
  19. {pyven-115 → pyven-117}/pyven/mainmodules.py +0 -0
  20. {pyven-115 → pyven-117}/pyven/metacheck.py +0 -0
  21. {pyven-115 → pyven-117}/pyven/minreqs.py +0 -0
  22. {pyven-115 → pyven-117}/pyven/nlcheck.py +0 -0
  23. {pyven-115 → pyven-117}/pyven/patchpolicy.py +0 -0
  24. {pyven-115 → pyven-117}/pyven/projectinfo.arid +0 -0
  25. {pyven-115 → pyven-117}/pyven/pyproject.toml.aridt +0 -0
  26. {pyven-115 → pyven-117}/pyven/release.arid +0 -0
  27. {pyven-115 → pyven-117}/pyven/setup.py.aridt +0 -0
  28. {pyven-115 → pyven-117}/pyven/setuptools.arid +0 -0
  29. {pyven-115 → pyven-117}/pyven/sourceinfo.py +0 -0
  30. {pyven-115 → pyven-117}/pyven/tasks.py +0 -0
  31. {pyven-115 → pyven-117}/pyven/tests/__init__.py +0 -0
  32. {pyven-115 → pyven-117}/pyven/tryinstall.py +0 -0
  33. {pyven-115 → pyven-117}/pyven/util.py +0 -0
  34. {pyven-115 → pyven-117}/pyven.egg-info/SOURCES.txt +0 -0
  35. {pyven-115 → pyven-117}/pyven.egg-info/dependency_links.txt +0 -0
  36. {pyven-115 → pyven-117}/pyven.egg-info/entry_points.txt +0 -0
  37. {pyven-115 → pyven-117}/pyven.egg-info/top_level.txt +0 -0
  38. {pyven-115 → pyven-117}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pyven
3
- Version: 115
3
+ Version: 117
4
4
  Summary: Manage development of multiple Python projects
5
5
  Home-page: https://pypi.org/project/pyven/
6
6
  Author: Homsar
@@ -8,13 +8,21 @@ Author-email: homsar@foyono.com
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: aridity>=85
10
10
  Requires-Dist: diapyr>=31
11
- Requires-Dist: foyndation>=10
12
- Requires-Dist: lagoon>=49
11
+ Requires-Dist: foyndation>=16
12
+ Requires-Dist: lagoon>=63
13
+ Requires-Dist: packaging>=25
13
14
  Requires-Dist: pydoc-markdown>=3.3
14
15
  Requires-Dist: roman>=5
15
16
  Requires-Dist: setuptools>=44.1.1
16
17
  Requires-Dist: twine>=1.15.0
17
18
  Requires-Dist: venvpool>=18
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: requires-dist
25
+ Dynamic: summary
18
26
 
19
27
  # pyven
20
28
  Manage development of multiple Python projects.
@@ -5,13 +5,15 @@ from .projectinfo import ProjectInfo, SimpleInstallDeps
5
5
  from .util import Excludes, stderr
6
6
  from argparse import ArgumentParser
7
7
  from aridity.config import ConfigCtrl
8
- from aridity.util import NoSuchPathException, openresource
8
+ from aridity.util import NoSuchPathException
9
9
  from foyndation import dotpy, initlogging, singleton
10
10
  from http import HTTPStatus
11
+ from importlib.resources import files
11
12
  from itertools import chain
12
13
  from lagoon.text import diff, pydoc_markdown, tidy
13
14
  from lagoon.url import URL
14
15
  from pathlib import Path
16
+ from pstats import SortKey, Stats
15
17
  from setuptools import find_packages
16
18
  from shutil import copy2, copytree, ignore_patterns
17
19
  from subprocess import DEVNULL
@@ -92,7 +94,7 @@ class EveryVersion:
92
94
  venv.run('check_call', [], 'pyflakes', paths)
93
95
  _runcheck(3, pyflakes)
94
96
 
95
- basenoseargs = '--capture-output', '--exe', '-v', '--with-doctest', '--doctest-extension', '.mediawiki', '--with-cov', '--cov-report', 'term-missing', '--with-xunit'
97
+ basenoseargs = '--capture-output', '--exe', '-v', '--with-doctest', '--doctest-extension', '.mediawiki', '--with-cov', '--cov-report', 'term-missing', '--with-xunit', '--with-cprofile', '--cprofile-stats-erase'
96
98
 
97
99
  def _spokeurl(self):
98
100
  try:
@@ -108,7 +110,7 @@ class EveryVersion:
108
110
  with doctestpath.open('w') as f:
109
111
  if url is not None:
110
112
  try:
111
- result = tidy._asxml(check = False, input = url.w(f"Category:Doctest/{self.info.config.name}"), stderr = DEVNULL)
113
+ result = tidy._asxml[::DEVNULL](check = False, input = url.w(f"Category:Doctest/{self.info.config.name}"))
112
114
  except HTTPError as e:
113
115
  if e.code != HTTPStatus.NOT_FOUND:
114
116
  raise
@@ -120,10 +122,11 @@ class EveryVersion:
120
122
  upstream_devel_packages = list(self.info.config.upstream.devel.packages)
121
123
  upstream_devel_scripts = list(self.info.config.upstream.devel.scripts) if self.userepo else []
122
124
  # TODO: Facility to freeze test requirements graph.
123
- with InstallDeps(self.info, ('nose-cov', 'pynose', *self.info.config.test.requires), self.siblings, _localrepo(), self.userepo) as installdeps:
125
+ with InstallDeps(self.info, ('nose-cprof', 'nose-cov', 'pynose', *self.info.config.test.requires), self.siblings, _localrepo(), self.userepo) as installdeps:
124
126
  reportsdir = self.info.projectdir / 'var' / '3'
125
127
  reportsdir.mkdir(exist_ok = True, parents = True)
126
128
  xmlpath = reportsdir / 'nosetests.xml'
129
+ statspath = reportsdir / 'stats.dat'
127
130
  testpaths = self.files.testpaths([doctestpath], xmlpath)
128
131
  if self.docker:
129
132
  coveragepath = self.info.projectdir / '.coverage'
@@ -132,19 +135,21 @@ class EveryVersion:
132
135
  container.installasuser(installdeps.containerrequires())
133
136
  cpath = lambda p: os.path.relpath(p, self.info.projectdir).replace(os.sep, '/')
134
137
  status = container.inworkdir.nosetests[print](
135
- *self.basenoseargs, '--xunit-file', cpath(xmlpath),
136
- *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(cpath, testpaths), *self.noseargs,
138
+ *self.basenoseargs, '--xunit-file', cpath(xmlpath), '--cprofile-stats-file', cpath(statspath),
139
+ *chain.from_iterable(['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), *map(cpath, testpaths), *self.noseargs,
137
140
  check = False)
138
141
  else:
139
142
  coveragepath = Path('.coverage')
140
143
  with Pool().readonlyortransient[self.transient](installdeps) as venv:
141
144
  status = venv.run('call', installdeps.localreqs, 'nose', [
142
- *self.basenoseargs, '--xunit-file', xmlpath,
143
- *sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []), *map(str, testpaths), *self.noseargs,
145
+ *self.basenoseargs, '--xunit-file', xmlpath, '--cprofile-stats-file', statspath,
146
+ *chain.from_iterable(['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), *map(str, testpaths), *self.noseargs,
144
147
  ])
145
148
  if coveragepath.exists():
146
149
  copy2(coveragepath, reportsdir / 'coverage') # Replace whatever the status, as if we configured the location.
147
150
  coveragepath.unlink() # Can't simply use rename cross-device in release case.
151
+ if not status:
152
+ Stats(str(statspath)).sort_stats(SortKey.CUMULATIVE).print_stats(50)
148
153
  assert not status
149
154
 
150
155
  def readme(self):
@@ -191,7 +196,7 @@ class EveryVersion:
191
196
  if self.info.config.pydoc_enabled:
192
197
  cc.w.pydoc = getpydoc(mainmodules)
193
198
  with NamedTemporaryFile('w') as g:
194
- with openresource(__name__, 'README.md.aridt') as f:
199
+ with (files(__spec__.parent) / 'README.md.aridt').open(encoding = 'ascii') as f:
195
200
  cc.processtemplate(f, g)
196
201
  g.flush()
197
202
  completed = diff(g.name, self.info.projectdir / 'README.md', check = False)
@@ -1,5 +1,5 @@
1
1
  from collections import defaultdict
2
- from foyndation import dotpy
2
+ from foyndation import dotpy, inf
3
3
  from lagoon.program import partial
4
4
  from lagoon.text import git
5
5
  from pathlib import Path
@@ -49,5 +49,5 @@ class Files:
49
49
  if name in nametopath:
50
50
  pathtotime[nametopath[name]] += float(e.getAttribute('time'))
51
51
  break
52
- paths.sort(key = lambda p: pathtotime.get(p, float('inf')))
52
+ paths.sort(key = lambda p: pathtotime.get(p, inf))
53
53
  return paths
@@ -5,18 +5,18 @@ from aridity.config import ConfigCtrl
5
5
  from diapyr.util import bfs
6
6
  from email.parser import Parser
7
7
  from foyndation import initlogging, solo
8
+ from importlib.resources import as_file, files
8
9
  from itertools import chain
9
10
  from lagoon.program import Program
10
11
  from lagoon.text import git
11
12
  from pathlib import Path
12
- from pkg_resources import resource_filename
13
13
  from shutil import copytree, rmtree
14
14
  from tempfile import mkdtemp
15
15
  from venvpool import Pool
16
16
  import logging, os
17
17
 
18
18
  log = logging.getLogger(__name__)
19
- setuptoolsreq = 'setuptools>=69.3,<75.8'
19
+ setuptoolsreq = 'setuptools>=75.8.1,<77'
20
20
 
21
21
  def pipify(info, version):
22
22
  # Allow release of project without origin:
@@ -58,11 +58,10 @@ console_scripts := $list()
58
58
  cc.w.build_requires += name
59
59
  if proc.donekeys != {'setuptools', 'wheel'}:
60
60
  tasks.append(['pyproject.toml', 'pyproject.toml.aridt', 'tomlquote'])
61
- for name, template, quote in tasks:
62
- cc.execute(f'" = $({quote})')
63
- cc.processtemplate(
64
- resource_filename(__name__, template), # TODO LATER: Make aridity get the resource.
65
- os.path.abspath(info.projectdir / name))
61
+ with as_file(files(__spec__.parent)) as parent:
62
+ for name, template, quote in tasks:
63
+ cc.execute(f'" = $({quote})')
64
+ cc.processtemplate(parent / template, (info.projectdir / name).absolute()) # TODO LATER: Make aridity get the resource.
66
65
 
67
66
  def main():
68
67
  initlogging()
@@ -3,12 +3,12 @@ from .files import Files
3
3
  from .util import Seek
4
4
  from aridity.config import ConfigCtrl
5
5
  from aridity.model import Entry, Resource
6
- from aridity.util import openresource
7
6
  from foyndation import dotpy, rmsuffix, solo
7
+ from importlib.resources import files
8
8
  from inspect import getsource
9
9
  from lagoon.program import Program
10
10
  from lagoon.text import git
11
- from pkg_resources import parse_requirements
11
+ from packaging.requirements import Requirement
12
12
  from roman import fromRoman, toRoman
13
13
  from setuphacks import getsetupkwargs
14
14
  from urllib.error import HTTPError
@@ -29,7 +29,7 @@ class Req:
29
29
 
30
30
  @classmethod
31
31
  def parselines(cls, lines):
32
- return [cls(parsed) for parsed in parse_requirements(lines)]
32
+ return [cls(Requirement(l)) for l in lines]
33
33
 
34
34
  @property
35
35
  def namepart(self):
@@ -51,7 +51,7 @@ class Req:
51
51
  self.parsed = parsed
52
52
 
53
53
  def acceptversion(self, versionstr):
54
- return versionstr in self.parsed
54
+ return versionstr in self.parsed.specifier
55
55
 
56
56
  def siblingpath(self, workspace):
57
57
  return workspace / self.namepart
@@ -75,10 +75,6 @@ class Req:
75
75
  if 'UndefinedEnvironmentName' != type(e).__name__:
76
76
  raise
77
77
 
78
- def keyversion(self):
79
- s, = self.specifierset
80
- return self.parsed.key, s.version
81
-
82
78
  class SimpleInstallDeps(ParsedRequires):
83
79
 
84
80
  parselines = staticmethod(Req.parselines)
@@ -106,7 +102,7 @@ class ProjectInfo:
106
102
  return cls._setuptoolsinfo(setupseek.path)
107
103
  log.info('Use uninstallable mode.')
108
104
  projectdir = Seek.seek(realdir, '.git').path.parent
109
- with openresource(__name__, 'setuptools.arid') as f:
105
+ with (files(__spec__.parent) / 'setuptools.arid').open(encoding = 'ascii') as f:
110
106
  info = cls(projectdir, f)
111
107
  info.config.name = os.path.basename(os.path.abspath(projectdir))
112
108
  try:
@@ -117,7 +113,7 @@ class ProjectInfo:
117
113
 
118
114
  @classmethod
119
115
  def _setuptoolsinfo(cls, setuppath):
120
- with openresource(__name__, 'setuptools.arid') as f:
116
+ with (files(__spec__.parent) / 'setuptools.arid').open(encoding = 'ascii') as f:
121
117
  info = cls(setuppath.parent, f)
122
118
  setupkwargs = getsetupkwargs(setuppath, ['name', 'install_requires', 'entry_points'])
123
119
  if 'name' in setupkwargs:
@@ -7,11 +7,11 @@ from .sourceinfo import SourceInfo
7
7
  from argparse import ArgumentParser
8
8
  from aridity.config import ConfigCtrl
9
9
  from foyndation import dotpy, initlogging, singleton, solo
10
+ from importlib.resources import as_file, files
10
11
  from itertools import chain
11
12
  from lagoon.binary import tidy
12
13
  from lagoon.program import NOEOL, partial, Program
13
14
  from lagoon.text import docker, git
14
- from pkg_resources import resource_filename
15
15
  from shutil import copy2, copytree, rmtree
16
16
  from tempfile import NamedTemporaryFile, TemporaryDirectory
17
17
  from urllib.error import HTTPError
@@ -61,7 +61,7 @@ class Image:
61
61
  scripts = list(info.config.devel.scripts)
62
62
  packages = list(info.config.devel.packages)
63
63
  # TODO: Copy not mount so we can run containers in parallel.
64
- with bgcontainer('-v', f"{info.projectdir}:/io", f"{self.prefix}{self.plat}:{self.imagetag}") as container:
64
+ with bgcontainer('-v', f"{info.projectdir}:/io", f"{self.prefix}{self.plat}:{self.imagetag}") as container, as_file(files(__spec__.parent)) as parent:
65
65
  def run(execargs, command):
66
66
  docker.exec[print](*execargs, container.cid, *self.arch.entrypoint, *command)
67
67
  if packages:
@@ -71,9 +71,9 @@ class Image:
71
71
  dirpath = docker.exec[NOEOL](container.cid, 'mktemp', '-d') # No need to cleanup, will die with container.
72
72
  log.debug("In container dir %s run script: %s", dirpath, script)
73
73
  run(['-w', dirpath, '-t'], ['sh', '-c', script])
74
- docker.cp[print](resource_filename(__name__, 'patchpolicy.py'), f"{container.cid}:/patchpolicy.py")
74
+ docker.cp[print](parent / 'patchpolicy.py', f"{container.cid}:/patchpolicy.py")
75
75
  run([], [self.pythonexe, '/patchpolicy.py'])
76
- docker.cp[print](resource_filename(__name__, 'bdist.py'), f"{container.cid}:/bdist.py")
76
+ docker.cp[print](parent / 'bdist.py', f"{container.cid}:/bdist.py")
77
77
  run(['-u', f"{os.geteuid()}:{os.getegid()}", '-w', '/io'], [self.pythonexe, '/bdist.py', '--plat', self.plat])
78
78
 
79
79
  def _uploadableartifacts(artifactrelpaths):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pyven
3
- Version: 115
3
+ Version: 117
4
4
  Summary: Manage development of multiple Python projects
5
5
  Home-page: https://pypi.org/project/pyven/
6
6
  Author: Homsar
@@ -8,13 +8,21 @@ Author-email: homsar@foyono.com
8
8
  Description-Content-Type: text/markdown
9
9
  Requires-Dist: aridity>=85
10
10
  Requires-Dist: diapyr>=31
11
- Requires-Dist: foyndation>=10
12
- Requires-Dist: lagoon>=49
11
+ Requires-Dist: foyndation>=16
12
+ Requires-Dist: lagoon>=63
13
+ Requires-Dist: packaging>=25
13
14
  Requires-Dist: pydoc-markdown>=3.3
14
15
  Requires-Dist: roman>=5
15
16
  Requires-Dist: setuptools>=44.1.1
16
17
  Requires-Dist: twine>=1.15.0
17
18
  Requires-Dist: venvpool>=18
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: requires-dist
25
+ Dynamic: summary
18
26
 
19
27
  # pyven
20
28
  Manage development of multiple Python projects.
@@ -1,7 +1,8 @@
1
1
  aridity>=85
2
2
  diapyr>=31
3
- foyndation>=10
4
- lagoon>=49
3
+ foyndation>=16
4
+ lagoon>=63
5
+ packaging>=25
5
6
  pydoc-markdown>=3.3
6
7
  roman>=5
7
8
  setuptools>=44.1.1
@@ -49,13 +49,13 @@ class SourceInfo:
49
49
  sourceinfo = SourceInfo('.')
50
50
  setup(
51
51
  name = 'pyven',
52
- version = '115',
52
+ version = '117',
53
53
  description = 'Manage development of multiple Python projects',
54
54
  url = 'https://pypi.org/project/pyven/',
55
55
  author = 'Homsar',
56
56
  author_email = 'homsar@foyono.com',
57
57
  py_modules = [],
58
- install_requires = ['aridity>=85', 'diapyr>=31', 'foyndation>=10', 'lagoon>=49', 'pydoc-markdown>=3.3', 'roman>=5', 'setuptools>=44.1.1', 'twine>=1.15.0', 'venvpool>=18'],
58
+ install_requires = ['aridity>=85', 'diapyr>=31', 'foyndation>=16', 'lagoon>=63', 'packaging>=25', 'pydoc-markdown>=3.3', 'roman>=5', 'setuptools>=44.1.1', 'twine>=1.15.0', 'venvpool>=18'],
59
59
  package_data = {'': ['*.pxd', '*.pyx', '*.pyxbld', '*.arid', '*.aridt']},
60
60
  entry_points = {'console_scripts': ['minreqs=pyven.minreqs:main', 'pipify=pyven.pipify:main', 'release=pyven.release:main', 'tasks=pyven.tasks:main', 'tryinstall=pyven.tryinstall:main', 'tests=pyven.tests.__init__:main']},
61
61
  **sourceinfo.setup_kwargs(),
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