pyven 92__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.
Files changed (58) hide show
  1. pyven-92/README.md → pyven-93/PKG-INFO +12 -17
  2. pyven-92/PKG-INFO → pyven-93/README.md +0 -30
  3. {pyven-92 → pyven-93}/pyven/README.md.aridt +0 -17
  4. pyven-93/pyven/__init__.py +1 -0
  5. {pyven-92 → pyven-93}/pyven/bdist.py +0 -17
  6. {pyven-92 → pyven-93}/pyven/checks.py +10 -20
  7. {pyven-92 → pyven-93}/pyven/cythonize.py +0 -17
  8. pyven-93/pyven/divcheck.py +17 -0
  9. pyven-93/pyven/drmake.py +11 -0
  10. {pyven-92 → pyven-93}/pyven/execcheck.py +0 -17
  11. {pyven-92 → pyven-93}/pyven/files.py +0 -17
  12. pyven-93/pyven/functions.py +6 -0
  13. {pyven-92 → pyven-93}/pyven/gclean.py +0 -17
  14. {pyven-92 → pyven-93}/pyven/launch.py +0 -17
  15. {pyven-92 → pyven-93}/pyven/licheck.py +14 -23
  16. {pyven-92 → pyven-93}/pyven/mainmodules.py +0 -17
  17. pyven-93/pyven/minreqs.py +10 -0
  18. pyven-93/pyven/nlcheck.py +11 -0
  19. pyven-93/pyven/patchpolicy.py +21 -0
  20. {pyven-92 → pyven-93}/pyven/pipify.py +2 -20
  21. pyven-93/pyven/projectinfo.arid +26 -0
  22. {pyven-92 → pyven-93}/pyven/projectinfo.py +18 -30
  23. pyven-93/pyven/release.arid +7 -0
  24. {pyven-92 → pyven-93}/pyven/release.py +3 -18
  25. {pyven-92 → pyven-93}/pyven/setup.py.aridt +1 -19
  26. pyven-93/pyven/setuptools.arid +2 -0
  27. {pyven-92 → pyven-93}/pyven/sourceinfo.py +0 -17
  28. {pyven-92 → pyven-93}/pyven/tasks.py +0 -17
  29. pyven-93/pyven/tests/__init__.py +5 -0
  30. {pyven-92 → pyven-93}/pyven/tryinstall.py +0 -17
  31. {pyven-92 → pyven-93}/pyven/util.py +0 -17
  32. {pyven-92 → pyven-93}/pyven.egg-info/PKG-INFO +3 -21
  33. {pyven-92 → pyven-93}/pyven.egg-info/SOURCES.txt +2 -8
  34. {pyven-92 → pyven-93}/pyven.egg-info/requires.txt +1 -1
  35. {pyven-92 → pyven-93}/setup.py +4 -56
  36. pyven-92/COPYING +0 -674
  37. pyven-92/foreignsyms +0 -3
  38. pyven-92/pyven/__init__.py +0 -18
  39. pyven-92/pyven/divcheck.py +0 -34
  40. pyven-92/pyven/drmake.py +0 -28
  41. pyven-92/pyven/minreqs.py +0 -27
  42. pyven-92/pyven/nlcheck.py +0 -28
  43. pyven-92/pyven/patchpolicy.py +0 -38
  44. pyven-92/pyven/projectinfo.arid +0 -38
  45. pyven-92/pyven/release.arid +0 -24
  46. pyven-92/pyven/setuproot/Cython/Build.py +0 -19
  47. pyven-92/pyven/setuproot/Cython/__init__.py +0 -17
  48. pyven-92/pyven/setuproot/__init__.py +0 -45
  49. pyven-92/pyven/setuproot/ez_setup.py +0 -19
  50. pyven-92/pyven/setuproot/fakesetup.py +0 -60
  51. pyven-92/pyven/setuproot/setuptools.arid +0 -19
  52. pyven-92/pyven/tests/__init__.py +0 -22
  53. {pyven-92 → pyven-93}/pyven/pyproject.toml.aridt +0 -0
  54. {pyven-92 → pyven-93}/pyven/setup.cfg.aridt +0 -0
  55. {pyven-92 → pyven-93}/pyven.egg-info/dependency_links.txt +0 -0
  56. {pyven-92 → pyven-93}/pyven.egg-info/entry_points.txt +0 -0
  57. {pyven-92 → pyven-93}/pyven.egg-info/top_level.txt +0 -0
  58. {pyven-92 → 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: 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
 
@@ -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.
@@ -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,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
- description, url = info.descriptionandurl() if release and info.config.github.participant else [None, None]
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 = description)
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)
@@ -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 . import mainmodules
19
2
  from .files import Files
