Repository: spack/spack

Issue:
is spack create broken?
Currently on a fresh clone of develop branch (commit 7b2470236ea046baffc66af567beba29e1e280ce)
getting the following when I try to create a python package:
```
$ spack -d create https://pypi.io/packages/source/P/PyJWT/PyJWT-1.7.1.tar.gz
==> [2019-08-22-15:47:19.578845] Imported create from built-in commands
==> [2019-08-22-15:47:19.581250] Imported create from built-in commands
==> [2019-08-22-15:47:19.779743] Reading config file /disk/home/sinan/Downloads/spack/etc/spack/defaults/modules.yaml
==> [2019-08-22-15:47:19.797824] Reading config file /disk/home/sinan/Downloads/spack/etc/spack/defaults/linux/modules.yaml
==> [2019-08-22-15:47:19.802880] Reading config file /disk/home/sinan/Downloads/spack/etc/spack/defaults/config.yaml
==> [2019-08-22-15:47:19.841457] This looks like a URL for PyJWT
==> [2019-08-22-15:47:19.842703] Warning: Spack will not check SSL certificates. You need to update your Python to enable certificate verification.
==> [2019-08-22-15:47:19.915762] HTTPError: HTTP Error 404: Not Found
==> [2019-08-22-15:47:19.917359] Warning: Spack will not check SSL certificates. You need to update your Python to enable certificate verification.
==> [2019-08-22-15:47:20.027930] HTTPError: HTTP Error 404: Not Found
==> [2019-08-22-15:47:20.043323] Found 1 version of pyjwt:
  
  1.7.1  https://pypi.io/packages/source/P/PyJWT/PyJWT-1.7.1.tar.gz

==> [2019-08-22-15:47:20.043999] How many would you like to checksum? (default is 1, q to abort) 
==> [2019-08-22-15:47:22.017241] Downloading...
==> [2019-08-22-15:47:22.021265] WRITE LOCK: /cache/spack-stage/sinan/.lock[2324237983255820602:1] [Acquiring]
==> [2019-08-22-15:47:22.021765] WRITE LOCK: /cache/spack-stage/sinan/.lock[2324237983255820602:1] [Acquired]
==> [2019-08-22-15:47:22.022706] Fetching https://pypi.io/packages/source/P/PyJWT/PyJWT-1.7.1.tar.gz
==> [2019-08-22-15:47:22.025637] '/usr/bin/curl' '-C' '-' '-o' '/cache/spack-stage/sinan/spack-stage-1RRl5T/PyJWT-1.7.1.tar.gz.part' '-f' '-D' '-' '-L' 'https://pypi.io/packages/source/P/PyJWT/PyJWT-1.7.1.tar.gz' '-#'
######################################################################## 100.0%
==> [2019-08-22-15:47:22.314185] '/usr/bin/tar' '--exclude=*/*/*' '-tf' '/cache/spack-stage/sinan/spack-stage-1RRl5T/PyJWT-1.7.1.tar.gz'
==> [2019-08-22-15:47:22.320293] WRITE LOCK: /cache/spack-stage/sinan/.lock[2324237983255820602:1] [Released]
==> [2019-08-22-15:47:22.320423] Checksummed 1 version of pyjwt
==> [2019-08-22-15:47:22.320472] This package looks like it uses the python build system
Traceback (most recent call last):
  File "/disk/home/sinan/Downloads/spack/bin/spack", line 48, in <module>
    sys.exit(spack.main.main())
  File "/disk/home/sinan/Downloads/spack/lib/spack/spack/main.py", line 697, in main
    return _invoke_command(command, parser, args, unknown)
  File "/disk/home/sinan/Downloads/spack/lib/spack/spack/main.py", line 447, in _invoke_command
    return_val = command(parser, args)
  File "/disk/home/sinan/Downloads/spack/lib/spack/spack/cmd/create.py", line 719, in create
    package = package_class(**constr_args)
TypeError: __init__() got an unexpected keyword argument 'url'
```
* centos7.6
* Linux ws-067 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux



Discussion:

Resolving patch:
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -251,14 +251,14 @@ def build_args(self, spec, prefix):
         args = []
         return args"""
 
-    def __init__(self, name, *args):
+    def __init__(self, name, *args, **kwargs):
         # If the user provided `--name py-numpy`, don't rename it py-py-numpy
         if not name.startswith('py-'):
             # Make it more obvious that we are renaming the package
             tty.msg("Changing package name from {0} to py-{0}".format(name))
             name = 'py-{0}'.format(name)
 
-        super(PythonPackageTemplate, self).__init__(name, *args)
+        super(PythonPackageTemplate, self).__init__(name, *args, **kwargs)
 
 
 class RPackageTemplate(PackageTemplate):
@@ -276,14 +276,14 @@ def configure_args(self, spec, prefix):
         args = []
         return args"""
 
-    def __init__(self, name, *args):
+    def __init__(self, name, *args, **kwargs):
         # If the user provided `--name r-rcpp`, don't rename it r-r-rcpp
         if not name.startswith('r-'):
             # Make it more obvious that we are renaming the package
             tty.msg("Changing package name from {0} to r-{0}".format(name))
             name = 'r-{0}'.format(name)
 
-        super(RPackageTemplate, self).__init__(name, *args)
+        super(RPackageTemplate, self).__init__(name, *args, **kwargs)
 
 
 class PerlmakePackageTemplate(PackageTemplate):
@@ -302,14 +302,14 @@ def configure_args(self):
         args = []
         return args"""
 
-    def __init__(self, name, *args):
+    def __init__(self, name, *args, **kwargs):
         # If the user provided `--name perl-cpp`, don't rename it perl-perl-cpp
         if not name.startswith('perl-'):
             # Make it more obvious that we are renaming the package
             tty.msg("Changing package name from {0} to perl-{0}".format(name))
             name = 'perl-{0}'.format(name)
 
-        super(PerlmakePackageTemplate, self).__init__(name, *args)
+        super(PerlmakePackageTemplate, self).__init__(name, *args, **kwargs)
 
 
 class PerlbuildPackageTemplate(PerlmakePackageTemplate):
@@ -333,7 +333,7 @@ class OctavePackageTemplate(PackageTemplate):
     # FIXME: Add additional dependencies if required.
     # depends_on('octave-foo', type=('build', 'run'))"""
 
-    def __init__(self, name, *args):
+    def __init__(self, name, *args, **kwargs):
         # If the user provided `--name octave-splines`, don't rename it
         # octave-octave-splines
         if not name.startswith('octave-'):
@@ -341,7 +341,7 @@ def __init__(self, name, *args):
             tty.msg("Changing package name from {0} to octave-{0}".format(name))  # noqa
             name = 'octave-{0}'.format(name)
 
-        super(OctavePackageTemplate, self).__init__(name, *args)
+        super(OctavePackageTemplate, self).__init__(name, *args, **kwargs)
 
 
 class MakefilePackageTemplate(PackageTemplate):
@@ -378,14 +378,14 @@ def configure_args(self, spec, prefix):
         args = []
         return args"""
 
-    def __init__(self, name, *args):
+    def __init__(self, name, *args, **kwargs):
         # If the user provided `--name py-pyqt4`, don't rename it py-py-pyqt4
         if not name.startswith('py-'):
             # Make it more obvious that we are renaming the package
             tty.msg("Changing package name from {0} to py-{0}".format(name))
             name = 'py-{0}'.format(name)
 
-        super(SIPPackageTemplate, self).__init__(name, *args)
+        super(SIPPackageTemplate, self).__init__(name, *args, **kwargs)
 
 
 templates = {


Test patch: