pyven 92__tar.gz → 94__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. pyven-92/README.md → pyven-94/PKG-INFO +14 -17
  2. pyven-92/PKG-INFO → pyven-94/README.md +1 -30
  3. {pyven-92 → pyven-94}/pyven/README.md.aridt +1 -17
  4. pyven-94/pyven/__init__.py +1 -0
  5. {pyven-92 → pyven-94}/pyven/bdist.py +0 -17
  6. {pyven-92 → pyven-94}/pyven/checks.py +10 -20
  7. {pyven-92 → pyven-94}/pyven/cythonize.py +0 -17
  8. pyven-94/pyven/divcheck.py +17 -0
  9. pyven-94/pyven/drmake.py +11 -0
  10. {pyven-92 → pyven-94}/pyven/execcheck.py +0 -17
  11. {pyven-92 → pyven-94}/pyven/files.py +0 -17
  12. pyven-94/pyven/functions.py +6 -0
  13. {pyven-92 → pyven-94}/pyven/gclean.py +0 -17
  14. {pyven-92 → pyven-94}/pyven/launch.py +0 -17
  15. {pyven-92 → pyven-94}/pyven/licheck.py +14 -23
  16. {pyven-92 → pyven-94}/pyven/mainmodules.py +0 -17
  17. pyven-94/pyven/minreqs.py +10 -0
  18. pyven-94/pyven/nlcheck.py +11 -0
  19. pyven-94/pyven/patchpolicy.py +21 -0
  20. {pyven-92 → pyven-94}/pyven/pipify.py +41 -39
  21. pyven-94/pyven/projectinfo.arid +27 -0
  22. {pyven-92 → pyven-94}/pyven/projectinfo.py +18 -30
  23. pyven-94/pyven/release.arid +7 -0
  24. {pyven-92 → pyven-94}/pyven/release.py +5 -25
  25. pyven-94/pyven/setup-native.py.aridt +25 -0
  26. pyven-94/pyven/setup.py.aridt +21 -0
  27. pyven-94/pyven/setuptools.arid +2 -0
  28. {pyven-92 → pyven-94}/pyven/sourceinfo.py +0 -17
  29. {pyven-92 → pyven-94}/pyven/tasks.py +0 -17
  30. pyven-94/pyven/tests/__init__.py +5 -0
  31. {pyven-92 → pyven-94}/pyven/tryinstall.py +0 -17
  32. {pyven-92 → pyven-94}/pyven/util.py +0 -17
  33. {pyven-92 → pyven-94}/pyven.egg-info/PKG-INFO +5 -21
  34. {pyven-92 → pyven-94}/pyven.egg-info/SOURCES.txt +3 -8
  35. {pyven-92 → pyven-94}/pyven.egg-info/requires.txt +1 -1
  36. pyven-94/setup.py +21 -0
  37. pyven-92/COPYING +0 -674
  38. pyven-92/foreignsyms +0 -3
  39. pyven-92/pyven/__init__.py +0 -18
  40. pyven-92/pyven/divcheck.py +0 -34
  41. pyven-92/pyven/drmake.py +0 -28
  42. pyven-92/pyven/minreqs.py +0 -27
  43. pyven-92/pyven/nlcheck.py +0 -28
  44. pyven-92/pyven/patchpolicy.py +0 -38
  45. pyven-92/pyven/projectinfo.arid +0 -38
  46. pyven-92/pyven/release.arid +0 -24
  47. pyven-92/pyven/setup.py.aridt +0 -45
  48. pyven-92/pyven/setuproot/Cython/Build.py +0 -19
  49. pyven-92/pyven/setuproot/Cython/__init__.py +0 -17
  50. pyven-92/pyven/setuproot/__init__.py +0 -45
  51. pyven-92/pyven/setuproot/ez_setup.py +0 -19
  52. pyven-92/pyven/setuproot/fakesetup.py +0 -60
  53. pyven-92/pyven/setuproot/setuptools.arid +0 -19
  54. pyven-92/pyven/tests/__init__.py +0 -22
  55. pyven-92/setup.py +0 -151
  56. {pyven-92 → pyven-94}/pyven/pyproject.toml.aridt +0 -0
  57. {pyven-92 → pyven-94}/pyven/setup.cfg.aridt +0 -0
  58. {pyven-92 → pyven-94}/pyven.egg-info/dependency_links.txt +0 -0
  59. {pyven-92 → pyven-94}/pyven.egg-info/entry_points.txt +0 -0
  60. {pyven-92 → pyven-94}/pyven.egg-info/top_level.txt +0 -0
  61. {pyven-92 → pyven-94}/setup.cfg +0 -0
@@ -1,3 +1,14 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyven
3
+ Version: 94
4
+ Summary: Manage development of multiple Python projects
5
+ Home-page: https://pypi.org/project/pyven/
6
+ Author: foyono
7
+ Author-email: shrovis@foyono.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Description-Content-Type: text/markdown
11
+
1
12
  # pyven
2
13
  Manage development of multiple Python projects
3
14
 
@@ -14,27 +25,11 @@ pip3 install --user pyven
14
25
  If you prefer to keep .local clean, install to a virtualenv:
15
26
  ```
16
27
  python3 -m venv venvname
28
+ venvname/bin/pip install -U pip
17
29
  venvname/bin/pip install pyven
18
30
  . venvname/bin/activate
19
31
  ```
20
32
 
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
33
  ## Commands
39
34
 
40
35
  ### drmake
@@ -63,3 +58,5 @@ Run project unit tests and more, also suitable for CI.
63
58
 
64
59
  ### tryinstall
65
60
  Check last release can be installed from PyPI and its tests still pass, for use by CI.
61
+
62
+
@@ -1,14 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: pyven
3
- Version: 92
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
 
@@ -25,27 +14,11 @@ pip3 install --user pyven
25
14
  If you prefer to keep .local clean, install to a virtualenv:
26
15
  ```
27
16
  python3 -m venv venvname
17
+ venvname/bin/pip install -U pip
28
18
  venvname/bin/pip install pyven
29
19
  . venvname/bin/activate
30
20
  ```
31
21
 
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
22
  ## Commands
50
23
 
51
24
  ### drmake
@@ -74,5 +47,3 @@ Run project unit tests and more, also suitable for CI.
74
47
 
75
48
  ### tryinstall
76
49
  Check last release can be installed from PyPI and its tests still pass, for use by CI.
77
-
78
-
@@ -14,25 +14,9 @@ pip$first$(pyversions) install --user $(name)
14
14
  If you prefer to keep .local clean, install to a virtualenv:
