pyven 91__tar.gz → 93__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-91/README.md → pyven-93/PKG-INFO +12 -17
- pyven-91/PKG-INFO → pyven-93/README.md +0 -30
- {pyven-91 → pyven-93}/pyven/README.md.aridt +0 -17
- pyven-93/pyven/__init__.py +1 -0
- pyven-93/pyven/bdist.py +36 -0
- {pyven-91 → pyven-93}/pyven/checks.py +23 -26
- {pyven-91 → pyven-93}/pyven/cythonize.py +0 -17
- pyven-93/pyven/divcheck.py +17 -0
- pyven-93/pyven/drmake.py +11 -0
- {pyven-91 → pyven-93}/pyven/execcheck.py +0 -17
- {pyven-91 → pyven-93}/pyven/files.py +0 -17
- pyven-93/pyven/functions.py +6 -0
- {pyven-91 → pyven-93}/pyven/gclean.py +0 -17
- {pyven-91 → pyven-93}/pyven/launch.py +0 -17
- {pyven-91 → pyven-93}/pyven/licheck.py +14 -23
- {pyven-91 → pyven-93}/pyven/mainmodules.py +0 -17
- pyven-93/pyven/minreqs.py +10 -0
- pyven-93/pyven/nlcheck.py +11 -0
- pyven-93/pyven/patchpolicy.py +21 -0
- {pyven-91 → pyven-93}/pyven/pipify.py +2 -20
- pyven-93/pyven/projectinfo.arid +26 -0
- {pyven-91 → pyven-93}/pyven/projectinfo.py +18 -30
- pyven-93/pyven/release.arid +7 -0
- {pyven-91 → pyven-93}/pyven/release.py +30 -32
- {pyven-91 → pyven-93}/pyven/setup.py.aridt +1 -19
- pyven-93/pyven/setuptools.arid +2 -0
- {pyven-91 → pyven-93}/pyven/sourceinfo.py +0 -17
- {pyven-91 → pyven-93}/pyven/tasks.py +0 -17
- pyven-93/pyven/tests/__init__.py +5 -0
- {pyven-91 → pyven-93}/pyven/tryinstall.py +2 -18
- {pyven-91 → pyven-93}/pyven/util.py +5 -17
- {pyven-91 → pyven-93}/pyven.egg-info/PKG-INFO +3 -21
- {pyven-91 → pyven-93}/pyven.egg-info/SOURCES.txt +2 -8
- {pyven-91 → pyven-93}/pyven.egg-info/requires.txt +2 -2
- {pyven-91 → pyven-93}/setup.py +4 -56
- pyven-91/COPYING +0 -674
- pyven-91/foreignsyms +0 -3
- pyven-91/pyven/__init__.py +0 -18
- pyven-91/pyven/bdist.py +0 -51
- pyven-91/pyven/divcheck.py +0 -34
- pyven-91/pyven/drmake.py +0 -28
- pyven-91/pyven/minreqs.py +0 -27
- pyven-91/pyven/nlcheck.py +0 -28
- pyven-91/pyven/patchpolicy.py +0 -34
- pyven-91/pyven/projectinfo.arid +0 -42
- pyven-91/pyven/release.arid +0 -24
- pyven-91/pyven/setuproot/Cython/Build.py +0 -19
- pyven-91/pyven/setuproot/Cython/__init__.py +0 -17
- pyven-91/pyven/setuproot/__init__.py +0 -45
- pyven-91/pyven/setuproot/ez_setup.py +0 -19
- pyven-91/pyven/setuproot/fakesetup.py +0 -60
- pyven-91/pyven/setuproot/setuptools.arid +0 -19
- pyven-91/pyven/tests/__init__.py +0 -22
- {pyven-91 → pyven-93}/pyven/pyproject.toml.aridt +0 -0
- {pyven-91 → pyven-93}/pyven/setup.cfg.aridt +0 -0
- {pyven-91 → pyven-93}/pyven.egg-info/dependency_links.txt +0 -0
- {pyven-91 → pyven-93}/pyven.egg-info/entry_points.txt +0 -0
- {pyven-91 → pyven-93}/pyven.egg-info/top_level.txt +0 -0
- {pyven-91 → pyven-93}/setup.cfg +0 -0
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyven
|
|
3
|
+
Version: 93
|
|
4
|
+
Summary: Manage development of multiple Python projects
|
|
5
|
+
Home-page: UNKNOWN
|
|
6
|
+
Author: foyono
|
|
7
|
+
License: UNKNOWN
|
|
8
|
+
Platform: UNKNOWN
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
1
11
|
# pyven
|
|
2
12
|
Manage development of multiple Python projects
|
|
3
13
|
|
|
@@ -18,23 +28,6 @@ venvname/bin/pip install pyven
|
|
|
18
28
|
. venvname/bin/activate
|
|
19
29
|
```
|
|
20
30
|
|
|
21
|
-
### To develop
|
|
22
|
-
First clone the repo using HTTP or SSH:
|
|
23
|
-
```
|
|
24
|
-
git clone https://github.com/combatopera/pyven.git
|
|
25
|
-
git clone git@github.com:combatopera/pyven.git
|
|
26
|
-
```
|
|
27
|
-
Now use pyven's pipify to create a setup.py, which pip can then use to install the project editably:
|
|
28
|
-
```
|
|
29
|
-
python3 -m venv pyvenvenv
|
|
30
|
-
pyvenvenv/bin/pip install pyven
|
|
31
|
-
pyvenvenv/bin/pipify pyven
|
|
32
|
-
|
|
33
|
-
python3 -m venv venvname
|
|
34
|
-
venvname/bin/pip install -e pyven
|
|
35
|
-
. venvname/bin/activate
|
|
36
|
-
```
|
|
37
|
-
|
|
38
31
|
## Commands
|
|
39
32
|
|
|
40
33
|
### drmake
|
|
@@ -63,3 +56,5 @@ Run project unit tests and more, also suitable for CI.
|
|
|
63
56
|
|
|
64
57
|
### tryinstall
|
|
65
58
|
Check last release can be installed from PyPI and its tests still pass, for use by CI.
|
|
59
|
+
|
|
60
|
+
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: pyven
|
|
3
|
-
Version: 91
|
|
4
|
-
Summary: Manage development of multiple Python projects
|
|
5
|
-
Home-page: https://github.com/combatopera/pyven
|
|
6
|
-
Author: Andrzej Cichocki
|
|
7
|
-
License: UNKNOWN
|
|
8
|
-
Platform: UNKNOWN
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: COPYING
|
|
11
|
-
|
|
12
1
|
# pyven
|
|
13
2
|
Manage development of multiple Python projects
|
|
14
3
|
|
|
@@ -29,23 +18,6 @@ venvname/bin/pip install pyven
|
|
|
29
18
|
. venvname/bin/activate
|
|
30
19
|
```
|
|
31
20
|
|
|
32
|
-
### To develop
|
|
33
|
-
First clone the repo using HTTP or SSH:
|
|
34
|
-
```
|
|
35
|
-
git clone https://github.com/combatopera/pyven.git
|
|
36
|
-
git clone git@github.com:combatopera/pyven.git
|
|
37
|
-
```
|
|
38
|
-
Now use pyven's pipify to create a setup.py, which pip can then use to install the project editably:
|
|
39
|
-
```
|
|
40
|
-
python3 -m venv pyvenvenv
|
|
41
|
-
pyvenvenv/bin/pip install pyven
|
|
42
|
-
pyvenvenv/bin/pipify pyven
|
|
43
|
-
|
|
44
|
-
python3 -m venv venvname
|
|
45
|
-
venvname/bin/pip install -e pyven
|
|
46
|
-
. venvname/bin/activate
|
|
47
|
-
```
|
|
48
|
-
|
|
49
21
|
## Commands
|
|
50
22
|
|
|
51
23
|
### drmake
|
|
@@ -74,5 +46,3 @@ Run project unit tests and more, also suitable for CI.
|
|
|
74
46
|
|
|
75
47
|
### tryinstall
|
|
76
48
|
Check last release can be installed from PyPI and its tests still pass, for use by CI.
|
|
77
|
-
|
|
78
|
-
|
|
@@ -16,23 +16,6 @@ If you prefer to keep .local clean, install to a virtualenv:
|
|
|
16
16
|
python$first$(pyversions) -m venv venvname
|
|
17
17
|
venvname/bin/pip install $(name)
|
|
18
18
|
. venvname/bin/activate
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### To develop
|
|
22
|
-
First clone the repo using HTTP or SSH:
|
|
23
|
-
```
|
|
24
|
-
git clone https://github.com/combatopera/$(name).git
|
|
25
|
-
git clone git@github.com:combatopera/$(name).git
|
|
26
|
-
```
|
|
27
|
-
Now use pyven's pipify to create a setup.py, which pip can then use to install the project editably:
|
|
28
|
-
```
|
|
29
|
-
python$first$(pyversions) -m venv pyvenvenv
|
|
30
|
-
pyvenvenv/bin/pip install pyven
|
|
31
|
-
pyvenvenv/bin/pipify $(name)
|
|
32
|
-
|
|
33
|
-
python$first$(pyversions) -m venv venvname
|
|
34
|
-
venvname/bin/pip install -e $(name)
|
|
35
|
-
. venvname/bin/activate
|
|
36
19
|
```$try($join$list$first$map($(commands) $.[
|
|
37
20
|
|
|
38
21
|
## Commands]) $.())$join$map($(commands) $.[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file blank.
|
pyven-93/pyven/bdist.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from argparse import ArgumentParser
|
|
2
|
+
from glob import iglob
|
|
3
|
+
from tempfile import mkdtemp
|
|
4
|
+
import logging, os, shutil, subprocess
|
|
5
|
+
|
|
6
|
+
log = logging.getLogger(__name__)
|
|
7
|
+
distdir = 'dist'
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
logging.basicConfig(format = "<%(levelname)s> %(message)s", level = logging.DEBUG)
|
|
11
|
+
parser = ArgumentParser()
|
|
12
|
+
parser.add_argument('--plat', required = True)
|
|
13
|
+
parser.add_argument('pyversions', nargs = '+')
|
|
14
|
+
args = parser.parse_args()
|
|
15
|
+
holder = mkdtemp()
|
|
16
|
+
try:
|
|
17
|
+
for pip in sorted(iglob("/opt/python/cp[%s]*/bin/pip" % ''.join(args.pyversions))):
|
|
18
|
+
compatibility = pip.split(os.sep)[3]
|
|
19
|
+
log.info("Make wheel(s) for implementation-ABI: %s", compatibility)
|
|
20
|
+
try:
|
|
21
|
+
subprocess.check_call([pip, '--no-cache-dir', 'wheel', '--no-deps', '-w', holder, '.'])
|
|
22
|
+
except subprocess.CalledProcessError:
|
|
23
|
+
log.warning('Skip compatibility:', exc_info = True)
|
|
24
|
+
continue
|
|
25
|
+
wheelpath, = (os.path.join(holder, n) for n in os.listdir(holder))
|
|
26
|
+
subprocess.check_call(['auditwheel', 'repair', '--plat', args.plat, '-w', distdir, wheelpath])
|
|
27
|
+
plaintarget = os.path.join(distdir, os.path.basename(wheelpath))
|
|
28
|
+
if os.path.exists(plaintarget):
|
|
29
|
+
log.info("Replace plain wheel: %s", plaintarget)
|
|
30
|
+
shutil.copy2(wheelpath, distdir)
|
|
31
|
+
os.remove(wheelpath)
|
|
32
|
+
finally:
|
|
33
|
+
shutil.rmtree(holder)
|
|
34
|
+
|
|
35
|
+
if ('__main__' == __name__):
|
|
36
|
+
main()
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
from .files import Files
|
|
19
2
|
from .pipify import InstallDeps
|
|
20
3
|
from .projectinfo import ProjectInfo, SimpleInstallDeps
|
|
21
|
-
from .util import bgcontainer, Excludes, pyversiontags, stderr
|
|
4
|
+
from .util import bgcontainer, Excludes, initapt, pyversiontags, stderr
|
|
22
5
|
from argparse import ArgumentParser
|
|
23
6
|
from aridity.config import ConfigCtrl
|
|
24
7
|
from aridity.util import NoSuchPathException, openresource
|
|
25
8
|
from diapyr.util import singleton
|
|
26
9
|
from itertools import chain
|
|
27
10
|
from lagoon import diff
|
|
11
|
+
from lagoon.program import partial
|
|
28
12
|
from setuptools import find_packages
|
|
29
13
|
from tempfile import NamedTemporaryFile
|
|
30
14
|
from venvpool import initlogging, Pool
|
|
@@ -63,7 +47,7 @@ class EveryVersion:
|
|
|
63
47
|
self.transient = transient
|
|
64
48
|
|
|
65
49
|
def allchecks(self):
|
|
66
|
-
for check in self.licheck, self.nlcheck, self.execcheck, self.divcheck, self.pyflakes, self.nose, self.readme:
|
|
50
|
+
for check in self.licheck, self.nlcheck, self.execcheck, self.divcheck, self.pyflakes, self.nose, self.readme, self.github:
|
|
67
51
|
check()
|
|
68
52
|
|
|
69
53
|
def licheck(self):
|
|
@@ -113,12 +97,13 @@ class EveryVersion:
|
|
|
113
97
|
xmlpath = os.path.join(reportsdir, 'nosetests.xml')
|
|
114
98
|
if self.docker:
|
|
115
99
|
coveragepath = os.path.join(self.info.projectdir, '.coverage')
|
|
116
|
-
with bgcontainer('-v', "%s:%s" % (os.path.abspath(self.info.projectdir), Container.workdir), "python:%s" % pyversiontags[pyversion][0]) as container:
|
|
100
|
+
with bgcontainer('-v', "{0}:{0}".format('/var/run/docker.sock'), '--network', 'host', '-v', "%s:%s" % (os.path.abspath(self.info.projectdir), Container.workdir), "python:%s" % pyversiontags[pyversion][0]) as container:
|
|
117
101
|
container = Container(container)
|
|
118
102
|
container.inituser()
|
|
119
103
|
if upstream_devel_packages:
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
container.initapt()
|
|
105
|
+
for command in ['apt-get', 'update'], ['apt-get', 'install', '-y', 'sudo'] + upstream_devel_packages:
|
|
106
|
+
container.call(command, check = True, root = True)
|
|
122
107
|
installdeps.invoke(container)
|
|
123
108
|
cpath = lambda p: os.path.relpath(p, self.info.projectdir).replace(os.sep, '/')
|
|
124
109
|
status = container.call([
|
|
@@ -145,11 +130,10 @@ class EveryVersion:
|
|
|
145
130
|
return o
|
|
146
131
|
raise NoSuchPathException('Empty set.')
|
|
147
132
|
def readme():
|
|
148
|
-
if not self.info.config.github.participant:
|
|
133
|
+
if not (self.info.config.github.participant or self.info.config.pypi.participant):
|
|
149
134
|
return skip
|
|
150
135
|
config = (-self.info.config).childctrl().node
|
|
151
136
|
config.first = first
|
|
152
|
-
config.tagline, _ = self.info.descriptionandurl()
|
|
153
137
|
(-config).execute('commands * name = $label()')
|
|
154
138
|
mainmodules = sorted(self.info.mainmodules(), key = lambda mm: mm.command)
|
|
155
139
|
undocumented = [mm.command for mm in mainmodules if mm.doc is None]
|
|
@@ -167,6 +151,14 @@ class EveryVersion:
|
|
|
167
151
|
assert all('<' != l[0] for l in completed.stdout.splitlines())
|
|
168
152
|
_runcheck('*', readme)
|
|
169
153
|
|
|
154
|
+
def github(self):
|
|
155
|
+
def github():
|
|
156
|
+
if not self.info.config.github.participant:
|
|
157
|
+
return skip
|
|
158
|
+
description, _ = self.info.descriptionandurl()
|
|
159
|
+
assert self.info.config.tagline == description
|
|
160
|
+
_runcheck('*', github)
|
|
161
|
+
|
|
170
162
|
class Container:
|
|
171
163
|
|
|
172
164
|
workdir = '/io'
|
|
@@ -179,8 +171,13 @@ class Container:
|
|
|
179
171
|
|
|
180
172
|
def inituser(self):
|
|
181
173
|
from lagoon import docker
|
|
174
|
+
docker('exec', self.container, 'groupadd', '-g', os.stat('/var/run/docker.sock').st_gid, 'docker', stdout = None)
|
|
182
175
|
docker('exec', self.container, 'groupadd', '-g', self.gid, 'pyvengroup', stdout = None)
|
|
183
|
-
docker('exec', self.container, 'useradd', '-g', self.gid, '-u', self.uid, '-m', 'pyvenuser', stdout = None)
|
|
176
|
+
docker('exec', self.container, 'useradd', '-g', self.gid, '-G', 'docker', '-u', self.uid, '-m', 'pyvenuser', stdout = None)
|
|
177
|
+
|
|
178
|
+
def initapt(self):
|
|
179
|
+
from lagoon import docker
|
|
180
|
+
initapt(docker[partial]('exec', self.container, stdout = None))
|
|
184
181
|
|
|
185
182
|
def install(self, args):
|
|
186
183
|
from lagoon import docker
|
|
@@ -189,7 +186,7 @@ class Container:
|
|
|
189
186
|
|
|
190
187
|
def call(self, args, check = False, root = False):
|
|
191
188
|
from lagoon import docker
|
|
192
|
-
return docker('exec', '-w', self.workdir, *([] if root else ['-u',
|
|
189
|
+
return docker('exec', '-w', self.workdir, self.container, *([] if root else ['sudo', '-u', 'pyvenuser']) + args, stdout = None, check = check)
|
|
193
190
|
|
|
194
191
|
def main():
|
|
195
192
|
initlogging()
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
def lazy(clazz, init, *initbefore):
|
|
19
2
|
from threading import Lock
|
|
20
3
|
initlock = Lock()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ast, re, sys
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
for path in sys.argv[1:]:
|
|
5
|
+
with open(path) as f:
|
|
6
|
+
text = f.read()
|
|
7
|
+
for node in ast.walk(ast.parse(text)):
|
|
8
|
+
if 'Div' == type(node).__name__:
|
|
9
|
+
hasdiv = True
|
|
10
|
+
break
|
|
11
|
+
else:
|
|
12
|
+
hasdiv = False
|
|
13
|
+
if hasdiv == (re.search('^from __future__ import division(?: # .+)?$', text, flags = re.MULTILINE) is None):
|
|
14
|
+
raise Exception(path)
|
|
15
|
+
|
|
16
|
+
if ('__main__' == __name__):
|
|
17
|
+
main()
|
pyven-93/pyven/drmake.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'Build a Docker image with automatic tag.'
|
|
2
|
+
from .projectinfo import ProjectInfo
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
info = ProjectInfo.seek('.')
|
|
7
|
+
command = 'docker', 'build', '-t', info.config.docker.tag, info.projectdir
|
|
8
|
+
os.execvp(command[0], command)
|
|
9
|
+
|
|
10
|
+
if '__main__' == __name__:
|
|
11
|
+
main()
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
import os
|
|
19
2
|
|
|
20
3
|
execmask = 0x49
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
from .util import stripeol
|
|
19
2
|
from collections import defaultdict
|
|
20
3
|
import os, subprocess, xml.dom.minidom as dom
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
'Remove files matching patterns below #glean in .gitignore file.'
|
|
19
2
|
from .util import stderr
|
|
20
3
|
import re, os, sys, shutil
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
'Run project using a suitable venv from the pool.'
|
|
19
2
|
from .pipify import InstallDeps
|
|
20
3
|
from .projectinfo import ProjectInfo
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
import hashlib, os, re, shlex, sys
|
|
19
2
|
|
|
20
3
|
gpltemplate = """# Copyright %(years)s %(author)s
|
|
@@ -41,6 +24,14 @@ intersection = '''# This file incorporates work covered by the following copyrig
|
|
|
41
24
|
def _hassuffix(name, *suffixes):
|
|
42
25
|
return name.endswith(suffixes) or name.endswith(tuple("%s.aridt" % s for s in suffixes))
|
|
43
26
|
|
|
27
|
+
def _checkmd5(info, name, expected):
|
|
28
|
+
licpath = os.path.join(info.projectdir, name)
|
|
29
|
+
md5 = hashlib.md5()
|
|
30
|
+
with open(licpath) as f:
|
|
31
|
+
md5.update(f.read().encode('utf_8'))
|
|
32
|
+
if expected != md5.hexdigest():
|
|
33
|
+
raise Exception(licpath)
|
|
34
|
+
|
|
44
35
|
def licheck(info, paths):
|
|
45
36
|
if not info.config.licheck.enabled:
|
|
46
37
|
sys.stderr.write('SKIP ')
|
|
@@ -58,6 +49,8 @@ def licheck(info, paths):
|
|
|
58
49
|
elif 'MIT' == name:
|
|
59
50
|
with open(info.mitpath()) as f:
|
|
60
51
|
sections.append(''.join(('# ' if l.rstrip() else '#') + l for l in f))
|
|
52
|
+
elif 'UNLICENSE' == name:
|
|
53
|
+
pass
|
|
61
54
|
else:
|
|
62
55
|
raise Exception(name)
|
|
63
56
|
master = ''.join(s + '\n' for s in sections) # Check each section ends with 2 newlines.
|
|
@@ -77,9 +70,7 @@ def licheck(info, paths):
|
|
|
77
70
|
badpaths = [p for p in paths if not checkone(p)]
|
|
78
71
|
if badpaths:
|
|
79
72
|
raise Exception(' '.join(map(shlex.quote, badpaths)))
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if 'd32239bcb673463ab874e80d47fae504' != md5.hexdigest():
|
|
85
|
-
raise Exception(gplpath)
|
|
73
|
+
if 'GPL' in info.config.licenses:
|
|
74
|
+
_checkmd5(info, 'COPYING', 'd32239bcb673463ab874e80d47fae504')
|
|
75
|
+
if 'UNLICENSE' in info.config.licenses:
|
|
76
|
+
_checkmd5(info, 'UNLICENSE', '7246f848faa4e9c9fc0ea91122d6e680')
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
from venvpool import checkpath, commandornone, dotpy as extension, scriptregex
|
|
19
2
|
import ast, logging, os, re, sys
|
|
20
3
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'Print project.arid snippet pinning requires to their minimum allowed versions.'
|
|
2
|
+
from .projectinfo import ProjectInfo
|
|
3
|
+
from venvpool import initlogging
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
initlogging()
|
|
7
|
+
print("requires = $list(%s)" % ' '.join(r.minstr() for r in ProjectInfo.seek('.').parsedrequires()))
|
|
8
|
+
|
|
9
|
+
if '__main__' == __name__:
|
|
10
|
+
main()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
class MoreThanOneEolStyleException(Exception): pass
|
|
4
|
+
|
|
5
|
+
def nlcheck(paths):
|
|
6
|
+
for path in paths:
|
|
7
|
+
with open(path, 'rb') as f:
|
|
8
|
+
text = f.read().decode()
|
|
9
|
+
eols = set(re.findall(r'\r\n|[\r\n]', text))
|
|
10
|
+
if len(eols) > 1:
|
|
11
|
+
raise MoreThanOneEolStyleException(path)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from itertools import chain
|
|
2
|
+
import glob, json
|
|
3
|
+
|
|
4
|
+
policyglobs = [
|
|
5
|
+
'/opt/_internal/*/lib/python3.7/site-packages/auditwheel/policy/policy.json',
|
|
6
|
+
'/opt/_internal/pipx/venvs/auditwheel/lib/python3.10/site-packages/auditwheel/policy/manylinux-policy.json',
|
|
7
|
+
]
|
|
8
|
+
syslibs = 'libasound.so.2', 'libjack.so.0', 'libportaudio.so.2'
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
policypath, = chain(*map(glob.iglob, policyglobs))
|
|
12
|
+
with open(policypath) as f:
|
|
13
|
+
policy = json.load(f)
|
|
14
|
+
for edition in policy:
|
|
15
|
+
if edition['name'].startswith('manylinux'):
|
|
16
|
+
edition['lib_whitelist'].extend(syslibs)
|
|
17
|
+
with open(policypath, 'w') as f:
|
|
18
|
+
json.dump(policy, f)
|
|
19
|
+
|
|
20
|
+
if ('__main__' == __name__):
|
|
21
|
+
main()
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
# Copyright 2013, 2014, 2015, 2016, 2017, 2020, 2022 Andrzej Cichocki
|
|
2
|
-
|
|
3
|
-
# This file is part of pyven.
|
|
4
|
-
#
|
|
5
|
-
# pyven is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# pyven is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with pyven. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
'Generate setuptools files for a project.arid project.'
|
|
19
2
|
from .projectinfo import ProjectInfo, Req, SimpleInstallDeps
|
|
20
3
|
from .sourceinfo import SourceInfo
|
|
@@ -29,17 +12,16 @@ log = logging.getLogger(__name__)
|
|
|
29
12
|
def pipify(info, version = None):
|
|
30
13
|
release = version is not None
|
|
31
14
|
# Allow release of project without origin:
|
|
32
|
-
|
|
15
|
+
_, url = info.descriptionandurl() if release and info.config.github.participant else [None, None]
|
|
33
16
|
config = (-info.config).childctrl()
|
|
34
17
|
config.put('version', scalar = version if release else info.devversion())
|
|
35
|
-
config.put('description', scalar =
|
|
18
|
+
config.put('description', scalar = info.config.tagline)
|
|
36
19
|
config.put('long_description', text = 'long_description()' if release else repr(None))
|
|
37
20
|
config.put('url', scalar = url)
|
|
38
21
|
if not release:
|
|
39
22
|
config.put('author', scalar = None)
|
|
40
23
|
config.put('py_modules', scalar = info.py_modules())
|
|
41
24
|
config.put('install_requires', scalar = info.allrequires())
|
|
42
|
-
config.put('scripts', scalar = info.scripts())
|
|
43
25
|
config.put('console_scripts', scalar = info.console_scripts())
|
|
44
26
|
config.put('universal', number = int({2, 3} <= set(info.config.pyversions)))
|
|
45
27
|
# XXX: Use soak to generate these?
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
fwrap = $pyref(.functions fwrap)
|
|
2
|
+
neq := $fwrap$pyref(operator ne)
|
|
3
|
+
requires := $list()
|
|
4
|
+
pyversions := $list()
|
|
5
|
+
proprietary = false
|
|
6
|
+
resource types := $list(pxd pyx pyxbld arid aridt)
|
|
7
|
+
build requires := $list()
|
|
8
|
+
licenses := $list(GPL)
|
|
9
|
+
MIT path = LICENSE
|
|
10
|
+
licheck
|
|
11
|
+
enabled = $¬$(proprietary)
|
|
12
|
+
exclude globs := $list()
|
|
13
|
+
flakes exclude globs := $list()
|
|
14
|
+
pypi
|
|
15
|
+
account = $(None)
|
|
16
|
+
participant = $neq($(account) $(None))
|
|
17
|
+
github
|
|
18
|
+
account = $(None)
|
|
19
|
+
participant = $neq($(account) $(None))
|
|
20
|
+
devel
|
|
21
|
+
packages := $list()
|
|
22
|
+
scripts := $list()
|
|
23
|
+
warmups := $list()
|
|
24
|
+
upstream devel packages := $list()
|
|
25
|
+
test requires := $list()
|
|
26
|
+
tagline = $(void)
|