pyven 101__tar.gz → 103__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.
- {pyven-101 → pyven-103}/PKG-INFO +1 -1
- {pyven-101 → pyven-103}/pyven/bdist.py +9 -7
- {pyven-101 → pyven-103}/pyven/checks.py +15 -22
- {pyven-101 → pyven-103}/pyven/execcheck.py +3 -3
- {pyven-101 → pyven-103}/pyven/files.py +8 -6
- {pyven-101 → pyven-103}/pyven/licheck.py +11 -11
- {pyven-101 → pyven-103}/pyven/mainmodules.py +2 -2
- {pyven-101 → pyven-103}/pyven/pipify.py +11 -8
- {pyven-101 → pyven-103}/pyven/projectinfo.py +20 -19
- {pyven-101 → pyven-103}/pyven/release.py +25 -26
- {pyven-101 → pyven-103}/pyven/sourceinfo.py +3 -3
- {pyven-101 → pyven-103}/pyven/tasks.py +6 -5
- {pyven-101 → pyven-103}/pyven/tryinstall.py +6 -7
- {pyven-101 → pyven-103}/pyven/util.py +6 -6
- {pyven-101 → pyven-103}/pyven.egg-info/PKG-INFO +1 -1
- {pyven-101 → pyven-103}/setup.py +4 -4
- {pyven-101 → pyven-103}/README.md +0 -0
- {pyven-101 → pyven-103}/pyven/README.md.aridt +0 -0
- {pyven-101 → pyven-103}/pyven/__init__.py +0 -0
- {pyven-101 → pyven-103}/pyven/divcheck.py +0 -0
- {pyven-101 → pyven-103}/pyven/functions.py +0 -0
- {pyven-101 → pyven-103}/pyven/minreqs.py +0 -0
- {pyven-101 → pyven-103}/pyven/nlcheck.py +0 -0
- {pyven-101 → pyven-103}/pyven/patchpolicy.py +0 -0
- {pyven-101 → pyven-103}/pyven/projectinfo.arid +0 -0
- {pyven-101 → pyven-103}/pyven/pyproject.toml.aridt +0 -0
- {pyven-101 → pyven-103}/pyven/release.arid +0 -0
- {pyven-101 → pyven-103}/pyven/setup.cfg.aridt +0 -0
- {pyven-101 → pyven-103}/pyven/setup.py.aridt +0 -0
- {pyven-101 → pyven-103}/pyven/setuptools.arid +0 -0
- {pyven-101 → pyven-103}/pyven/tests/__init__.py +0 -0
- {pyven-101 → pyven-103}/pyven.egg-info/SOURCES.txt +0 -0
- {pyven-101 → pyven-103}/pyven.egg-info/dependency_links.txt +0 -0
- {pyven-101 → pyven-103}/pyven.egg-info/entry_points.txt +0 -0
- {pyven-101 → pyven-103}/pyven.egg-info/requires.txt +0 -0
- {pyven-101 → pyven-103}/pyven.egg-info/top_level.txt +0 -0
- {pyven-101 → pyven-103}/setup.cfg +0 -0
{pyven-101 → pyven-103}/PKG-INFO
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from argparse import ArgumentParser
|
|
2
2
|
from glob import iglob
|
|
3
|
+
from shutil import copy2, rmtree
|
|
4
|
+
from subprocess import CalledProcessError, check_call
|
|
3
5
|
from tempfile import mkdtemp
|
|
4
|
-
import logging, os
|
|
6
|
+
import logging, os
|
|
5
7
|
|
|
6
8
|
log = logging.getLogger(__name__)
|
|
7
9
|
distdir = 'dist'
|
|
@@ -14,23 +16,23 @@ def main():
|
|
|
14
16
|
args = parser.parse_args()
|
|
15
17
|
holder = mkdtemp()
|
|
16
18
|
try:
|
|
17
|
-
for pip in sorted(iglob("/opt/python/cp[
|
|
19
|
+
for pip in sorted(iglob(f"/opt/python/cp[{''.join(args.pyversions)}]*/bin/pip")):
|
|
18
20
|
compatibility = pip.split(os.sep)[3]
|
|
19
21
|
log.info("Make wheel(s) for implementation-ABI: %s", compatibility)
|
|
20
22
|
try:
|
|
21
|
-
|
|
22
|
-
except
|
|
23
|
+
check_call([pip, '--no-cache-dir', 'wheel', '--no-deps', '-w', holder, '.'])
|
|
24
|
+
except CalledProcessError:
|
|
23
25
|
log.warning('Skip compatibility:', exc_info = True)
|
|
24
26
|
continue
|
|
25
27
|
wheelpath, = (os.path.join(holder, n) for n in os.listdir(holder))
|
|
26
|
-
|
|
28
|
+
check_call(['auditwheel', 'repair', '--plat', args.plat, '-w', distdir, wheelpath])
|
|
27
29
|
plaintarget = os.path.join(distdir, os.path.basename(wheelpath))
|
|
28
30
|
if os.path.exists(plaintarget):
|
|
29
31
|
log.info("Replace plain wheel: %s", plaintarget)
|
|
30
|
-
|
|
32
|
+
copy2(wheelpath, distdir)
|
|
31
33
|
os.remove(wheelpath)
|
|
32
34
|
finally:
|
|
33
|
-
|
|
35
|
+
rmtree(holder)
|
|
34
36
|
|
|
35
37
|
if ('__main__' == __name__):
|
|
36
38
|
main()
|
|
@@ -8,14 +8,16 @@ from aridity.config import ConfigCtrl
|
|
|
8
8
|
from aridity.util import NoSuchPathException, openresource
|
|
9
9
|
from diapyr.util import singleton
|
|
10
10
|
from itertools import chain
|
|
11
|
-
from lagoon import diff
|
|
12
|
-
from lagoon.program import NOEOL, partial
|
|
11
|
+
from lagoon import diff, docker, id, pydoc_markdown
|
|
12
|
+
from lagoon.program import NOEOL, partial, Program
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
from setuptools import find_packages
|
|
15
|
-
from shutil import copytree, ignore_patterns
|
|
15
|
+
from shutil import copy2, copytree, ignore_patterns
|
|
16
16
|
from tempfile import NamedTemporaryFile
|
|
17
|
+
from urllib.request import urlopen
|
|
17
18
|
from venvpool import dotpy, initlogging, Pool, Task, TemporaryDirectory
|
|
18
|
-
|
|
19
|
+
from xml.sax.saxutils import escape as xml_escape
|
|
20
|
+
import logging, os, re, sys
|
|
19
21
|
|
|
20
22
|
log = logging.getLogger(__name__)
|
|
21
23
|
skip = object()
|
|
@@ -34,7 +36,7 @@ def _localrepo():
|
|
|
34
36
|
return cc.node.buildbot.repo
|
|
35
37
|
|
|
36
38
|
def _runcheck(variant, check, *args):
|
|
37
|
-
sys.stderr.write("
|
|
39
|
+
sys.stderr.write(f"{check.__name__}[{variant}]: ")
|
|
38
40
|
sys.stderr.flush()
|
|
39
41
|
stderr('SKIP' if check(*args) is skip else 'OK')
|
|
40
42
|
|
|
@@ -84,7 +86,7 @@ class EveryVersion:
|
|
|
84
86
|
def divcheck():
|
|
85
87
|
if pyversion >= 3:
|
|
86
88
|
return skip
|
|
87
|
-
|
|
89
|
+
Program.text(f"python{pyversion}")[print](scriptpath, *self.files.pypaths)
|
|
88
90
|
for pyversion in self.info.config.pyversions:
|
|
89
91
|
_runcheck(pyversion, divcheck)
|
|
90
92
|
|
|
@@ -109,7 +111,7 @@ class EveryVersion:
|
|
|
109
111
|
xmlpath = os.path.join(reportsdir, 'nosetests.xml')
|
|
110
112
|
if self.docker:
|
|
111
113
|
coveragepath = os.path.join(self.info.projectdir, '.coverage')
|
|
112
|
-
with bgcontainer('-v', "{0}:{0}".format('/var/run/docker.sock'), '--network', 'host', '-v', "
|
|
114
|
+
with bgcontainer('-v', "{0}:{0}".format('/var/run/docker.sock'), '--network', 'host', '-v', f"{os.path.abspath(self.info.projectdir)}:{Container.workdir}", f"python:{pyversiontags[pyversion][0]}") as container:
|
|
113
115
|
container = Container(container)
|
|
114
116
|
container.cp(installdeps.workspace, 'installdeps')
|
|
115
117
|
container.inituser()
|
|
@@ -118,8 +120,7 @@ class EveryVersion:
|
|
|
118
120
|
for command in ['apt-get', 'update'], ['apt-get', 'install', '-y', 'sudo'] + upstream_devel_packages:
|
|
119
121
|
container.call(command, check = True, root = True)
|
|
120
122
|
for script in upstream_devel_scripts:
|
|
121
|
-
|
|
122
|
-
dirpath = docker[NOEOL]('exec', container.container, 'mktemp', '-d') # No need to cleanup, will die with container.
|
|
123
|
+
dirpath = docker.exec[NOEOL](container.container, 'mktemp', '-d') # No need to cleanup, will die with container.
|
|
123
124
|
log.debug("In container dir %s run script: %s", dirpath, script)
|
|
124
125
|
docker.exec[print]('-w', dirpath, '-t', container.container, 'sh', '-c', script)
|
|
125
126
|
installdeps.cinvoke(container)
|
|
@@ -145,7 +146,7 @@ except AttributeError:
|
|
|
145
146
|
'--with-cov', '--cov-report', 'term-missing',
|
|
146
147
|
] + sum((['--cov', p] for p in chain(find_packages(self.info.projectdir), self.info.py_modules())), []) + self.files.testpaths(xmlpath) + self.noseargs)
|
|
147
148
|
if os.path.exists(coveragepath):
|
|
148
|
-
|
|
149
|
+
copy2(coveragepath, os.path.join(reportsdir, 'coverage')) # Replace whatever the status, as if we configured the location.
|
|
149
150
|
os.remove(coveragepath) # Can't simply use rename cross-device in release case.
|
|
150
151
|
assert not status
|
|
151
152
|
|
|
@@ -155,7 +156,6 @@ except AttributeError:
|
|
|
155
156
|
return o
|
|
156
157
|
raise NoSuchPathException('Empty set.')
|
|
157
158
|
def getpydoc(mainmodules):
|
|
158
|
-
from lagoon import pydoc_markdown
|
|
159
159
|
with TemporaryDirectory() as pydocparent:
|
|
160
160
|
pydocdir = os.path.join(pydocparent, 'project')
|
|
161
161
|
copytree(self.info.projectdir, pydocdir, ignore = ignore_patterns('test_*'))
|
|
@@ -175,7 +175,7 @@ except AttributeError:
|
|
|
175
175
|
f.truncate()
|
|
176
176
|
modules.append(os.path.relpath(dirpath if '__init__.py' == name else pypath[:-len(dotpy)], pydocdir).replace(os.sep, '.'))
|
|
177
177
|
acc = re.sub('^#', '###', pydoc_markdown('--search-path', pydocdir), flags = re.MULTILINE)
|
|
178
|
-
acc = re.split(
|
|
178
|
+
acc = re.split(f"""(?=^<a id="(?:{'|'.join(map(re.escape, modules))})")""", acc, flags = re.MULTILINE) # Module names are markup attribute-safe.
|
|
179
179
|
return ''.join(sorted(block for block in acc if block and re.search('"([^"]+)', block).group(1) not in internal))
|
|
180
180
|
def readme():
|
|
181
181
|
if not (self.info.config.github.participant or self.info.config.pypi.participant):
|
|
@@ -188,7 +188,7 @@ except AttributeError:
|
|
|
188
188
|
mainmodules = sorted(self.info.mainmodules(), key = lambda mm: mm.command)
|
|
189
189
|
undocumented = [mm.command for mm in mainmodules if mm.doc is None]
|
|
190
190
|
if undocumented:
|
|
191
|
-
raise Exception("Undocumented:
|
|
191
|
+
raise Exception(f"Undocumented: {undocumented}")
|
|
192
192
|
for mm in mainmodules:
|
|
193
193
|
(-config).printf("commands %s doc = %s", mm.command, mm.doc)
|
|
194
194
|
if self.info.config.pydoc_enabled:
|
|
@@ -216,10 +216,8 @@ except AttributeError:
|
|
|
216
216
|
account = self.info.config.linktree.account
|
|
217
217
|
if account is None:
|
|
218
218
|
return skip
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
with urlopen("https://linktr.ee/%s" % account) as f: # TODO: Percent-encode.
|
|
222
|
-
assert ">%s \N{BULLET} %s<" % tuple(map(escape, [self.info.config.name, self.info.config.tagline])) in f.read().decode('utf-8') # TODO: Deduce encoding, consider lagoon URL.
|
|
219
|
+
with urlopen(f"https://linktr.ee/{account}") as f: # TODO: Percent-encode.
|
|
220
|
+
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.
|
|
223
221
|
_runcheck('*', linktree)
|
|
224
222
|
|
|
225
223
|
class Container:
|
|
@@ -227,19 +225,16 @@ class Container:
|
|
|
227
225
|
workdir = '/io'
|
|
228
226
|
|
|
229
227
|
def __init__(self, container):
|
|
230
|
-
from lagoon import id
|
|
231
228
|
self.uid = int(id._u())
|
|
232
229
|
self.gid = int(id._g())
|
|
233
230
|
self.container = container
|
|
234
231
|
|
|
235
232
|
def inituser(self):
|
|
236
|
-
from lagoon import docker
|
|
237
233
|
docker.exec[print](self.container, 'groupadd', '-g', os.stat('/var/run/docker.sock').st_gid, 'docker')
|
|
238
234
|
docker.exec[print](self.container, 'groupadd', '-g', self.gid, 'pyvengroup')
|
|
239
235
|
docker.exec[print](self.container, 'useradd', '-g', self.gid, '-G', 'docker', '-u', self.uid, '-m', 'pyvenuser')
|
|
240
236
|
|
|
241
237
|
def initapt(self):
|
|
242
|
-
from lagoon import docker
|
|
243
238
|
initapt(docker.exec[partial, print](self.container))
|
|
244
239
|
|
|
245
240
|
def install(self, args):
|
|
@@ -247,11 +242,9 @@ class Container:
|
|
|
247
242
|
self.call(['pip', 'install', '--user', *args], check = True)
|
|
248
243
|
|
|
249
244
|
def call(self, args, check = False, root = False):
|
|
250
|
-
from lagoon import docker
|
|
251
245
|
return docker.exec[print]('-w', self.workdir, self.container, *[] if root else ['sudo', '-u', 'pyvenuser', 'PATH=/home/pyvenuser/.local/bin:/usr/local/bin:/usr/bin:/bin', 'env'], *args, check = check)
|
|
252
246
|
|
|
253
247
|
def cp(self, src, dest):
|
|
254
|
-
from lagoon import docker
|
|
255
248
|
docker.cp[print](src, f"{self.container}:{dest}")
|
|
256
249
|
|
|
257
250
|
def main():
|
|
@@ -11,11 +11,11 @@ def execcheck(paths):
|
|
|
11
11
|
hasmagic = f.readline().startswith(magic)
|
|
12
12
|
if basename.lower().startswith('test'):
|
|
13
13
|
if not basename.startswith('test_'):
|
|
14
|
-
raise Exception("Inconsistent name:
|
|
14
|
+
raise Exception(f"Inconsistent name: {path}") # Note pyflakes already checks for duplicate method names.
|
|
15
15
|
if executable:
|
|
16
|
-
raise Exception("Should not be executable:
|
|
16
|
+
raise Exception(f"Should not be executable: {path}")
|
|
17
17
|
if hasmagic:
|
|
18
|
-
raise Exception("Using
|
|
18
|
+
raise Exception(f"Using {magic} is obsolete: {path}")
|
|
19
19
|
else:
|
|
20
20
|
if executable != hasmagic:
|
|
21
21
|
raise Exception(path)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from collections import defaultdict
|
|
2
|
-
|
|
2
|
+
from lagoon import git
|
|
3
|
+
from lagoon.program import partial
|
|
4
|
+
import xml.dom.minidom as dom, os
|
|
3
5
|
|
|
4
6
|
class Files:
|
|
5
7
|
|
|
@@ -23,18 +25,18 @@ class Files:
|
|
|
23
25
|
def relpaths(cls, root, suffixes, prefixes):
|
|
24
26
|
paths = list(cls._findfiles(root, suffixes, prefixes))
|
|
25
27
|
if os.path.exists(os.path.join(root, '.gitmodules')):
|
|
26
|
-
for submoduleslash in (l.split(' ', 1)[1] + os.sep for l in
|
|
28
|
+
for submoduleslash in (l.split(' ', 1)[1] + os.sep for l in git.config('--file', '.gitmodules', '--get-regexp', '^submodule[.].+[.]path$', cwd = root).splitlines()):
|
|
27
29
|
paths = [p for p in paths if not p.startswith(submoduleslash)]
|
|
28
30
|
if paths:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
with git.check_ignore[partial](*paths, check = False, cwd = root) as p:
|
|
32
|
+
ignored = set(p.stdout.read().splitlines())
|
|
33
|
+
assert p.wait() in [0, 1]
|
|
32
34
|
for path in paths:
|
|
33
35
|
if path not in ignored:
|
|
34
36
|
yield path
|
|
35
37
|
|
|
36
38
|
def __init__(self, root):
|
|
37
|
-
srcsuffixes = sum(([s, "
|
|
39
|
+
srcsuffixes = sum(([s, f"{s}.aridt"] for s in ['.py', '.py3', '.pyx', '.s', '.sh', '.h', '.cpp', '.cxx', '.arid', '.gradle', '.java', '.mk', '.md']), [])
|
|
38
40
|
self.allsrcpaths = [os.path.join(root, p) for p in self.relpaths(root, srcsuffixes, ['Dockerfile', 'Makefile'])]
|
|
39
41
|
self.docpaths = [p for p in self.allsrcpaths if p.endswith('.md')]
|
|
40
42
|
self.pypaths = [p for p in self.allsrcpaths if p.endswith('.py')]
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import hashlib, os, re, shlex, sys
|
|
2
2
|
|
|
3
|
-
gpltemplate = """# Copyright
|
|
3
|
+
gpltemplate = """# Copyright {years} {author}
|
|
4
4
|
|
|
5
|
-
# This file is part of
|
|
5
|
+
# This file is part of {name}.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# {name} is free software: you can redistribute it and/or modify
|
|
8
8
|
# it under the terms of the GNU General Public License as published by
|
|
9
9
|
# the Free Software Foundation, either version 3 of the License, or
|
|
10
10
|
# (at your option) any later version.
|
|
11
11
|
#
|
|
12
|
-
#
|
|
12
|
+
# {name} is distributed in the hope that it will be useful,
|
|
13
13
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
14
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
15
|
# GNU General Public License for more details.
|
|
16
16
|
#
|
|
17
17
|
# You should have received a copy of the GNU General Public License
|
|
18
|
-
# along with
|
|
18
|
+
# along with {name}. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
"""
|
|
20
20
|
intersection = '''# This file incorporates work covered by the following copyright and
|
|
21
21
|
# permission notice:
|
|
22
22
|
'''
|
|
23
23
|
|
|
24
24
|
def _hassuffix(name, *suffixes):
|
|
25
|
-
return name.endswith(suffixes) or name.endswith(tuple("
|
|
25
|
+
return name.endswith(suffixes) or name.endswith(tuple(f"{s}.aridt" for s in suffixes))
|
|
26
26
|
|
|
27
27
|
def _checkmd5(info, name, expected):
|
|
28
28
|
licpath = os.path.join(info.projectdir, name)
|
|
@@ -41,11 +41,11 @@ def licheck(info, paths):
|
|
|
41
41
|
if sections:
|
|
42
42
|
sections.append(intersection)
|
|
43
43
|
if 'GPL' == name:
|
|
44
|
-
sections.append(gpltemplate
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
sections.append(gpltemplate.format(
|
|
45
|
+
years = ', '.join(map(str, info.config.years)),
|
|
46
|
+
author = info.config.author,
|
|
47
|
+
name = info.config.name,
|
|
48
|
+
))
|
|
49
49
|
elif 'MIT' == name:
|
|
50
50
|
with open(info.mitpath()) as f:
|
|
51
51
|
sections.append(''.join(('# ' if l.rstrip() else '#') + l for l in f))
|
|
@@ -37,7 +37,7 @@ def main():
|
|
|
37
37
|
try:
|
|
38
38
|
m = ast.parse(text)
|
|
39
39
|
except SyntaxError:
|
|
40
|
-
log.warning("Skip: %s"
|
|
40
|
+
log.warning("Skip: %s", relpath, exc_info = True)
|
|
41
41
|
continue
|
|
42
42
|
result = dict(
|
|
43
43
|
command = command,
|
|
@@ -50,7 +50,7 @@ def main():
|
|
|
50
50
|
if call.args or call.keywords:
|
|
51
51
|
log.warning("Bad call: %s", command)
|
|
52
52
|
else:
|
|
53
|
-
result['console_script'] = "
|
|
53
|
+
result['console_script'] = f"{command}={relpath[:-len(extension)].replace(os.sep, '.')}:{_funcpath(call.func)}"
|
|
54
54
|
print(result)
|
|
55
55
|
|
|
56
56
|
if ('__main__' == __name__):
|
|
@@ -3,10 +3,13 @@ from .projectinfo import ProjectInfo, Req, SimpleInstallDeps
|
|
|
3
3
|
from argparse import ArgumentParser
|
|
4
4
|
from aridity.config import ConfigCtrl
|
|
5
5
|
from diapyr.util import bfs
|
|
6
|
+
from lagoon import git
|
|
7
|
+
from lagoon.program import Program
|
|
6
8
|
from pkg_resources import resource_filename
|
|
9
|
+
from shutil import rmtree
|
|
7
10
|
from tempfile import mkdtemp
|
|
8
11
|
from venvpool import initlogging, Pool
|
|
9
|
-
import logging, os,
|
|
12
|
+
import logging, os, sys
|
|
10
13
|
|
|
11
14
|
log = logging.getLogger(__name__)
|
|
12
15
|
|
|
@@ -17,7 +20,7 @@ def pipify(info, version = None):
|
|
|
17
20
|
if info.config.github.participant:
|
|
18
21
|
_, url = info.descriptionandurl()
|
|
19
22
|
elif info.config.pypi.participant:
|
|
20
|
-
url = "https://pypi.org/project
|
|
23
|
+
url = f"https://pypi.org/project/{info.config.name}/"
|
|
21
24
|
else:
|
|
22
25
|
raise Exception
|
|
23
26
|
else:
|
|
@@ -73,7 +76,7 @@ def main():
|
|
|
73
76
|
|
|
74
77
|
def setupcommand(info, pyversion, transient, *command):
|
|
75
78
|
def setup(absexecutable):
|
|
76
|
-
|
|
79
|
+
Program.text(absexecutable)[print]('setup.py', *command, cwd = info.projectdir)
|
|
77
80
|
if {'setuptools', 'wheel'} == set(info.allbuildrequires) and sys.version_info.major == pyversion:
|
|
78
81
|
setup(sys.executable)
|
|
79
82
|
else:
|
|
@@ -120,13 +123,13 @@ class InstallDeps:
|
|
|
120
123
|
yield j, True
|
|
121
124
|
continue
|
|
122
125
|
if self.localrepo is not None:
|
|
123
|
-
repopath = os.path.join(self.localrepo, "
|
|
126
|
+
repopath = os.path.join(self.localrepo, f"{name}.git")
|
|
124
127
|
if os.path.exists(repopath):
|
|
125
128
|
if self.siblings:
|
|
126
129
|
log.warning("Not a sibling, install from repo: %s", name)
|
|
127
130
|
clonepath = os.path.join(self.workspace, name)
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
git.clone[print]('--depth', 1, f"file://{repopath}", clonepath)
|
|
132
|
+
git.fetch.__tags[print](cwd = clonepath)
|
|
130
133
|
volatileprojects[name] = j = ProjectInfo.seek(clonepath)
|
|
131
134
|
yield j, False
|
|
132
135
|
continue
|
|
@@ -152,10 +155,10 @@ class InstallDeps:
|
|
|
152
155
|
venv.install([i.projectdir for i in self.volatileprojects] + [r.reqstr for r in self.fetchreqs])
|
|
153
156
|
|
|
154
157
|
def cinvoke(self, container):
|
|
155
|
-
container.install(["/installdeps
|
|
158
|
+
container.install([f"/installdeps/{os.path.relpath(i.projectdir, self.workspace).replace(os.sep, '/')}" for i in self.volatileprojects] + [r.reqstr for r in self.fetchreqs])
|
|
156
159
|
|
|
157
160
|
def __exit__(self, *exc_info):
|
|
158
|
-
|
|
161
|
+
rmtree(self.workspace)
|
|
159
162
|
|
|
160
163
|
if '__main__' == __name__:
|
|
161
164
|
main()
|
|
@@ -4,12 +4,19 @@ from .util import Seek
|
|
|
4
4
|
from aridity.config import ConfigCtrl
|
|
5
5
|
from aridity.model import Entry, Resource
|
|
6
6
|
from aridity.util import openresource
|
|
7
|
+
from http import HTTPStatus
|
|
7
8
|
from inspect import getsource
|
|
9
|
+
from lagoon import git
|
|
10
|
+
from lagoon.binary import tidy
|
|
11
|
+
from lagoon.program import Program
|
|
8
12
|
from pathlib import Path
|
|
9
13
|
from pkg_resources import parse_requirements
|
|
10
14
|
from setuphacks import getsetupkwargs
|
|
15
|
+
from urllib.error import HTTPError
|
|
16
|
+
from urllib.parse import quote as url_quote
|
|
17
|
+
from urllib.request import Request, urlopen
|
|
11
18
|
from venvpool import ParsedRequires, TemporaryDirectory
|
|
12
|
-
import logging, os, re,
|
|
19
|
+
import xml.dom.minidom as dom, json, logging, os, re, time, venvpool
|
|
13
20
|
|
|
14
21
|
log = logging.getLogger(__name__)
|
|
15
22
|
|
|
@@ -36,14 +43,10 @@ class Req:
|
|
|
36
43
|
|
|
37
44
|
@classmethod
|
|
38
45
|
def published(cls, reqstrs):
|
|
39
|
-
from http import HTTPStatus
|
|
40
|
-
from urllib.error import HTTPError
|
|
41
|
-
from urllib.parse import quote
|
|
42
|
-
from urllib.request import Request, urlopen
|
|
43
46
|
for r in cls.parselines(reqstrs):
|
|
44
47
|
try:
|
|
45
48
|
# FIXME: Allow running tests offline.
|
|
46
|
-
with urlopen(Request("https://pypi.org/simple
|
|
49
|
+
with urlopen(Request(f"https://pypi.org/simple/{url_quote(r.namepart, safe = '')}/", method = 'HEAD')):
|
|
47
50
|
pass
|
|
48
51
|
yield r
|
|
49
52
|
except HTTPError as e:
|
|
@@ -81,7 +84,7 @@ class Req:
|
|
|
81
84
|
|
|
82
85
|
def minstr(self):
|
|
83
86
|
version, = (s.version for s in self.specifierset if s.operator in {'>=', '=='})
|
|
84
|
-
return "
|
|
87
|
+
return f"{self.namepart}=={version}"
|
|
85
88
|
|
|
86
89
|
def accept(self):
|
|
87
90
|
marker = self.parsed.marker
|
|
@@ -155,26 +158,24 @@ class ProjectInfo:
|
|
|
155
158
|
return [r.namepart for r in self.parsedrequires() if r.isproject(self)]
|
|
156
159
|
|
|
157
160
|
def nextversion(self): # XXX: Deduce from tags instead?
|
|
158
|
-
import urllib.request, urllib.error, re, xml.dom.minidom as dom
|
|
159
161
|
pattern = re.compile('-([0-9]+)[-.]')
|
|
160
162
|
try:
|
|
161
|
-
with
|
|
162
|
-
doc = dom.parseString(
|
|
163
|
+
with urlopen(f"https://pypi.org/simple/{self.config.name}/") as f:
|
|
164
|
+
doc = dom.parseString(tidy._asxml(input = f.read()))
|
|
163
165
|
last = max(int(pattern.search(textcontent(a)).group(1)) for a in doc.getElementsByTagName('a'))
|
|
164
|
-
except
|
|
166
|
+
except HTTPError as e:
|
|
165
167
|
if 404 != e.code:
|
|
166
168
|
raise
|
|
167
169
|
last = 0
|
|
168
170
|
return str(max(10, last + 1))
|
|
169
171
|
|
|
170
172
|
def descriptionandurl(self):
|
|
171
|
-
|
|
172
|
-
urlpath = "%s/%s" % (self.config.github.account, self.config.name)
|
|
173
|
+
urlpath = f"{self.config.github.account}/{self.config.name}"
|
|
173
174
|
while True:
|
|
174
175
|
try:
|
|
175
|
-
with
|
|
176
|
-
return json.loads(f.read().decode())['description'], "https://github.com
|
|
177
|
-
except
|
|
176
|
+
with urlopen(f"https://api.github.com/repos/{urlpath}") as f:
|
|
177
|
+
return json.loads(f.read().decode())['description'], f"https://github.com/{urlpath}"
|
|
178
|
+
except HTTPError as e:
|
|
178
179
|
if 403 != e.code:
|
|
179
180
|
raise
|
|
180
181
|
log.info("Sleep 1 minute due to: %s", e)
|
|
@@ -192,15 +193,15 @@ class ProjectInfo:
|
|
|
192
193
|
f.write(getsource(mainmodules))
|
|
193
194
|
with open(os.path.join(tempdir, 'venvpool.py'), 'w') as f:
|
|
194
195
|
f.write(getsource(venvpool))
|
|
195
|
-
for line in
|
|
196
|
+
for line in Program.text(f"python{next(iter(self.config.pyversions))}")(scriptpath, self.projectdir, *paths).splitlines():
|
|
196
197
|
yield MainModule(eval(line))
|
|
197
198
|
|
|
198
199
|
def console_scripts(self):
|
|
199
200
|
return [mm.console_script for mm in self.mainmodules()]
|
|
200
201
|
|
|
201
202
|
def devversion(self):
|
|
202
|
-
releases = [int(t[1:]) for t in
|
|
203
|
-
return "
|
|
203
|
+
releases = [int(t[1:]) for t in git.tag(cwd = self.projectdir).splitlines() if 'v' == t[0]]
|
|
204
|
+
return f"{(max(releases) if releases else 0) + 1}.dev0"
|
|
204
205
|
|
|
205
206
|
class MainModule:
|
|
206
207
|
|
|
@@ -8,11 +8,13 @@ from argparse import ArgumentParser
|
|
|
8
8
|
from aridity.config import ConfigCtrl
|
|
9
9
|
from diapyr.util import singleton
|
|
10
10
|
from itertools import chain
|
|
11
|
-
from lagoon
|
|
11
|
+
from lagoon import docker, git
|
|
12
|
+
from lagoon.program import NOEOL, partial, Program
|
|
12
13
|
from pkg_resources import resource_filename
|
|
14
|
+
from shutil import copy2, copytree, rmtree
|
|
13
15
|
from tempfile import NamedTemporaryFile
|
|
14
16
|
from venvpool import dotpy, initlogging, Pip, Pool, TemporaryDirectory
|
|
15
|
-
import
|
|
17
|
+
import logging, os, re, sys, sysconfig
|
|
16
18
|
|
|
17
19
|
log = logging.getLogger(__name__)
|
|
18
20
|
distrelpath = 'dist'
|
|
@@ -27,7 +29,7 @@ def _images():
|
|
|
27
29
|
i686 = Arch('linux32'),
|
|
28
30
|
x86_64 = Arch(None),
|
|
29
31
|
)
|
|
30
|
-
archmatch = re.compile("_(
|
|
32
|
+
archmatch = re.compile(f"_({'|'.join(map(re.escape, archlookup))})$").search
|
|
31
33
|
images = {
|
|
32
34
|
'manylinux_2_34_x86_64': '2024-11-23-da4547b',
|
|
33
35
|
'manylinux_2_28_x86_64': '2024-11-30-fa0d298',
|
|
@@ -43,8 +45,8 @@ class Image:
|
|
|
43
45
|
|
|
44
46
|
@singleton
|
|
45
47
|
def pythonexe():
|
|
46
|
-
impl = "cp
|
|
47
|
-
return "/opt/python
|
|
48
|
+
impl = f"cp{sysconfig.get_config_var('py_version_nodot')}"
|
|
49
|
+
return f"/opt/python/{impl}-{impl}{sys.abiflags}/bin/python"
|
|
48
50
|
|
|
49
51
|
def __init__(self, imagetag, plat, arch):
|
|
50
52
|
self.imagetag = imagetag
|
|
@@ -52,27 +54,24 @@ class Image:
|
|
|
52
54
|
self.arch = arch
|
|
53
55
|
|
|
54
56
|
def makewheels(self, info): # TODO: This code would benefit from modern syntax.
|
|
55
|
-
from lagoon import docker
|
|
56
|
-
from lagoon.program import NOEOL
|
|
57
|
-
docker_print = docker[partial](stdout = None)
|
|
58
57
|
log.info("Make wheels for platform: %s", self.plat)
|
|
59
58
|
scripts = list(info.config.devel.scripts)
|
|
60
59
|
packages = list(info.config.devel.packages)
|
|
61
60
|
# TODO: Copy not mount so we can run containers in parallel.
|
|
62
|
-
with bgcontainer('-v', "
|
|
61
|
+
with bgcontainer('-v', f"{info.projectdir}:/io", f"{self.prefix}{self.plat}:{self.imagetag}") as container:
|
|
63
62
|
def run(execargs, command):
|
|
64
|
-
|
|
63
|
+
docker.exec[print](*execargs, container, *self.arch.entrypoint, *command)
|
|
65
64
|
if packages:
|
|
66
65
|
run([], chain(['yum', 'install', '-y'], packages))
|
|
67
66
|
for script in scripts:
|
|
68
67
|
# TODO LATER: Run as ordinary sudo-capable user.
|
|
69
|
-
dirpath = docker[NOEOL](
|
|
68
|
+
dirpath = docker.exec[NOEOL](container, 'mktemp', '-d') # No need to cleanup, will die with container.
|
|
70
69
|
log.debug("In container dir %s run script: %s", dirpath, script)
|
|
71
70
|
run(['-w', dirpath, '-t'], ['sh', '-c', script])
|
|
72
|
-
|
|
71
|
+
docker.cp[print](resource_filename(__name__, 'patchpolicy.py'), f"{container}:/patchpolicy.py")
|
|
73
72
|
run([], [self.pythonexe, '/patchpolicy.py'])
|
|
74
|
-
|
|
75
|
-
run(['-u', "
|
|
73
|
+
docker.cp[print](resource_filename(__name__, 'bdist.py'), f"{container}:/bdist.py")
|
|
74
|
+
run(['-u', f"{os.geteuid()}:{os.getegid()}", '-w', '/io'], chain([self.pythonexe, '/bdist.py', '--plat', self.plat], info.config.pyversions))
|
|
76
75
|
|
|
77
76
|
def main():
|
|
78
77
|
initlogging()
|
|
@@ -84,22 +83,22 @@ def main():
|
|
|
84
83
|
# XXX: Load info config to a scope in our config?
|
|
85
84
|
info = ProjectInfo.seek(config.path)
|
|
86
85
|
config.account = info.config.pypi.account
|
|
87
|
-
|
|
88
|
-
if
|
|
86
|
+
srcgit = git[partial](cwd = info.projectdir)
|
|
87
|
+
if srcgit.status.__porcelain():
|
|
89
88
|
raise Exception('Uncommitted changes!')
|
|
90
89
|
log.debug('No uncommitted changes.')
|
|
91
90
|
with TemporaryDirectory() as tempdir:
|
|
92
91
|
copydir = os.path.join(tempdir, os.path.basename(os.path.abspath(info.projectdir)))
|
|
93
92
|
log.info("Copying project to: %s", copydir)
|
|
94
|
-
|
|
95
|
-
for relpath in release(config,
|
|
93
|
+
copytree(info.projectdir, copydir)
|
|
94
|
+
for relpath in release(config, srcgit, ProjectInfo.seek(copydir)):
|
|
96
95
|
log.info("Replace artifact: %s", relpath)
|
|
97
96
|
destpath = os.path.join(info.projectdir, relpath)
|
|
98
97
|
try:
|
|
99
98
|
os.makedirs(os.path.dirname(destpath))
|
|
100
99
|
except OSError:
|
|
101
100
|
pass
|
|
102
|
-
|
|
101
|
+
copy2(os.path.join(copydir, relpath), destpath)
|
|
103
102
|
|
|
104
103
|
def uploadableartifacts(artifactrelpaths):
|
|
105
104
|
def acceptplatform(platform):
|
|
@@ -119,7 +118,7 @@ def _warmups(info):
|
|
|
119
118
|
with InstallDeps(info, False, None) as installdeps, Pool(next(iter(info.config.pyversions))).readonlyortransient[True](installdeps) as venv:
|
|
120
119
|
for m, f in warmups:
|
|
121
120
|
with NamedTemporaryFile('w', suffix = dotpy, dir = info.projectdir) as script:
|
|
122
|
-
script.write("from
|
|
121
|
+
script.write(f"from {m} import {f.split('.')[0]}\n{f}()")
|
|
123
122
|
script.flush()
|
|
124
123
|
venv.run('check_call', ['.'] + installdeps.localreqs, os.path.basename(script.name)[:-len(dotpy)], [], cwd = info.projectdir)
|
|
125
124
|
|
|
@@ -128,7 +127,7 @@ def _runsetup(info, commands):
|
|
|
128
127
|
venv.run('check_call', ['.'], 'setup', commands, cwd = info.projectdir) # XXX: Should venvpool automatically include current dir?
|
|
129
128
|
|
|
130
129
|
def release(config, srcgit, info):
|
|
131
|
-
scrub =
|
|
130
|
+
scrub = git.clean._xdi[partial, print](cwd = info.projectdir, input = 'c')
|
|
132
131
|
scrub()
|
|
133
132
|
version = info.nextversion()
|
|
134
133
|
pipify(info, version)
|
|
@@ -139,10 +138,10 @@ def release(config, srcgit, info):
|
|
|
139
138
|
if name.startswith('test_'): # TODO LATER: Allow project to add globs to exclude.
|
|
140
139
|
path = os.path.join(dirpath, name)
|
|
141
140
|
log.debug("Delete: %s", path)
|
|
142
|
-
(os.remove if name.endswith('.py') else
|
|
141
|
+
(os.remove if name.endswith('.py') else rmtree)(path)
|
|
143
142
|
_warmups(info)
|
|
144
143
|
pipify(info, version)
|
|
145
|
-
|
|
144
|
+
rmtree(os.path.join(info.projectdir, '.git'))
|
|
146
145
|
setupcommands = []
|
|
147
146
|
if SourceInfo(info.projectdir).extpaths:
|
|
148
147
|
for image in _images():
|
|
@@ -152,11 +151,11 @@ def release(config, srcgit, info):
|
|
|
152
151
|
_runsetup(info, setupcommands + ['sdist'])
|
|
153
152
|
artifactrelpaths = [os.path.join(distrelpath, name) for name in sorted(os.listdir(os.path.join(info.projectdir, distrelpath)))]
|
|
154
153
|
if config.upload:
|
|
155
|
-
srcgit.tag("v
|
|
154
|
+
srcgit.tag[print](f"v{version}")
|
|
156
155
|
# TODO LATER: If tag succeeded but push fails, we're left with a bogus tag.
|
|
157
|
-
srcgit.push.__tags(
|
|
156
|
+
srcgit.push.__tags[print]() # XXX: Also update other remotes?
|
|
158
157
|
with config.token as token:
|
|
159
|
-
Program.text(sys.executable)._m.twine.upload('-u', '__token__', '-p', token, *uploadableartifacts(artifactrelpaths), cwd = info.projectdir,
|
|
158
|
+
Program.text(sys.executable)._m.twine.upload[print]('-u', '__token__', '-p', token, *uploadableartifacts(artifactrelpaths), cwd = info.projectdir, env = Pip.envpatch)
|
|
160
159
|
else:
|
|
161
160
|
log.warning("Upload skipped, use --upload to upload: %s", ' '.join(uploadableartifacts(artifactrelpaths)))
|
|
162
161
|
return artifactrelpaths
|
|
@@ -8,7 +8,7 @@ class SourceInfo:
|
|
|
8
8
|
|
|
9
9
|
def make_ext(self):
|
|
10
10
|
g = {}
|
|
11
|
-
with open("
|
|
11
|
+
with open(f"{self.path}bld") as f: # Assume project root.
|
|
12
12
|
exec(f.read(), g)
|
|
13
13
|
return g['make_ext'](self.module, self.path)
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ class SourceInfo:
|
|
|
16
16
|
def addextpaths(dirpath, moduleprefix, suffix = '.pyx'):
|
|
17
17
|
for name in sorted(os.listdir(os.path.join(rootdir, dirpath))):
|
|
18
18
|
if name.endswith(suffix):
|
|
19
|
-
module = "
|
|
19
|
+
module = f"{moduleprefix}{name[:-len(suffix)]}"
|
|
20
20
|
if module not in extpaths:
|
|
21
21
|
extpaths[module] = self.PYXPath(module, os.path.join(dirpath, name))
|
|
22
22
|
from setuptools import find_packages
|
|
@@ -25,7 +25,7 @@ class SourceInfo:
|
|
|
25
25
|
extpaths = {}
|
|
26
26
|
addextpaths('.', '')
|
|
27
27
|
for package in self.packages:
|
|
28
|
-
addextpaths(package.replace('.', os.sep), "
|
|
28
|
+
addextpaths(package.replace('.', os.sep), f"{package}.")
|
|
29
29
|
self.extpaths = extpaths.values()
|
|
30
30
|
|
|
31
31
|
def setup_kwargs(self):
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'Show all XX''X/TO''DO/FIX''ME comments in project.'
|
|
2
2
|
from .files import Files
|
|
3
3
|
from argparse import ArgumentParser
|
|
4
|
-
import
|
|
4
|
+
from lagoon import ag, git
|
|
5
|
+
from lagoon.program import NOEOL, partial
|
|
5
6
|
|
|
6
7
|
def main():
|
|
7
8
|
parser = ArgumentParser()
|
|
8
9
|
parser.add_argument('-q', action = 'count', default = 0)
|
|
9
10
|
config = parser.parse_args()
|
|
10
|
-
root
|
|
11
|
-
agcommand = [
|
|
11
|
+
root = git.rev_parse.__show_toplevel[NOEOL]()
|
|
12
|
+
agcommand = ag.__noheading.__nobreak[partial, print](cwd = root, check = False)
|
|
12
13
|
# XXX: Integrate with declared project resource types?
|
|
13
14
|
paths = list(Files.relpaths(root, ['.py', '.pyx', '.h', '.cpp', '.ui', '.java', '.kt', '.c', '.s', '.sh', '.arid', '.aridt', '.gradle', '.java', '.mk', '.js'], ['Dockerfile', 'Makefile']))
|
|
14
15
|
for tag in ['XX''X', 'TO''DO', 'FIX''ME'][config.q:]:
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
agcommand(f"{tag} LATER", *paths)
|
|
17
|
+
agcommand(f"{tag}(?! LATER)", *paths)
|
|
17
18
|
|
|
18
19
|
if '__main__' == __name__:
|
|
19
20
|
main()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from .checks import EveryVersion
|
|
3
3
|
from .projectinfo import ProjectInfo
|
|
4
4
|
from .util import bgcontainer, initapt, pyversiontags
|
|
5
|
-
from lagoon import git
|
|
5
|
+
from lagoon import docker, git
|
|
6
6
|
from lagoon.program import partial
|
|
7
7
|
from urllib.request import urlopen
|
|
8
8
|
from venvpool import initlogging
|
|
@@ -11,7 +11,6 @@ import logging, xml.etree.ElementTree as ET
|
|
|
11
11
|
log = logging.getLogger(__name__)
|
|
12
12
|
|
|
13
13
|
def main():
|
|
14
|
-
from lagoon import docker
|
|
15
14
|
initlogging()
|
|
16
15
|
headinfo = ProjectInfo.seek('.')
|
|
17
16
|
if not headinfo.config.pypi.participant: # XXX: Or look for tags?
|
|
@@ -19,20 +18,20 @@ def main():
|
|
|
19
18
|
return
|
|
20
19
|
project = headinfo.config.name
|
|
21
20
|
# XXX: When building a tag use that same version?
|
|
22
|
-
with urlopen("https://pypi.org/rss/project
|
|
21
|
+
with urlopen(f"https://pypi.org/rss/project/{project}/releases.xml") as f:
|
|
23
22
|
version = ET.parse(f).find('./channel/item/title').text
|
|
24
|
-
req = "
|
|
23
|
+
req = f"{project}=={version}"
|
|
25
24
|
upstream_devel_packages = list(headinfo.config.upstream.devel.packages)
|
|
26
25
|
for pyversion in reversed(pyversiontags[3]): # XXX: Why only 3?
|
|
27
26
|
log.info("Python version: %s", pyversion)
|
|
28
|
-
with bgcontainer("python
|
|
29
|
-
containerexec = docker[partial](
|
|
27
|
+
with bgcontainer(f"python:{pyversion}") as container:
|
|
28
|
+
containerexec = docker.exec[partial, print](container)
|
|
30
29
|
if upstream_devel_packages:
|
|
31
30
|
initapt(containerexec)
|
|
32
31
|
containerexec('apt-get', 'update')
|
|
33
32
|
containerexec('apt-get', 'install', '-y', *upstream_devel_packages)
|
|
34
33
|
containerexec('pip', 'install', req)
|
|
35
|
-
git.checkout("v
|
|
34
|
+
git.checkout[print](f"v{version}")
|
|
36
35
|
EveryVersion(ProjectInfo.seek('.'), False, False, [], True, True).nose()
|
|
37
36
|
|
|
38
37
|
if '__main__' == __name__:
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from contextlib import contextmanager
|
|
2
|
+
from lagoon import docker
|
|
3
|
+
from lagoon.program import NOEOL
|
|
2
4
|
import os, re, sys
|
|
3
5
|
|
|
4
6
|
pyversiontags = {2: ['2'], 3: ['3.9', '3.10', '3.11', '3.12', '3.13']}
|
|
@@ -12,11 +14,11 @@ class Excludes:
|
|
|
12
14
|
def __init__(self, globs):
|
|
13
15
|
def disjunction():
|
|
14
16
|
sep = re.escape(os.sep)
|
|
15
|
-
star = "[
|
|
17
|
+
star = f"[^{sep}]*"
|
|
16
18
|
def components():
|
|
17
19
|
for word in glob.split('/'):
|
|
18
20
|
if '**' == word:
|
|
19
|
-
yield "(
|
|
21
|
+
yield f"(?:{star}{sep})*"
|
|
20
22
|
else:
|
|
21
23
|
yield star.join(re.escape(part) for part in word.split('*'))
|
|
22
24
|
yield sep
|
|
@@ -24,7 +26,7 @@ class Excludes:
|
|
|
24
26
|
concat = ''.join(components())
|
|
25
27
|
assert concat.endswith(sep)
|
|
26
28
|
yield concat[:-len(sep)]
|
|
27
|
-
self.pattern = re.compile("
|
|
29
|
+
self.pattern = re.compile(f"^{'|'.join(disjunction())}$")
|
|
28
30
|
|
|
29
31
|
def __contains__(self, relpath):
|
|
30
32
|
return self.pattern.search(relpath) is not None
|
|
@@ -45,13 +47,11 @@ class Seek(str):
|
|
|
45
47
|
|
|
46
48
|
@contextmanager
|
|
47
49
|
def bgcontainer(*dockerrunargs):
|
|
48
|
-
from lagoon import docker
|
|
49
|
-
from lagoon.program import NOEOL
|
|
50
50
|
container = docker.run._d[NOEOL](*dockerrunargs + ('sleep', 'inf'))
|
|
51
51
|
try:
|
|
52
52
|
yield container
|
|
53
53
|
finally:
|
|
54
|
-
docker.rm._f(container
|
|
54
|
+
docker.rm._f[print](container)
|
|
55
55
|
|
|
56
56
|
def initapt(dockerexec):
|
|
57
57
|
dockerexec('mkdir', '-pv', '/etc/apt/keyrings')
|
{pyven-101 → pyven-103}/setup.py
RENAMED
|
@@ -14,7 +14,7 @@ class SourceInfo:
|
|
|
14
14
|
|
|
15
15
|
def make_ext(self):
|
|
16
16
|
g = {}
|
|
17
|
-
with open("
|
|
17
|
+
with open(f"{self.path}bld") as f: # Assume project root.
|
|
18
18
|
exec(f.read(), g)
|
|
19
19
|
return g['make_ext'](self.module, self.path)
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ class SourceInfo:
|
|
|
22
22
|
def addextpaths(dirpath, moduleprefix, suffix = '.pyx'):
|
|
23
23
|
for name in sorted(os.listdir(os.path.join(rootdir, dirpath))):
|
|
24
24
|
if name.endswith(suffix):
|
|
25
|
-
module = "
|
|
25
|
+
module = f"{moduleprefix}{name[:-len(suffix)]}"
|
|
26
26
|
if module not in extpaths:
|
|
27
27
|
extpaths[module] = self.PYXPath(module, os.path.join(dirpath, name))
|
|
28
28
|
from setuptools import find_packages
|
|
@@ -31,7 +31,7 @@ class SourceInfo:
|
|
|
31
31
|
extpaths = {}
|
|
32
32
|
addextpaths('.', '')
|
|
33
33
|
for package in self.packages:
|
|
34
|
-
addextpaths(package.replace('.', os.sep), "
|
|
34
|
+
addextpaths(package.replace('.', os.sep), f"{package}.")
|
|
35
35
|
self.extpaths = extpaths.values()
|
|
36
36
|
|
|
37
37
|
def setup_kwargs(self):
|
|
@@ -44,7 +44,7 @@ class SourceInfo:
|
|
|
44
44
|
sourceinfo = SourceInfo('.')
|
|
45
45
|
setup(
|
|
46
46
|
name = 'pyven',
|
|
47
|
-
version = '
|
|
47
|
+
version = '103',
|
|
48
48
|
description = 'Manage development of multiple Python projects',
|
|
49
49
|
long_description = long_description(),
|
|
50
50
|
long_description_content_type = 'text/markdown',
|
|
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
|