15
15
  ```
16
16
  python$first$(pyversions) -m venv venvname
17
+ venvname/bin/pip install -U pip
17
18
  venvname/bin/pip install $(name)
18
19
  . 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
20
  ```$try($join$list$first$map($(commands) $.[
37
21
 
38
22
  ## Commands]) $.())$join$map($(commands) $.[
@@ -0,0 +1 @@
1
+ # This file blank.
@@ -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 argparse import ArgumentParser
19
2
  from glob import iglob
20
3
  from tempfile import mkdtemp
@@ -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 .files import Files
19
2
  from .pipify import InstallDeps
20
3
  from .projectinfo import ProjectInfo, SimpleInstallDeps
@@ -64,7 +47,7 @@ class EveryVersion:
64
47
  self.transient = transient
65
48
 
66
49
  def allchecks(self):
67
- 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:
68
51
  check()
69
52
 
70
53
  def licheck(self):
@@ -147,11 +130,10 @@ class EveryVersion:
147
130
  return o
148
131
  raise NoSuchPathException('Empty set.')
149
132
  def readme():
150
- if not self.info.config.github.participant:
133
+ if not (self.info.config.github.participant or self.info.config.pypi.participant):
151
134
  return skip
152
135
  config = (-self.info.config).childctrl().node
153
136
  config.first = first
154
- config.tagline, _ = self.info.descriptionandurl()
155
137
  (-config).execute('commands * name = $label()')
156
138
  mainmodules = sorted(self.info.mainmodules(), key = lambda mm: mm.command)
157
139
  undocumented = [mm.command for mm in mainmodules if mm.doc is None]
@@ -169,6 +151,14 @@ class EveryVersion:
169
151
  assert all('<' != l[0] for l in completed.stdout.splitlines())
170
152
  _runcheck('*', readme)
171
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
+
172
162
  class Container:
173
163
 
174
164
  workdir = '/io'
@@ -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()
@@ -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
@@ -0,0 +1,6 @@
1
+ from aridity.model import Function, wrap
2
+
3
+ def fwrap(scope, fresolvable):
4
+ def g(scope, *resolvables):
5
+ return wrap(fresolvable.resolve(scope).scalar(*(r.resolve(scope).scalar for r in resolvables)))
6
+ return Function(g)
@@ -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
- gplpath = os.path.join(info.projectdir, 'COPYING')
81
- md5 = hashlib.md5()
82
- with open(gplpath) as f:
83
- md5.update(f.read().encode('utf_8'))
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,24 +1,8 @@
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
21
4
  from argparse import ArgumentParser
5
+ from aridity.config import ConfigCtrl
22
6
  from pkg_resources import resource_filename
23
7
  from tempfile import mkdtemp
24
8
  from venvpool import initlogging, Pool
@@ -29,35 +13,53 @@ log = logging.getLogger(__name__)
29
13
  def pipify(info, version = None):
30
14
  release = version is not None
31
15
  # Allow release of project without origin:
32
- description, url = info.descriptionandurl() if release and info.config.github.participant else [None, None]
33
- config = (-info.config).childctrl()
34
- config.put('version', scalar = version if release else info.devversion())
35
- config.put('description', scalar = description)
36
- config.put('long_description', text = 'long_description()' if release else repr(None))
37
- config.put('url', scalar = url)
38
- if not release:
39
- config.put('author', scalar = None)
40
- config.put('py_modules', scalar = info.py_modules())
41
- config.put('install_requires', scalar = info.allrequires())
42
- config.put('scripts', scalar = info.scripts())
43
- config.put('console_scripts', scalar = info.console_scripts())
44
- config.put('universal', number = int({2, 3} <= set(info.config.pyversions)))
16
+ if release:
17
+ if info.config.github.participant:
18
+ _, url = info.descriptionandurl()
19
+ elif info.config.pypi.participant:
20
+ url = "https://pypi.org/project/%s/" % info.config.name
21
+ else:
22
+ raise Exception
23
+ else:
24
+ url = None
25
+ cc = ConfigCtrl()
26
+ cc.execute('''py_modules := $list()
27
+ install_requires := $list()
28
+ console_scripts := $list()
29
+ ''')
30
+ cc.w.name = info.config.name
31
+ cc.w.tagline = info.config.tagline
32
+ for t in info.config.resource.types:
33
+ cc.w.resource.types += t
34
+ cc.w.version = version if release else info.devversion()
35
+ cc.w.description = info.config.tagline
36
+ cc.w.long_description = 'long_description()' if release else repr(None)
37
+ cc.w.url = url
38
+ cc.w.author = info.config.author if release else None
39
+ cc.w.author_email = info.config.author_email if release else None
40
+ for m in info.py_modules():
41
+ cc.w.py_modules += m
42
+ for r in info.allrequires():
43
+ cc.w.install_requires += r
44
+ for s in info.console_scripts():
45
+ cc.w.console_scripts += s
46
+ cc.w.universal = int({2, 3} <= set(info.config.pyversions))
45
47
  # XXX: Use soak to generate these?
46
- nametoquote = [
47
- ['setup.py', 'pystr'],
48
- ['setup.cfg', 'void'],
48
+ tasks = [
49
+ ['setup.py', 'setup-native.py.aridt' if info.config.native else 'setup.py.aridt', 'pystr'],
50
+ ['setup.cfg', 'setup.cfg.aridt', 'void'],
49
51
  ]
50
52
  seen = set()
51
53
  for name in allbuildrequires(info):
52
54
  if name not in seen:
53
55
  seen.add(name)
54
- config.printf("build requires += %s", name)
56
+ cc.w.build.requires += name
55
57
  if seen != {'setuptools', 'wheel'}:
56
- nametoquote.append(['pyproject.toml', 'tomlquote'])
57
- for name, quote in nametoquote:
58
- config.printf('" = $(%s)', quote)
59
- config.processtemplate(
60
- resource_filename(__name__, name + '.aridt'), # TODO LATER: Make aridity get the resource.
58
+ tasks.append(['pyproject.toml', 'pyproject.toml.aridt', 'tomlquote'])
59
+ for name, template, quote in tasks:
60
+ cc.printf('" = $(%s)', quote)
61
+ cc.processtemplate(
62
+ resource_filename(__name__, template), # TODO LATER: Make aridity get the resource.
61
63
  os.path.abspath(os.path.join(info.projectdir, name)))
62
64
 
63
65
  def allbuildrequires(info):
@@ -0,0 +1,27 @@
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)
27
+ native = false