Skip to content

Commit

Permalink
establish standard leading __ for virtual packages
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed May 30, 2019
1 parent 148cfb0 commit 90c6ed2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conda/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _supplement_index_with_features(index, features=()):
def _supplement_index_with_system(index):
cuda_version = context.cuda_version
if cuda_version is not None:
rec = _make_virtual_package('_cuda', cuda_version)
rec = _make_virtual_package('__cuda', cuda_version)
index[rec.name] = rec


Expand Down
7 changes: 4 additions & 3 deletions docs/source/user-guide/tasks/manage-virtual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ real packages and not displayed by ``conda list``. Instead ``conda`` runs a
small bit of code to detect the presence or absence of the system feature that
corresponds to the package. The currently supported list of virtual packages includes:

* ``_cuda``: Maximum version of CUDA supported by the display driver
* ``__cuda``: Maximum version of CUDA supported by the display driver

Other virtual packages will be added in future conda releases.
Other virtual packages will be added in future conda releases. These are denoted
by a leading double-underscore in the package name.


Listing detected virtual packages
Expand All @@ -40,7 +41,7 @@ section, as shown in this example::
conda version : 4.6.3.post8+8f640d35a
conda-build version : 3.17.8
python version : 3.7.2.final.0
virtual packages : _cuda=10.0
virtual packages : __cuda=10.0
base environment : /Users/demo/dev/conda/devenv (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_supplement_index_with_system():
with env_vars({'CONDA_OVERRIDE_CUDA': '3.2'}):
_supplement_index_with_system(index)

cuda_pkg = index['_cuda']
cuda_pkg = index['__cuda']
assert cuda_pkg.version == '3.2'
assert cuda_pkg.package_type == PackageType.VIRTUAL_SYSTEM

Expand Down
4 changes: 2 additions & 2 deletions tests/data/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -21209,7 +21209,7 @@
"build": "0",
"build_number": 0,
"depends": [
"_cuda>=9.0"
"__cuda>=9.0"
],
"md5": "28a63f84034658e80779e88e70fad7bf",
"name": "cudatoolkit",
Expand All @@ -21220,7 +21220,7 @@
"build": "0",
"build_number": 0,
"depends": [
"_cuda>=10.0"
"__cuda>=10.0"
],
"md5": "28a63f84034658e80779e88e70fad7bf",
"name": "cudatoolkit",
Expand Down

0 comments on commit 90c6ed2

Please sign in to comment.