dk-tasklib 3.0.6__tar.gz → 3.0.9__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 (70) hide show
  1. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/PKG-INFO +29 -7
  2. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/README.rst +15 -0
  3. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/PKG-INFO +29 -7
  4. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/SOURCES.txt +24 -1
  5. dk_tasklib-3.0.9/dk_tasklib.egg-info/entry_points.txt +2 -0
  6. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/requires.txt +0 -1
  7. dk_tasklib-3.0.9/dktasklib/_version.py +1 -0
  8. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/clean.py +0 -2
  9. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/commands.py +3 -6
  10. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/concat.py +0 -22
  11. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/docs.py +2 -5
  12. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/entry_points/__init__.py +0 -2
  13. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/entry_points/confbase.py +14 -14
  14. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/entry_points/dktasklibcmd.py +2 -4
  15. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/entry_points/pytemplate.py +4 -3
  16. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/entry_points/taskbase.py +2 -32
  17. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/environment.py +1 -1
  18. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/executables.py +3 -24
  19. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/help.py +0 -2
  20. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/jstools.py +2 -83
  21. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/lessc.py +0 -2
  22. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/manage.py +0 -9
  23. dk_tasklib-3.0.9/dktasklib/npm.py +19 -0
  24. dk_tasklib-3.0.9/dktasklib/package/__init__.py +31 -0
  25. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/package/package_interface.py +1 -5
  26. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/pset.py +3 -6
  27. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/publish.py +0 -8
  28. dk_tasklib-3.0.9/dktasklib/rule.py +65 -0
  29. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/runners.py +4 -9
  30. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/upversion.py +3 -11
  31. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/urlinliner.py +11 -14
  32. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/utils.py +14 -13
  33. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/version.py +3 -11
  34. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/watch.py +7 -11
  35. dk_tasklib-3.0.9/dktasklib/wintask.py +4 -0
  36. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/setup.cfg +0 -3
  37. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/setup.py +4 -6
  38. dk_tasklib-3.0.9/tests/test_clean.py +19 -0
  39. dk_tasklib-3.0.9/tests/test_commands_and_runners.py +115 -0
  40. dk_tasklib-3.0.9/tests/test_concat.py +58 -0
  41. dk_tasklib-3.0.9/tests/test_dktasklib_import.py +62 -0
  42. dk_tasklib-3.0.9/tests/test_docs_behavior.py +143 -0
  43. dk_tasklib-3.0.9/tests/test_entry_points_behavior.py +79 -0
  44. dk_tasklib-3.0.9/tests/test_executables.py +0 -0
  45. dk_tasklib-3.0.9/tests/test_executables_behavior.py +172 -0
  46. dk_tasklib-3.0.9/tests/test_help_behavior.py +13 -0
  47. dk_tasklib-3.0.9/tests/test_jstools_behavior.py +165 -0
  48. dk_tasklib-3.0.9/tests/test_lessc.py +116 -0
  49. dk_tasklib-3.0.9/tests/test_lessc_behavior.py +108 -0
  50. dk_tasklib-3.0.9/tests/test_manage_behavior.py +130 -0
  51. dk_tasklib-3.0.9/tests/test_packageinfo.py +17 -0
  52. dk_tasklib-3.0.9/tests/test_pset.py +108 -0
  53. dk_tasklib-3.0.9/tests/test_publish.py +49 -0
  54. dk_tasklib-3.0.9/tests/test_rule.py +27 -0
  55. dk_tasklib-3.0.9/tests/test_rule_and_watch.py +126 -0
  56. dk_tasklib-3.0.9/tests/test_taskbase_behavior.py +75 -0
  57. dk_tasklib-3.0.9/tests/test_upversion_behavior.py +100 -0
  58. dk_tasklib-3.0.9/tests/test_urlinliner_and_npm.py +82 -0
  59. dk_tasklib-3.0.9/tests/test_utils_behavior.py +121 -0
  60. dk_tasklib-3.0.9/tests/test_version.py +96 -0
  61. dk-tasklib-3.0.6/dk_tasklib.egg-info/entry_points.txt +0 -5
  62. dk-tasklib-3.0.6/dktasklib/_version.py +0 -1
  63. dk-tasklib-3.0.6/dktasklib/npm.py +0 -62
  64. dk-tasklib-3.0.6/dktasklib/package/__init__.py +0 -57
  65. dk-tasklib-3.0.6/dktasklib/rule.py +0 -90
  66. dk-tasklib-3.0.6/dktasklib/wintask.py +0 -35
  67. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/dependency_links.txt +0 -0
  68. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/not-zip-safe +0 -0
  69. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dk_tasklib.egg-info/top_level.txt +0 -0
  70. {dk-tasklib-3.0.6 → dk_tasklib-3.0.9}/dktasklib/__init__.py +0 -0
