Repository: spack/spack

Issue:
SCons download url 404
Summary

Fetching scons-2.5.1 fails as the PyPi download url returns a 404 error.
Other packages from PyPi seem to work.
This is only in the 0.11.x versions, previous versions used a sourceforge link.

### Expected Result

Spack to download and build SCons as a dependency to another package

### Actual Result

The following error:
```
==> Fetching https://pypi.io/packages/source/s/scons/scons-2.5.1.tar.gz
######################################################################## 100.0%
curl: (22) The requested URL returned error: 404 Not Found
==> Fetching from https://pypi.io/packages/source/s/scons/scons-2.5.1.tar.gz failed.
==> Error: FetchError: All fetchers failed for scons-2.5.1-nozqwus7rirav57cibr7b4fksjivsevg
FetchError: FetchError: All fetchers failed for scons-2.5.1-nozqwus7rirav57cibr7b4fksjivsevg

/usr/local/spack/lib/spack/spack/package.py:1025, in do_fetch:
     25                                     self.spec.format('$_$@'), ck_msg)
     26    
     27            self.stage.create()
  >> 28            self.stage.fetch(mirror_only)
     29            self._fetch_time = time.time() - start_time
     30    
     31            if spack.do_checksum and self.version in self.versions:

```

### Steps to reproduce the issue

```console
$ spack install scons
```

### Information on your system

 1. Platform: CentOS 7 Singularity container
 2. GNU toolchain used

Curling [https://pypi.io/simple/scons](https://pypi.io/simple/scons) fetches the list with the working download urls, for 2.5.1 it's:
[https://pypi.python.org/packages/2c/ee/a9601b958c94e93410e635a5d67ed95300998ffdc36127b16d322b054ff0/scons-2.5.1.tar.gz#md5=3eac81e5e8206304a9b4683c57665aa4](https://pypi.python.org/packages/2c/ee/a9601b958c94e93410e635a5d67ed95300998ffdc36127b16d322b054ff0/scons-2.5.1.tar.gz#md5=3eac81e5e8206304a9b4683c57665aa4)


Discussion:
I had no idea https://pypi.org/simple existed, this is a great discovery! I'll fix the scons package.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/scons/package.py b/var/spack/repos/builtin/packages/scons/package.py
--- a/var/spack/repos/builtin/packages/scons/package.py
+++ b/var/spack/repos/builtin/packages/scons/package.py
@@ -29,10 +29,14 @@ class Scons(PythonPackage):
     """SCons is a software construction tool"""
 
     homepage = "http://scons.org"
-    url      = "https://pypi.io/packages/source/s/scons/scons-2.5.1.tar.gz"
+    url      = "https://pypi.io/packages/source/s/scons/scons-3.0.1.tar.gz"
 
-    version('2.5.1', '3eac81e5e8206304a9b4683c57665aa4')
-    version('2.5.0', 'bda5530a70a41a7831d83c8b191c021e')
+    version('3.0.1', 'b6a292e251b34b82c203b56cfa3968b3',
+            url="https://pypi.python.org/packages/c1/0a/520a3c86ce5cff36e81af5e91d4dcd741ebc189c2f0f42d54cc12a8a7519/scons-3.0.1.tar.gz")
+    version('2.5.1', '3eac81e5e8206304a9b4683c57665aa4',
+            url="https://pypi.python.org/packages/2c/ee/a9601b958c94e93410e635a5d67ed95300998ffdc36127b16d322b054ff0/scons-2.5.1.tar.gz")
+    version('2.5.0', 'bda5530a70a41a7831d83c8b191c021e',
+            url="https://pypi.python.org/packages/17/f0/60464796a3fd16899a2cf54e22615c38bbe8124386cf3763c17ff367c2af/scons-2.5.0.tar.gz")
 
-    # Python 3 is not supported
-    depends_on('python@:2.8', type=('build', 'run'))
+    # Python 3 support was added in SCons 3.0.0
+    depends_on('python@:2', when='@:2', type=('build', 'run'))


Test patch: