Standardize package names: lower-case, not Mixed_CASE (#2475)

* Rename packages

* Upcasing depends_on() in packages.

* Downcased extends('r')

* Fixed erroneously changed URL that had slipped through.

* Fixed typo

* Fixed link from documentation into package source code.

* Fixed another doc problem.

* Changed underscores to dashes in package names.

* Added test to enforce lowercase, no-underscore naming convention.

* Fix r-xgboost

* Downcase more instances of 'R' in package auto-creation.

* Fix test.

* Converted unit test packages to use dashes not underscores

* Downcase `r` in the docs.

* Update module_file_support.rst

Fix r->R for class R.
This commit is contained in:
Elizabeth Fischer
2017-01-04 21:24:07 -05:00
committed by Todd Gamblin
parent 4e653254c5
commit 3dd4a01a5e
205 changed files with 215 additions and 204 deletions

View File

@@ -353,9 +353,9 @@ and has similar effects on module file of dependees. Even in this case
``run_env`` must be filled with the desired list of environment modifications.
.. note::
The ``R`` package and callback APIs
The ``r`` package and callback APIs
A typical example in which overriding both methods prove to be useful
is given by the ``R`` package. This package installs libraries and headers
is given by the ``r`` package. This package installs libraries and headers
in non-standard locations and it is possible to prepend the appropriate directory
to the corresponding environment variables:
@@ -367,14 +367,14 @@ and has similar effects on module file of dependees. Even in this case
with the following snippet:
.. literalinclude:: ../../../var/spack/repos/builtin/packages/R/package.py
.. literalinclude:: ../../../var/spack/repos/builtin/packages/r/package.py
:pyobject: R.setup_environment
The ``R`` package also knows which environment variable should be modified
The ``r`` package also knows which environment variable should be modified
to make language extensions provided by other packages available, and modifies
it appropriately in the override of the second method:
.. literalinclude:: ../../../var/spack/repos/builtin/packages/R/package.py
.. literalinclude:: ../../../var/spack/repos/builtin/packages/r/package.py
:lines: 128-129,146-151
.. _modules-yaml:

View File

@@ -215,7 +215,7 @@ def __init__(self, name, *args):
class RGuess(DefaultGuess):
"""Provides appropriate overrides for R extensions"""
dependencies = """\
extends('R')
extends('r')
# FIXME: Add additional dependencies if required.
# depends_on('r-foo', type=nolink)"""
@@ -283,7 +283,7 @@ class BuildSystemGuesser(object):
'scons': SconsGuess,
'bazel': BazelGuess,
'python': PythonGuess,
'R': RGuess,
'r': RGuess,
'octave': OctaveGuess
}
@@ -306,7 +306,7 @@ def __call__(self, stage, url):
(r'/CMakeLists.txt$', 'cmake'),
(r'/SConstruct$', 'scons'),
(r'/setup.py$', 'python'),
(r'/NAMESPACE$', 'R'),
(r'/NAMESPACE$', 'r'),
(r'/WORKSPACE$', 'bazel')
]

View File

@@ -36,7 +36,7 @@
('CMakeLists.txt', 'cmake'),
('SConstruct', 'scons'),
('setup.py', 'python'),
('NAMESPACE', 'R'),
('NAMESPACE', 'r'),
('foobar', 'unknown')
]
)

View File

@@ -240,7 +240,7 @@ def test_virtual_is_fully_expanded_for_mpileaks(
assert 'mpi' in spec
def test_my_dep_depends_on_provider_of_my_virtual_dep(self):
spec = Spec('indirect_mpich')
spec = Spec('indirect-mpich')
spec.normalize()
spec.concretize()

View File

@@ -60,7 +60,7 @@ def fake_fetchify(url, pkg):
@pytest.mark.usefixtures('install_mockery')
def test_install_and_uninstall(mock_archive):
# Get a basic concrete spec for the trivial install package.
spec = Spec('trivial_install_test_package')
spec = Spec('trivial-install-test-package')
spec.concretize()
assert spec.concrete

View File

@@ -129,7 +129,7 @@ def test_hg_mirror(self, mock_hg_repository):
repos.clear()
def test_url_mirror(self, mock_archive):
set_up_package('trivial_install_test_package', mock_archive, 'url')
set_up_package('trivial-install-test-package', mock_archive, 'url')
check_mirror()
repos.clear()
@@ -143,6 +143,6 @@ def test_all_mirror(
set_up_package('git-test', mock_git_repository, 'git')
set_up_package('svn-test', mock_svn_repository, 'svn')
set_up_package('hg-test', mock_hg_repository, 'hg')
set_up_package('trivial_install_test_package', mock_archive, 'url')
set_up_package('trivial-install-test-package', mock_archive, 'url')
check_mirror()
repos.clear()

View File

@@ -26,6 +26,7 @@
This test does sanity checks on Spack's builtin package database.
"""
import unittest
import re
import spack
from spack.repository import RepoPath
@@ -57,3 +58,13 @@ def test_url_versions(self):
# If there is a url for the version check it.
v_url = pkg.url_for_version(v)
self.assertEqual(vattrs['url'], v_url)
def test_all_versions_are_lowercase(self):
"""Spack package names must be lowercase, and use `-` instead of `_`.
"""
errors = []
for name in spack.repo.all_package_names():
if re.search(r'[_A-Z]', name):
errors.append(name)
self.assertEqual([], errors)

View File

@@ -83,7 +83,7 @@ def test_import_package_as(builtin_mock):
def test_inheritance_of_diretives():
p = spack.repo.get('simple_inheritance')
p = spack.repo.get('simple-inheritance')
# Check dictionaries that should have been filled by directives
assert len(p.dependencies) == 3
@@ -93,14 +93,14 @@ def test_inheritance_of_diretives():
assert len(p.provided) == 2
# Check that Spec instantiation behaves as we expect
s = Spec('simple_inheritance')
s = Spec('simple-inheritance')
s.concretize()
assert '^cmake' in s
assert '^openblas' in s
assert '+openblas' in s
assert 'mpi' in s
s = Spec('simple_inheritance~openblas')
s = Spec('simple-inheritance~openblas')
s.concretize()
assert '^cmake' in s
assert '^openblas' not in s