@@ -1,20 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dk-tasklib
3
- Version: 3.0.6
3
+ Version: 3.0.9
4
4
  Summary: dk-tasklib - pyinvoke task library
5
5
  Home-page: https://github.com/datakortet/dk-tasklib
6
6
  Author: Bjorn Pettersen
7
7
  Author-email: bp@datakortet.no
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
8
  Classifier: Development Status :: 3 - Alpha
11
9
  Classifier: Intended Audience :: Developers
12
10
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 2
14
- Classifier: Programming Language :: Python :: 2.7
15
11
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.5
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
17
15
  Classifier: Topic :: Software Development :: Libraries
16
+ Requires-Dist: invoke
17
+ Requires-Dist: PyYAML
18
+ Requires-Dist: dkfileutils>=1.4.2
19
+ Requires-Dist: yamldirs>=1.1.8
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: home-page
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
18
27
 
19
28
 
20
29
  .. image:: https://travis-ci.org/datakortet/dk-tasklib.svg?branch=master
@@ -54,3 +63,16 @@ to make local changes to the source code.
54
63
  See docs/ folder for documentation.
55
64
 
56
65
 
66
+ Development
67
+ -----------
68
+
69
+ Run the authoritative package checks from the repository root::
70
+
71
+ dk testpackage
72
+
73
+ The suite enforces branch-aware coverage of at least 83 percent. Build the
74
+ documentation with::
75
+
76
+ dk docs
77
+
78
+ The documentation is maintained against current Sphinx 8 and 9 releases.
@@ -34,3 +34,18 @@ to make local changes to the source code.
34
34
 
35
35
 
36
36
  See docs/ folder for documentation.
37
+
38
+
39
+ Development
40
+ -----------
41
+
42
+ Run the authoritative package checks from the repository root::
43
+
44
+ dk testpackage
45
+
46
+ The suite enforces branch-aware coverage of at least 83 percent. Build the
47
+ documentation with::
48
+
49
+ dk docs
50
+
51
+ The documentation is maintained against current Sphinx 8 and 9 releases.
@@ -1,20 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dk-tasklib
3
- Version: 3.0.6
3
+ Version: 3.0.9
4
4
  Summary: dk-tasklib - pyinvoke task library
5
5
  Home-page: https://github.com/datakortet/dk-tasklib
6
6
  Author: Bjorn Pettersen
7
7
  Author-email: bp@datakortet.no
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
8
  Classifier: Development Status :: 3 - Alpha
11
9
  Classifier: Intended Audience :: Developers
12
10
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 2
14
- Classifier: Programming Language :: Python :: 2.7
15
11
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.5
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
17
15
  Classifier: Topic :: Software Development :: Libraries
16
+ Requires-Dist: invoke
17
+ Requires-Dist: PyYAML
18
+ Requires-Dist: dkfileutils>=1.4.2
19
+ Requires-Dist: yamldirs>=1.1.8
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: home-page
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
18
27
 
19
28
 
20
29
  .. image:: https://travis-ci.org/datakortet/dk-tasklib.svg?branch=master
@@ -54,3 +63,16 @@ to make local changes to the source code.
54
63
  See docs/ folder for documentation.
