Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cheatsheet to current version #13865

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 0 additions & 22 deletions docs/source/user-guide/cheatsheet.rst

This file was deleted.

64 changes: 64 additions & 0 deletions docs/source/user-guide/cheatsheet/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os.path
import sys
from pathlib import Path

# expose custom extensions
sys.path.insert(0, os.path.abspath("../../_extensions"))

# expose source code for import
sys.path.insert(0, os.path.abspath("../../../.."))

import conda

# -- Project information -----------------------------------------------------

project = conda.__name__
copyright = "2017, Anaconda, Inc"
author = conda.__author__
version = release = conda.__version__

# -- General configuration ------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_simplepdf",
]

templates_path = ["_templates"]

# Leave double dashes as they are in the docs. Don't replace -- with -
smartquotes = False

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "conda_sphinx_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["../../_static"]

# -- Options for Sphinx-SimplePDF ------------------------------------------

simplepdf_vars = {
'primary': '#43b049',
'secondary': '#43b049',
'white': '#ffffff',
'links': '43b049',
}

simplepdf_theme_options = {
'nocover': 'true',
}
7 changes: 7 additions & 0 deletions docs/source/user-guide/cheatsheet/csv/additional-hints.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
get help for any command,``conda COMMAND --help``
get info for any package,``conda search PKGNAME --info``
"run commands w/o user prompt, e.g., installing multiple packages","``conda COMMAND ARG --yes``

``conda install PKGNAME1 PKGNAME2 --yes``"
remove all unused files,``conda clean --all``
examine conda configuration,``conda config --show``
13 changes: 13 additions & 0 deletions docs/source/user-guide/cheatsheet/csv/channels-and-packages.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
list installed packages,``conda list``
list installed packages with source info,``conda list --show-channel-urls``
update all packages,``conda update --all``
install a package from specific channel,"``conda install -c CHANNELNAME PKGNAME``

``conda install CHANNELNAME::PKGNAME``"
install specific version of package,``conda install PKGNAME=3.1.4``
install package with AND logic,"``conda install “PKGNAME>2.5, <3.2”``"
install package with OR logic,``conda install “PKGNAME [version=’2.5|3.2’]”``
uninstall package,``conda uninstall PKGNAME``
view channel sources,``conda config --show-sources``
add channel,``conda config --add channels CHANNELNAME``
set default channel for pkg fetching (targets first channel in channel sources),``conda config --set channel_priority strict``
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
create environment with Python version,``conda create -n ENVNAME python=3.10``
clone environment,``conda create --clone ENVNAME -n NEWENV``
rename environment,``conda rename -n ENVNAME NEWENVNAME``
delete environment by name,``conda remove -n ENVNAME --all``
list revisions made to environment,``conda list -n ENVNAME --revisions``
restore environment to a revision,``conda install -n ENVNAME --revision NUMBER``
uninstall package from specific channel,``conda remove -n ENVNAME -c CHANNELNAME PKGNAME``
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cross-platform compatible,``conda export --from-history>ENV.yml``
platform + package specific,``conda export ENVNAME>ENV.yml``
platform + package + channel specific,``conda list --explicit>ENV.txt``
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from a .yml file,``conda env create -n ENVNAME --file ENV.yml``
from a .txt file,``conda create -n ENVNAME --file ENV.txt``
5 changes: 5 additions & 0 deletions docs/source/user-guide/cheatsheet/csv/quickstart.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
verify conda install and check version,``conda info``
update conda in base environment,``conda update -n base conda``
install latest anaconda distribution (see release notes),``conda install anaconda``
create a new environment (tip: name environment descriptively),``conda create --name ENVNAME``
activate environment (do this before installing packages),``conda activate ENVNAME``
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
list all environments and locations,``conda info --envs``
list all packages + source channels,``conda list -n ENVNAME --show-channel-urls``
install packages in environment,``conda install -n ENVNAME PKGNAME1 PKGNAME2``
remove package from environment,``conda uninstall -n ENVNAME PKGNAME``
update all packages in environment,``conda update --all -n ENVNAME``
40 changes: 40 additions & 0 deletions docs/source/user-guide/cheatsheet/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
==========
Cheatsheet
==========

Refer to the conda cheatsheet for basic commands for creating and managing environments, installing packages, and importing and exporting environments.

.. csv-table:: Quickstart
:widths: 42 58
:header-rows: 0
:file: csv/quickstart.csv

.. csv-table:: Channels and Packages
:widths: 42 58
:header-rows: 0
:file: csv/channels-and-packages.csv

.. csv-table:: Working with Conda Environments
:widths: 42 58
:header-rows: 0
:file: csv/working-with-environments.csv

.. csv-table:: Environment Management
:widths: 42 58
:header-rows: 0
:file: csv/environment-management.csv

.. csv-table:: Exporting Environments
:widths: 42 58
:header-rows: 0
:file: csv/exporting-environments.csv

.. csv-table:: Importing Environments
:widths: 42 58
:header-rows: 0
:file: csv/importing-environments.csv

.. csv-table:: Additional Hints
:widths: 42 58
:header-rows: 0
:file: csv/additional-hints.csv
Binary file not shown.
Binary file not shown.
Binary file removed docs/source/user-guide/cheatsheets/conda-4.6.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion docs/source/user-guide/conda-cheatsheet.pdf

This file was deleted.