pyven 101__tar.gz → 102__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-102}/PKG-INFO +1 -1
- {pyven-101 → pyven-102}/pyven/bdist.py +1 -1
- {pyven-101 → pyven-102}/pyven/checks.py +8 -8
- {pyven-101 → pyven-102}/pyven/execcheck.py +3 -3
- {pyven-101 → pyven-102}/pyven/files.py +1 -1
- {pyven-101 → pyven-102}/pyven/licheck.py +11 -11
- {pyven-101 → pyven-102}/pyven/mainmodules.py +2 -2
- {pyven-101 → pyven-102}/pyven/pipify.py +4 -4
- {pyven-101 → pyven-102}/pyven/projectinfo.py +8 -8
- {pyven-101 → pyven-102}/pyven/release.py +14 -15
- {pyven-101 → pyven-102}/pyven/sourceinfo.py +3 -3
- {pyven-101 → pyven-102}/pyven/tryinstall.py +5 -5
- {pyven-101 → pyven-102}/pyven/util.py +4 -4
- {pyven-101 → pyven-102}/pyven.egg-info/PKG-INFO +1 -1
- {pyven-101 → pyven-102}/setup.py +4 -4
- {pyven-101 → pyven-102}/README.md +0 -0
- {pyven-101 → pyven-102}/pyven/README.md.aridt +0 -0
- {pyven-101 → pyven-102}/pyven/__init__.py +0 -0
- {pyven-101 → pyven-102}/pyven/divcheck.py +0 -0
- {pyven-101 → pyven-102}/pyven/functions.py +0 -0
- {pyven-101 → pyven-102}/pyven/minreqs.py +0 -0
- {pyven-101 → pyven-102}/pyven/nlcheck.py +0 -0
- {pyven-101 → pyven-102}/pyven/patchpolicy.py +0 -0
- {pyven-101 → pyven-102}/pyven/projectinfo.arid +0 -0
- {pyven-101 → pyven-102}/pyven/pyproject.toml.aridt +0 -0
- {pyven-101 → pyven-102}/pyven/release.arid +0 -0
- {pyven-101 → pyven-102}/pyven/setup.cfg.aridt +0 -0
- {pyven-101 → pyven-102}/pyven/setup.py.aridt +0 -0
- {pyven-101 → pyven-102}/pyven/setuptools.arid +0 -0
- {pyven-101 → pyven-102}/pyven/tasks.py +0 -0
- {pyven-101 → pyven-102}/pyven/tests/__init__.py +0 -0
- {pyven-101 → pyven-102}/pyven.egg-info/SOURCES.txt +0 -0
- {pyven-101 → pyven-102}/pyven.egg-info/dependency_links.txt +0 -0
- {pyven-101 → pyven-102}/pyven.egg-info/entry_points.txt +0 -0
- {pyven-101 → pyven-102}/pyven.egg-info/requires.txt +0 -0
- {pyven-101 → pyven-102}/pyven.egg-info/top_level.txt +0 -0
- {pyven-101 → pyven-102}/setup.cfg +0 -0
{pyven-101 → pyven-102}/PKG-INFO
RENAMED
|
@@ -14,7 +14,7 @@ def main():
|
|
|
14
14
|
args = parser.parse_args()
|
|
15
15
|
holder = mkdtemp()
|
|
16
16
|
try:
|
|
17
|
-
for pip in sorted(iglob("/opt/python/cp[
|
|
17
|
+
for pip in sorted(iglob(f"/opt/python/cp[{''.join(args.pyversions)}]*/bin/pip")):
|
|
18
18
|
compatibility = pip.split(os.sep)[3]
|
|
19
19
|
log.info("Make wheel(s) for implementation-ABI: %s", compatibility)
|
|
20
20
|
try:
|
|
@@ -34,7 +34,7 @@ def _localrepo():
|
|
|
34
34
|
return cc.node.buildbot.repo
|
|
35
35
|
|
|
36
36
|
def _runcheck(variant, check, *args):
|
|
37
|
-
sys.stderr.write("
|
|
37
|
+
sys.stderr.write(f"{check.__name__}[{variant}]: ")
|
|
38
38
|
sys.stderr.flush()
|
|
39
39
|
stderr('SKIP' if check(*args) is skip else 'OK')
|
|
40
40
|
|
|
@@ -84,7 +84,7 @@ class EveryVersion:
|
|
|
84
84
|
def divcheck():
|
|
85
85
|
if pyversion >= 3:
|
|
86
86
|
return skip
|
|
87
|
-
subprocess.check_call(["python
|
|
87
|
+
subprocess.check_call([f"python{pyversion}", scriptpath] + self.files.pypaths)
|
|
88
88
|
for pyversion in self.info.config.pyversions:
|
|
89
89
|
_runcheck(pyversion, divcheck)
|
|
90
90
|
|
|
@@ -109,7 +109,7 @@ class EveryVersion:
|
|
|
109
109
|
xmlpath = os.path.join(reportsdir, 'nosetests.xml')
|
|
110
110
|
if self.docker:
|
|
111
111
|
coveragepath = os.path.join(self.info.projectdir, '.coverage')
|
|
112
|
-
with bgcontainer('-v', "{0}:{0}".format('/var/run/docker.sock'), '--network', 'host', '-v', "
|
|
112
|
+
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
113
|
container = Container(container)
|
|
114
114
|
container.cp(installdeps.workspace, 'installdeps')
|
|
115
115
|
container.inituser()
|
|
@@ -119,7 +119,7 @@ class EveryVersion:
|
|
|
119
119
|
container.call(command, check = True, root = True)
|
|
120
120
|
for script in upstream_devel_scripts:
|
|
121
121
|
from lagoon import docker
|
|
122
|
-
dirpath = docker[NOEOL](
|
|
122
|
+
dirpath = docker.exec[NOEOL](container.container, 'mktemp', '-d') # No need to cleanup, will die with container.
|
|
123
123
|
log.debug("In container dir %s run script: %s", dirpath, script)
|
|
124
124
|
docker.exec[print]('-w', dirpath, '-t', container.container, 'sh', '-c', script)
|
|
125
125
|
installdeps.cinvoke(container)
|
|
@@ -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:
|
|
@@ -218,8 +218,8 @@ except AttributeError:
|
|
|
218
218
|
return skip
|
|
219
219
|
from urllib.request import urlopen
|
|
220
220
|
from xml.sax.saxutils import escape
|
|
221
|
-
with urlopen("https://linktr.ee
|
|
222
|
-
assert "
|
|
221
|
+
with urlopen(f"https://linktr.ee/{account}") as f: # TODO: Percent-encode.
|
|
222
|
+
assert f">{escape(self.info.config.name)} \N{BULLET} {escape(self.info.config.tagline)}<" in f.read().decode('utf-8') # TODO: Deduce encoding, consider lagoon URL.
|
|
223
223
|
_runcheck('*', linktree)
|
|
224
224
|
|
|
225
225
|
class Container:
|
|
@@ -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)
|
|
@@ -34,7 +34,7 @@ class Files:
|
|
|
34
34
|
yield path
|
|
35
35
|
|
|
36
36
|
def __init__(self, root):
|
|
37
|
-
srcsuffixes = sum(([s, "
|
|
37
|
+
srcsuffixes = sum(([s, f"{s}.aridt"] for s in ['.py', '.py3', '.pyx', '.s', '.sh', '.h', '.cpp', '.cxx', '.arid', '.gradle', '.java', '.mk', '.md']), [])
|
|
38
38
|
self.allsrcpaths = [os.path.join(root, p) for p in self.relpaths(root, srcsuffixes, ['Dockerfile', 'Makefile'])]
|
|
39
39
|
self.docpaths = [p for p in self.allsrcpaths if p.endswith('.md')]
|
|
40
40
|
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__):
|
|
@@ -17,7 +17,7 @@ def pipify(info, version = None):
|
|
|
17
17
|
if info.config.github.participant:
|
|
18
18
|
_, url = info.descriptionandurl()
|
|
19
19
|
elif info.config.pypi.participant:
|
|
20
|
-
url = "https://pypi.org/project
|
|
20
|
+
url = f"https://pypi.org/project/{info.config.name}/"
|
|
21
21
|
else:
|
|
22
22
|
raise Exception
|
|
23
23
|
else:
|
|
@@ -120,12 +120,12 @@ class InstallDeps:
|
|
|
120
120
|
yield j, True
|
|
121
121
|
continue
|
|
122
122
|
if self.localrepo is not None:
|
|
123
|
-
repopath = os.path.join(self.localrepo, "
|
|
123
|
+
repopath = os.path.join(self.localrepo, f"{name}.git")
|
|
124
124
|
if os.path.exists(repopath):
|
|
125
125
|
if self.siblings:
|
|
126
126
|
log.warning("Not a sibling, install from repo: %s", name)
|
|
127
127
|
clonepath = os.path.join(self.workspace, name)
|
|
128
|
-
subprocess.check_call(['git', 'clone', '--depth', '1', "file
|
|
128
|
+
subprocess.check_call(['git', 'clone', '--depth', '1', f"file://{repopath}", clonepath])
|
|
129
129
|
subprocess.check_call(['git', 'fetch', '--tags'], cwd = clonepath)
|
|
130
130
|
volatileprojects[name] = j = ProjectInfo.seek(clonepath)
|
|
131
131
|
yield j, False
|
|
@@ -152,7 +152,7 @@ class InstallDeps:
|
|
|
152
152
|
venv.install([i.projectdir for i in self.volatileprojects] + [r.reqstr for r in self.fetchreqs])
|
|
153
153
|
|
|
154
154
|
def cinvoke(self, container):
|
|
155
|
-
container.install(["/installdeps
|
|
155
|
+
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
156
|
|
|
157
157
|
def __exit__(self, *exc_info):
|
|
158
158
|
shutil.rmtree(self.workspace)
|
|
@@ -43,7 +43,7 @@ class Req:
|
|
|
43
43
|
for r in cls.parselines(reqstrs):
|
|
44
44
|
try:
|
|
45
45
|
# FIXME: Allow running tests offline.
|
|
46
|
-
with urlopen(Request("https://pypi.org/simple
|
|
46
|
+
with urlopen(Request(f"https://pypi.org/simple/{quote(r.namepart, safe = '')}/", method = 'HEAD')):
|
|
47
47
|
pass
|
|
48
48
|
yield r
|
|
49
49
|
except HTTPError as e:
|
|
@@ -81,7 +81,7 @@ class Req:
|
|
|
81
81
|
|
|
82
82
|
def minstr(self):
|
|
83
83
|
version, = (s.version for s in self.specifierset if s.operator in {'>=', '=='})
|
|
84
|
-
return "
|
|
84
|
+
return f"{self.namepart}=={version}"
|
|
85
85
|
|
|
86
86
|
def accept(self):
|
|
87
87
|
marker = self.parsed.marker
|
|
@@ -158,7 +158,7 @@ class ProjectInfo:
|
|
|
158
158
|
import urllib.request, urllib.error, re, xml.dom.minidom as dom
|
|
159
159
|
pattern = re.compile('-([0-9]+)[-.]')
|
|
160
160
|
try:
|
|
161
|
-
with urllib.request.urlopen("https://pypi.org/simple
|
|
161
|
+
with urllib.request.urlopen(f"https://pypi.org/simple/{self.config.name}/") as f:
|
|
162
162
|
doc = dom.parseString(subprocess.check_output(['tidy', '-asxml'], input = f.read()))
|
|
163
163
|
last = max(int(pattern.search(textcontent(a)).group(1)) for a in doc.getElementsByTagName('a'))
|
|
164
164
|
except urllib.error.HTTPError as e:
|
|
@@ -169,11 +169,11 @@ class ProjectInfo:
|
|
|
169
169
|
|
|
170
170
|
def descriptionandurl(self):
|
|
171
171
|
import urllib.error, urllib.request, json, time
|
|
172
|
-
urlpath = "
|
|
172
|
+
urlpath = f"{self.config.github.account}/{self.config.name}"
|
|
173
173
|
while True:
|
|
174
174
|
try:
|
|
175
|
-
with urllib.request.urlopen("https://api.github.com/repos
|
|
176
|
-
return json.loads(f.read().decode())['description'], "https://github.com
|
|
175
|
+
with urllib.request.urlopen(f"https://api.github.com/repos/{urlpath}") as f:
|
|
176
|
+
return json.loads(f.read().decode())['description'], f"https://github.com/{urlpath}"
|
|
177
177
|
except urllib.error.HTTPError as e:
|
|
178
178
|
if 403 != e.code:
|
|
179
179
|
raise
|
|
@@ -192,7 +192,7 @@ class ProjectInfo:
|
|
|
192
192
|
f.write(getsource(mainmodules))
|
|
193
193
|
with open(os.path.join(tempdir, 'venvpool.py'), 'w') as f:
|
|
194
194
|
f.write(getsource(venvpool))
|
|
195
|
-
for line in subprocess.check_output(["python
|
|
195
|
+
for line in subprocess.check_output([f"python{next(iter(self.config.pyversions))}", scriptpath, self.projectdir] + paths).splitlines():
|
|
196
196
|
yield MainModule(eval(line))
|
|
197
197
|
|
|
198
198
|
def console_scripts(self):
|
|
@@ -200,7 +200,7 @@ class ProjectInfo:
|
|
|
200
200
|
|
|
201
201
|
def devversion(self):
|
|
202
202
|
releases = [int(t[1:]) for t in subprocess.check_output(['git', 'tag'], cwd = self.projectdir, universal_newlines = True).splitlines() if 'v' == t[0]]
|
|
203
|
-
return "
|
|
203
|
+
return f"{(max(releases) if releases else 0) + 1}.dev0"
|
|
204
204
|
|
|
205
205
|
class MainModule:
|
|
206
206
|
|
|
@@ -27,7 +27,7 @@ def _images():
|
|
|
27
27
|
i686 = Arch('linux32'),
|
|
28
28
|
x86_64 = Arch(None),
|
|
29
29
|
)
|
|
30
|
-
archmatch = re.compile("_(
|
|
30
|
+
archmatch = re.compile(f"_({'|'.join(map(re.escape, archlookup))})$").search
|
|
31
31
|
images = {
|
|
32
32
|
'manylinux_2_34_x86_64': '2024-11-23-da4547b',
|
|
33
33
|
'manylinux_2_28_x86_64': '2024-11-30-fa0d298',
|
|
@@ -43,8 +43,8 @@ class Image:
|
|
|
43
43
|
|
|
44
44
|
@singleton
|
|
45
45
|
def pythonexe():
|
|
46
|
-
impl = "cp
|
|
47
|
-
return "/opt/python
|
|
46
|
+
impl = f"cp{sysconfig.get_config_var('py_version_nodot')}"
|
|
47
|
+
return f"/opt/python/{impl}-{impl}{sys.abiflags}/bin/python"
|
|
48
48
|
|
|
49
49
|
def __init__(self, imagetag, plat, arch):
|
|
50
50
|
self.imagetag = imagetag
|
|
@@ -54,25 +54,24 @@ class Image:
|
|
|
54
54
|
def makewheels(self, info): # TODO: This code would benefit from modern syntax.
|
|
55
55
|
from lagoon import docker
|
|
56
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()
|
|
@@ -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 = lagoon.git.clean._xdi[partial](cwd = info.projectdir, input = 'c'
|
|
130
|
+
scrub = lagoon.git.clean._xdi[partial, print](cwd = info.projectdir, input = 'c')
|
|
132
131
|
scrub()
|
|
133
132
|
version = info.nextversion()
|
|
134
133
|
pipify(info, version)
|
|
@@ -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):
|
|
@@ -19,20 +19,20 @@ def main():
|
|
|
19
19
|
return
|
|
20
20
|
project = headinfo.config.name
|
|
21
21
|
# XXX: When building a tag use that same version?
|
|
22
|
-
with urlopen("https://pypi.org/rss/project
|
|
22
|
+
with urlopen(f"https://pypi.org/rss/project/{project}/releases.xml") as f:
|
|
23
23
|
version = ET.parse(f).find('./channel/item/title').text
|
|
24
|
-
req = "
|
|
24
|
+
req = f"{project}=={version}"
|
|
25
25
|
upstream_devel_packages = list(headinfo.config.upstream.devel.packages)
|
|
26
26
|
for pyversion in reversed(pyversiontags[3]): # XXX: Why only 3?
|
|
27
27
|
log.info("Python version: %s", pyversion)
|
|
28
|
-
with bgcontainer("python
|
|
29
|
-
containerexec = docker[partial](
|
|
28
|
+
with bgcontainer(f"python:{pyversion}") as container:
|
|
29
|
+
containerexec = docker.exec[partial, print](container)
|
|
30
30
|
if upstream_devel_packages:
|
|
31
31
|
initapt(containerexec)
|
|
32
32
|
containerexec('apt-get', 'update')
|
|
33
33
|
containerexec('apt-get', 'install', '-y', *upstream_devel_packages)
|
|
34
34
|
containerexec('pip', 'install', req)
|
|
35
|
-
git.checkout("v
|
|
35
|
+
git.checkout[print](f"v{version}")
|
|
36
36
|
EveryVersion(ProjectInfo.seek('.'), False, False, [], True, True).nose()
|
|
37
37
|
|
|
38
38
|
if '__main__' == __name__:
|
|
@@ -12,11 +12,11 @@ class Excludes:
|
|
|
12
12
|
def __init__(self, globs):
|
|
13
13
|
def disjunction():
|
|
14
14
|
sep = re.escape(os.sep)
|
|
15
|
-
star = "[
|
|
15
|
+
star = f"[^{sep}]*"
|
|
16
16
|
def components():
|
|
17
17
|
for word in glob.split('/'):
|
|
18
18
|
if '**' == word:
|
|
19
|
-
yield "(
|
|
19
|
+
yield f"(?:{star}{sep})*"
|
|
20
20
|
else:
|
|
21
21
|
yield star.join(re.escape(part) for part in word.split('*'))
|
|
22
22
|
yield sep
|
|
@@ -24,7 +24,7 @@ class Excludes:
|
|
|
24
24
|
concat = ''.join(components())
|
|
25
25
|
assert concat.endswith(sep)
|
|
26
26
|
yield concat[:-len(sep)]
|
|
27
|
-
self.pattern = re.compile("
|
|
27
|
+
self.pattern = re.compile(f"^{'|'.join(disjunction())}$")
|
|
28
28
|
|
|
29
29
|
def __contains__(self, relpath):
|
|
30
30
|
return self.pattern.search(relpath) is not None
|
|
@@ -51,7 +51,7 @@ def bgcontainer(*dockerrunargs):
|
|
|
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-102}/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 = '102',
|
|
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
|
|
File without changes
|