55
64
 
56
65
 
66
+ Development
67
+ -----------
68
+
69
+ Run the authoritative package checks from the repository root::
70
+
71
+ dk testpackage
72
+
73
+ The suite enforces branch-aware coverage of at least 83 percent. Build the
74
+ documentation with::
75
+
76
+ dk docs
77
+
78
+ The documentation is maintained against current Sphinx 8 and 9 releases.
@@ -37,4 +37,27 @@ dktasklib/entry_points/dktasklibcmd.py
37
37
  dktasklib/entry_points/pytemplate.py
38
38
  dktasklib/entry_points/taskbase.py
39
39
  dktasklib/package/__init__.py
40
- dktasklib/package/package_interface.py
40
+ dktasklib/package/package_interface.py
41
+ tests/test_clean.py
42
+ tests/test_commands_and_runners.py
43
+ tests/test_concat.py
44
+ tests/test_dktasklib_import.py
45
+ tests/test_docs_behavior.py
46
+ tests/test_entry_points_behavior.py
47
+ tests/test_executables.py
48
+ tests/test_executables_behavior.py
49
+ tests/test_help_behavior.py
50
+ tests/test_jstools_behavior.py
51
+ tests/test_lessc.py
52
+ tests/test_lessc_behavior.py
53
+ tests/test_manage_behavior.py
54
+ tests/test_packageinfo.py
55
+ tests/test_pset.py
56
+ tests/test_publish.py
57
+ tests/test_rule.py
58
+ tests/test_rule_and_watch.py
59
+ tests/test_taskbase_behavior.py
60
+ tests/test_upversion_behavior.py
61
+ tests/test_urlinliner_and_npm.py
62
+ tests/test_utils_behavior.py
63
+ tests/test_version.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dk-tasklib = dktasklib.entry_points.dktasklibcmd:main
@@ -1,5 +1,4 @@
1
1
  invoke
2
2
  PyYAML
3
3
  dkfileutils>=1.4.2
4
- pathtools
5
4
  yamldirs>=1.1.8
@@ -0,0 +1 @@
1
+ __version__ = '3.0.9'
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  from dktasklib.wintask import task
3
2
 
4
3
 
@@ -6,5 +5,4 @@ from dktasklib.wintask import task
6
5
  def clean(ctx, directory):
7
6
  """Remove all contents from build subdirectory `directory`.
8
7
  """
9
- # ctx.run("rm -rf build/{directory}/*".format(directory=directory), shell=os.environ['COMSPEC'])
10
8
  ctx.run("rm -rf build/{directory}/*".format(directory=directory))
@@ -1,11 +1,9 @@
1
- # -*- coding: utf-8 -*-
2
1
  import os
3
2
  import re
4
3
  import invoke
5
4
 
6
5
  from .executables import exe
7
6
  from .utils import fmt
8
- from past.builtins import basestring
9
7
 
10
8
 