20
- from .setuproot import setuptoolsinfo
21
3
  from .util import Path
22
4
  from aridity.config import ConfigCtrl
5
+ from aridity.model import Entry, Resource
23
6
  from aridity.util import openresource
24
7
  from inspect import getsource
25
8
  from pkg_resources import parse_requirements
26
9
  from pkg_resources.extern.packaging.markers import UndefinedEnvironmentName
27
- from venvpool import executablebits, ParsedRequires, TemporaryDirectory
10
+ from setuphacks import getsetupkwargs
11
+ from venvpool import ParsedRequires, TemporaryDirectory
28
12
  import logging, os, re, subprocess, venvpool
29
13
 
30
14
  log = logging.getLogger(__name__)
@@ -139,15 +123,14 @@ class ProjectInfo:
139
123
  return setuptoolsinfo(setuppath)
140
124
  log.info('Use uninstallable mode.')
141
125
  projectdir = os.path.dirname(Path.seek(realdir, '.git'))
142
- with openresource(__name__, 'setuproot/setuptools.arid') as f:
126
+ with openresource(__name__, 'setuptools.arid') as f:
143
127
  info = cls(projectdir, f)
144
128
  info.config.name = os.path.basename(os.path.abspath(projectdir))
145
129
  return info
146
130
 
147
131
  def __init__(self, projectdir, infopathorstream):
148
132
  config = ConfigCtrl()
149
- with openresource(__name__, 'projectinfo.arid', 'utf-8') as f:
150
- config.load(f)
133
+ Resource(__name__, 'projectinfo.arid', 'utf-8').source(config.scope(), Entry([]))
151
134
  config.load(infopathorstream)
152
135
  self.config = config.node
153
136
  self.projectdir = projectdir
@@ -182,7 +165,7 @@ class ProjectInfo:
182
165
 
183
166
  def descriptionandurl(self):
184
167
  import urllib.error, urllib.request, json, time
185
- urlpath = "combatopera/%s" % self.config.name # TODO: Make configurable.
168
+ urlpath = "%s/%s" % (self.config.github.account, self.config.name)
186
169
  while True:
187
170
  try:
188
171
  with urllib.request.urlopen("https://api.github.com/repos/%s" % urlpath) as f:
@@ -197,13 +180,6 @@ class ProjectInfo:
197
180
  suffix = '.py'
198
181
  return [name[:-len(suffix)] for name in os.listdir(self.projectdir) if name.endswith(suffix) and 'setup.py' != name and not name.startswith('test_')]
199
182
 
200
- def scripts(self):
201
- if not self.config.executable:
202
- return []
203
- def isscript(path):
204
- return os.stat(path).st_mode & executablebits and not os.path.isdir(path)
205
- return [name for name in os.listdir(self.projectdir) if isscript(os.path.join(self.projectdir, name))]
206
-
207
183
  def mainmodules(self):
208
184
  paths = list(Files.relpaths(self.projectdir, [mainmodules.extension], []))
209
185
  with TemporaryDirectory() as tempdir:
@@ -227,3 +203,15 @@ class MainModule:
227
203
  def __init__(self, d):
228
204
  for k, v in d.items():
229
205
  setattr(self, k, v)
206
+
207
+ def setuptoolsinfo(setuppath):
208
+ with openresource(__name__, 'setuptools.arid') as f:
209
+ info = ProjectInfo(os.path.dirname(setuppath), f)
210
+ setupkwargs = getsetupkwargs(setuppath, ['name', 'install_requires', 'entry_points'])
211
+ if 'name' in setupkwargs:
212
+ info.config.name = setupkwargs['name']
213
+ for r in setupkwargs.get('install_requires', []):
214
+ (-info.config).printf("requires += %s", r)
215
+ console_scripts = setupkwargs.get('entry_points', {}).get('console_scripts')
216
+ info.console_scripts = lambda: console_scripts
217
+ return info
@@ -0,0 +1,7 @@
1
+ account = $(void)
2
+ cli
3
+ path = $(void)
4
+ upload = $(void)
5
+ path = $(cli path)
6
+ token = $gpg$(token_gpg $(account))
7
+ upload = $(cli upload)