11
9
  default_command_policy = dict(
@@ -14,7 +12,7 @@ default_command_policy = dict(
14
12
  )
15
13
 
16
14
 
17
- class Command(object):
15
+ class Command:
18
16
  def __init__(self, name, argspec="",
19
17
  requirements=(),
20
18
  policy=default_command_policy,
@@ -46,7 +44,6 @@ class Command(object):
46
44
  def _kw_to_opts(self, kw):
47
45
  res = ""
48
46
  for k, v in kw.items():
49
- # print 'k,v,res:', k, v, `res`
50
47
  if k in self.params: # skip conversion of parameters to argspec
51
48
  continue
52
49
 
@@ -58,12 +55,12 @@ class Command(object):
58
55
  res += flag
59
56
  else:
60
57
  if self.policy['negative_bool'] == 'prefix':
61
- res += '--no' + flag
58
+ res += '--no-' + flag.lstrip('-')
62
59
 
63
60
  elif isinstance(v, (list, tuple)) and v:
64
61
  res += flag + '=' + self.policy['list_join'].join(str(item) for item in v)
65
62
 
66
- elif isinstance(v, basestring):
63
+ elif isinstance(v, str):
67
64
  res += flag + '="%s"' % v
68
65
 
69
66
  else:
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
- from __future__ import print_function
3
1
  import os
4
2
  import sys
5
3
 
@@ -43,8 +41,6 @@ def fix_line_endings(fname, eol=b'\n'):
43
41
  def copy(ctx, source, dest, force=False):
44
42
  """Copy ``source`` to ``dest``, which can be a file or directory.
45
43
  """
46
- # print "COPY:", locals()
47
- # print "COPY:", ctx.force, ctx.verbose
48
44
  if source == dest:
49
45
  return dest
50
46
 
@@ -54,7 +50,6 @@ def copy(ctx, source, dest, force=False):
54
50
  if sys.platform == 'win32':
55
51
  if force:
56
52
  flags += " /Y"
57
- # print 'copy {flags} {source} {dest}'.format(**locals())
58
53
  ctx.run('copy {flags} {source} {dest}'.format(**locals()))
59
54
  else: # pragma: nocover
60
55
  if force:
@@ -76,23 +71,6 @@ def concat(ctx, dest, *sources, **kw):
76
71
  out.writelines(inp.readlines())
77
72
  out.write('\n')
78
73
 
79
- # flags = ""
80
- # if sys.platform == 'win32':
81
- # if force:
82
- # flags += " /Y"
83
- # source = '+'.join(sources)
84
- # source = source.replace('/', '\\')
85
- # ctx.run('copy {flags} {source} {dest}'.format(**locals()))
86
- # else: # pragma: nocover
87
- # if force:
88
- # pass
89
- # # flags += " --force"
90
- # source = ' '.join(sources)
91
- # # print 'cat {flags} {source} > {dest}'.format(**locals())
92
- # ctx.run('cat {flags} {source} > {dest}'.format(**locals()))
93
-
94
74
  fix_line_endings(dest)
95
- # if len(line_endings(dest)) > 1:
96
- # fix_line_endings(dest)
97
75
 
98
76
  return dest
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
- from __future__ import print_function
3
1
  import datetime
4
2
  import os
5
3
  import sys
@@ -96,7 +94,7 @@ def create_docs_directory(ctx, force=False):
96
94
  ctx.pkg.docs.makedirs('_templates')
97
95
  confbase = DIRNAME / 'entry_points/confbase.py'
98
96
  txt = confbase.read('rb')
99
- txt = txt.replace('\r\n', '\n')
97
+ txt = txt.replace(b'\r\n', b'\n')
100
98
  t = PyTemplate(txt)
101
99
 
102
100
  (ctx.pkg.docs / 'conf.py').write(t.substitute(
@@ -117,7 +115,7 @@ def create_index(ctx, force=False):
117
115
  sys.exit(1)
118
116
  confbase = DIRNAME / 'entry_points/index.rst'
119
117
  txt = confbase.read('rb')
120
- txt = txt.replace('\r\n', '\n')
118
+ txt = txt.replace(b'\r\n', b'\n')
121
119
  t = PyTemplate(txt)
122
120
 
123
121
  index.write(t.substitute(
@@ -173,7 +171,6 @@ def build(ctx, clean=False, browse=False, warn=False,
173
171
  """
174
172
  Build the project's Sphinx docs.
175
173
  """
176
- # import pdb;pdb.set_trace()
177
174
  if not force and not changed(ctx.pkg.docs):
178
175
  print("""
179
176
  No changes detected in {}, add --force to build docs anyway.
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """
4
2
  """
5
3
 
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
1
  # Configuration file for the Sphinx documentation builder.
4
2
  #
5
3
  # This file does only contain a selection of the most common options. For a
@@ -19,14 +17,14 @@ sys.path.insert(0, os.path.abspath('..'))
19
17
 
20
18
  # -- Project information -----------------------------------------------------
21
19
 
22
- project = u'##{PACKAGE}'
23
- copyright = u'##{YEAR}, ##{AUTHOR}'
24
- author = u'##{AUTHOR}'
20
+ project = '##{PACKAGE}'
21
+ copyright = '##{YEAR}, ##{AUTHOR}'
22
+ author = '##{AUTHOR}'
25
23
 
26
24
  # The short X.Y version
27
- version = u'##{VERSION}'
25
+ version = '##{VERSION}'
28
26
  # The full version, including alpha/beta/rc tags
29
- release = u'##{VERSION}'
27
+ release = '##{VERSION}'
30
28
 
31
29
 
32
30
  # -- General configuration ---------------------------------------------------
@@ -62,12 +60,12 @@ master_doc = 'index'
62
60
  #
63
61
  # This is also used if you do content translation via gettext catalogs.
64
62
  # Usually you set "language" from the command line for these cases.
65
- language = u'en'
63
+ language = 'en'
66
64
 
67
65
  # List of patterns, relative to source directory, that match files and
68
66
  # directories to ignore when looking for source files.
69
67
  # This pattern also affects html_static_path and html_extra_path .
70
- exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
68
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
71
69
 
72
70
  # The name of the Pygments (syntax highlighting) style to use.
73
71
  pygments_style = 'sphinx'
@@ -132,8 +130,8 @@ latex_elements = {
132
130
  # (source start file, target name, title,
133
131
  # author, documentclass [howto, manual, or own class]).
134
132
  latex_documents = [
135
- (master_doc, '##{PACKAGE}.tex', u'##{PACKAGE} Documentation',
136
- u'##{AUTHOR}', 'manual'),
133
+ (master_doc, '##{PACKAGE}.tex', '##{PACKAGE} Documentation',
134
+ '##{AUTHOR}', 'manual'),
137
135
  ]
138
136
 
139
137
 
@@ -142,7 +140,7 @@ latex_documents = [
142
140
  # One entry per manual page. List of tuples
143
141
  # (source start file, name, description, authors, manual section).
144
142
  man_pages = [
145
- (master_doc, '##{PACKAGE}', u'##{PACKAGE} Documentation',
143
+ (master_doc, '##{PACKAGE}', '##{PACKAGE} Documentation',
146
144
  [author], 1)
147
145
  ]
148
146
 
@@ -153,7 +151,7 @@ man_pages = [
153
151
  # (source start file, target name, title, author,
154
152
  # dir menu entry, description, category)
155
153
  texinfo_documents = [
156
- (master_doc, '##{PACKAGE}', u'##{PACKAGE} Documentation',
154
+ (master_doc, '##{PACKAGE}', '##{PACKAGE} Documentation',
157
155
  author, '##{PACKAGE}', 'One line description of project.',
158
156
  'Miscellaneous'),
159
157
  ]
@@ -164,7 +162,9 @@ texinfo_documents = [
164
162
  # -- Options for intersphinx extension ---------------------------------------
165
163
 
166
164
  # Example configuration for intersphinx: refer to the Python standard library.
167
- intersphinx_mapping = {'https://docs.python.org/': None}
165
+ intersphinx_mapping = {
166
+ 'python': ('https://docs.python.org/3', None),
167
+ }
168
168
 
169
169
  # -- Options for todo extension ----------------------------------------------
170
170
 
@@ -1,8 +1,5 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Commands installed by setup.py
4
2
  """
5
- from __future__ import print_function
6
3
  # pragma: nocover
7
4
  import argparse
8
5
  import datetime
@@ -49,6 +46,7 @@ def create_docs_cmd(args):
49
46
  txt = txt.replace(b'\r\n', b'\n')
50
47
  t = PyTemplate(txt)
51
48
 
49
+ docsdir.makedirs()
52
50
  (docsdir / 'conf.py').write(t.substitute(
53
51
  VERSION=run('python setup.py --version'),
54
52
  PACKAGE=run('python setup.py --name'),
@@ -64,7 +62,7 @@ def add_django_to_docs_conf():
64
62
  print("./docs/conf.py already contains django.setup()")
65
63
  return
66
64
 
67
- src = conf_file.read('rT')
65
+ src = conf_file.read('r')
68
66
  pre, post = src.split('\n\n', 1)
69
67
  conf_file.write(
70
68
  pre + "\n\n" +
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  from string import Template
3
2
 
4
3
 
@@ -7,9 +6,11 @@ class PyTemplate(Template):
7
6
  Template strings that can replace ##{PATTERN} instances.
8
7
  """
9
8
  def __init__(self, t):
10
- super(PyTemplate, self).__init__(t.replace(b'$', b'$$').replace(b'##{', b'${'))
9
+ if isinstance(t, bytes):
10
+ t = t.decode('u8')
11
+ super().__init__(t.replace('$', '$$').replace('##{', '${'))
11
12
 
12
13
  def substitute(self, *args, **kw):
13
- return super(PyTemplate, self).substitute(
14
+ return super().substitute(
14
15
  **{k.upper(): v for k, v in kw.items()}
15
16
  )
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  """
3
2
  Base version of package/tasks.py, created by version ##{VERSION} of
4
3
 
@@ -25,7 +24,6 @@ will fit your use case.
25
24
 
26
25
  """
27
26
  # pragma: nocover
28
- from __future__ import print_function
29
27
  import os
30
28
  import warnings
31
29
 
@@ -35,7 +33,6 @@ from dktasklib.wintask import task
35
33
  from invoke import Collection
36
34
 
37
35
  from dktasklib import docs as doctools
38
- from dktasklib import jstools
39
36
  from dktasklib import lessc
40
37
  from dktasklib import version, upversion
41
38
  from dktasklib.manage import collectstatic
@@ -58,12 +55,6 @@ DJANGO_SETTINGS_MODULE = ''
58
55
  # there should be a mypkg/mypkg/less/mypkg.less file that imports any other
59
56
  # needed sources
60
57
 
61
- # .jsx (es6 source)
62
- # ------------------
63
- # list any .jsx files here. Only filename.jsx (don't include the path).
64
- # The files should reside in mypkg/mypkg/js/ directory.
65
- JSX_FILENAMES = []
66
-
67
58
  # ============================================================================
68
59
  # autodoc is in a separate process, so can't use settings.configure().
69
60
  HAVE_SETTINGS = bool(DJANGO_SETTINGS_MODULE)
@@ -76,23 +67,10 @@ WARN_ABOUT_SETTINGS = not bool(DJANGO_SETTINGS_MODULE)
76
67
 
77
68
 
78
69
  @task
79
- def build_js(ctx, force=False):
80
- """Build all javascript files.
81
- """
82
- for fname in JSX_FILENAMES:
83
- jstools.babel(
84
- ctx,
85
- '{pkg.source_js}/' + fname,
86
- '{pkg.django_static}/{pkg.name}/js/' + fname + '.js',
87
- force=force
88
- )
89
-
90
-
91
- @task
92
- def build(ctx, less=False, docs=False, js=False, force=False):
70
+ def build(ctx, less=False, docs=False, force=False):
93
71
  """Build everything and collectstatic.
94
72
  """
95
- specified = any([less, docs, js])
73
+ specified = any([less, docs])
96
74
  buildall = not specified
97
75
 
98
76
  if buildall or less:
@@ -118,9 +96,6 @@ def build(ctx, less=False, docs=False, js=False, force=False):
118
96
  )
119
97
  doctools.build(ctx, force=force)
120
98
 
121
- if buildall or js:
122
- build_js(ctx, force)
123
-
124
99
  if HAVE_SETTINGS and (force or changed(ctx.pkg.django_static)):
125
100
  collectstatic(ctx, DJANGO_SETTINGS_MODULE, force=force)
126
101
 
@@ -134,10 +109,6 @@ def watch(ctx):
134
109
  path='{pkg.source_less}', ext='.less',
135
110
  action=lambda e: build(ctx, less=True)
136
111
  )
137
- watcher.watch_directory(
138
- path='{pkg.source_js}', ext='.jsx',
139
- action=lambda e: build(ctx, js=True)
140
- )
141
112
  watcher.watch_directory(
142
113
  path='{pkg.docs}', ext='.rst',
143
114
  action=lambda e: build(ctx, docs=True)
@@ -149,7 +120,6 @@ def watch(ctx):
149
120
  ns = Collection(
150
121
  build,
151
122
  watch,
152
- build_js,
153
123
  lessc,
154
124
  doctools,
155
125
  version, upversion,
@@ -3,7 +3,7 @@ Global state.
3
3
  """
4
4
 
5
5
 
6
- class Environment(object):
6
+ class Environment:
7
7
  def __call__(self, ctx):
8
8
  return ctx
9
9
 
@@ -1,4 +1,3 @@
1
- # from functools import wraps
2
1
  import sys
3
2
  import warnings
4
3
 
@@ -16,7 +15,7 @@ class MissingCommand(Exception):
16
15
 
17
16
 
18
17
  # noinspection PyShadowingNames
19
- class Executables(object):
18
+ class Executables:
20
19
  """Class for finding executables on the host system.
21
20
  """
22
21
  def __init__(self):
@@ -80,11 +79,10 @@ class Executables(object):
80
79
  pip = get_executable('pip')
81
80
  cmd = pip + ' install wheel[signatures]'
82
81
  if win32:
83
- # self.ctx.run(cmd, echo=True)
84
82
  runners.run(cmd)
85
- wheel = get_executable(exename)
83
+ exepath = get_executable(exename)
86
84
  # generate signing key if downloading wheel
87
- runners.run(wheel + ' keygen')
85
+ runners.run(exepath + ' keygen')
88
86
  else:
89
87
  raise MissingCommand("Missing wheel (%s)" % cmd)
90
88
  print('Your ~/.pypirc file should have a [pypi] section instead of a [server-login] section')
@@ -97,7 +95,6 @@ class Executables(object):
97
95
  pip = get_executable('pip')
98
96
  cmd = pip + ' install twine'
99
97
  if win32:
100
- # self.ctx.run(cmd, echo=True)
101
98
  runners.run(cmd)
102
99
  exepath = get_executable(exename)
103
100
  else:
@@ -123,7 +120,6 @@ class Executables(object):
123
120
  npminstall = "npm install -g browserify --no-color"
124
121
  if not exepath:
125
122
  if win32:
126
- # self.ctx.run(npminstall, echo=False, encoding="utf-8")
127
123
  self.ctx.run(npminstall, echo=True, encoding="utf-8")
128
124
  exepath = get_executable(exename)
129
125
  else:
@@ -154,18 +150,6 @@ class Executables(object):
154
150
  raise MissingCommand("Missing babel (%s)" % npminstall)
155
151
  return exepath
156
152
 
157
- # def find_babel(self):
158
- # exename = 'babel'
159
- # exepath = get_executable(exename)
160
- # npminstall = "npm install -g babel --no-color"
161
- # if not exepath:
162
- # if win32:
163
- # self.ctx.run(npminstall, echo=False, encoding="utf-8")
164
- # exepath = get_executable(exename)
165
- # else:
166
- # raise MissingCommand("Missing babel (%s)" % npminstall)
167
- # return exepath
168
-
169
153
  def find_nodejs(self): # pragma: nocover
170
154
  """Find :program:`node`.
171
155
  """
@@ -213,9 +197,4 @@ def requires(*deps):
213
197
  except MissingCommand as e:
214
198
  warnings.warn(str(e))
215
199
  return fn
216
- # @wraps(fn)
217
- # def _inner(*args, **kwargs):
218
- # exe.require(*deps)
219
- # return fn(*args, **kwargs)
220
- # return _inner
221
200
  return _wrapper
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  from dktasklib.wintask import task
4
2
 
5
3