Conda Forge Activity (rever.activities.conda_forge
)¶
Activity for updating conda-forge feedstocks.
-
class
rever.activities.conda_forge.
CondaForge
(*, deps=frozenset({'push_tag', 'tag'}))[source]¶ Updates conda-forge feedstocks.
The behaviour of this activity may be adjusted through the following environment variables:
- $CONDA_FORGE_FEEDSTOCK
str or None, feedstock name or URL, default
$PROJECT-feedstock
.- $CONDA_FORGE_PROTOCOL
str, one of
'ssh'
,'http'
, or'https'
that specifies how the activity should interact with github when cloning, pulling, or pushing to the feedstock repo. Note that'ssh'
requires you to have an SSH key registered with github. The default is'ssh'
.- $CONDA_FORGE_SOURCE_URL
str, the URL that the recipe will use to download the source code. This is needed so that we may update the hash of the downloaded file. This string is evaluated with the current environment. Default
'https://github.com/$GITHUB_ORG/$GITHUB_REPO/archive/$VERSION.tar.gz'
.- $CONDA_FORGE_HASH_TYPE
str, the type of hash that the recipe uses, eg
'md5'
or'sha256'
. Default'sha256'
.- $CONDA_FORGE_PATTERNS
list or 3-tuples of str, this is list of (filename, pattern-regex, replacement) tuples that is evaluated inside of the recipe directory. This is similar to the version bump pattern structure. Both the pattern-regex str and the replacement str will have environment variables expanded. The following environment variables are added for this evaluation:
$SOURCE_URL
: the fully expanded source code URL.$HASH_TYPE
: the hash type used to hash$SOURCE_URL
.$HASH
: the hexdigest of$SOURCE_URL
.
The default patterns match most standard recipes.
- $CONDA_FORGE_PULL_REQUEST
bool, whether the activity should open a pull request to the upstream conda-forge feestock, default True.
- $CONDA_FORGE_RERENDER
bool, whether the activity should rerender the feedstock using conda-smithy, default True.
- $CONDA_FORGE_FORK
bool, whether the activity should create a new fork of the feedstock if it doesn’t exist already, default True.
- $CONDA_FORGE_FORK_ORG
str, the org to fork the recipe to or which holds the fork, if
''
use the registered gh username, defaults to''
Other environment variables that affect the behavior are:
- $GITHUB_CREDFILE
the credential file to use. This should NOT be set in the rever.xsh file
- $GITHUB_ORG
the github organization that the project belongs to.
- $GITHUB_REPO
the github repository of the project.
- $TAG_TEMPLATE
str, the template string used to tag the version, by default this is ‘$VERSION’. Used to download project source.
- $PROJECT
the name of the project being released.
- $REVER_CONFIG_DIR
the user’s config directory for rever, which is where the GitHub credential files are stored by default.
- Parameters
- namestr, optional
Name of the activity.
- depsset of str, optional
Set of activities that must be completed before this activity is executed.
- funccallable, optional
Function to perform as activity when this activities is executed (called).
- undocallable, optional
Function to undo this activities behaviour and reset the repo state.
- setupcallable, optional
Function to help initialize the activity.
- checkcallable, optional
Function to check if the activity can be run sucessfully on the user’s machine, with their credentials, etc. This function should return True if the activity can be run, and False otherwise.
- requiresdict or None, optional
A dict of dicts of the following form that specifies the command line utility and import requirements for this activity.
{ "commands": {"<cli name>": "<package name>", ...} "imports": {"<module name>": "<package name>", ...} }
The top-level keys are both optional, and this will default to an empty dict.
- argstuple, optional
Arguments to be supplied to the
func(*args)
, if needed.- kwargsmapping, optional
Keyword arguments to be supplied to the
func(**kwargs)
, if needed.- descstr, optional
A short description of this activity
-
all_kwargs
()¶ Returns all kwargs for this activity.
-
check
()¶ Calls this activity’s check() function.
-
check_func
()¶ Checks that we can rerender and login
-
check_requirements
()¶ Checks that an activities requirements are actually available.
-
checker
(check)¶ Decorator that sets the check function for this activity.
-
clear_kwargs_from_env
()¶ Removes kwarg from the environment, if they exist.
-
kwargs_from_env
()¶ Obtains possible func() kwarg from the environment.
-
setup
()¶ Calls this activity’s setup() initialization function.
-
setupper
(setup)¶ Decorator that sets the setup function for this activity.
-
undo
()¶ Reverts to the last instance of this activity. This default implementation uses the revision in the log file from the last time that the activity was started. This may be overridden in a subclass.
-
undoer
(undo)¶ Decorator that sets the undo function for this activity.
-
CONDA_FORGE_FEEDSTOCK_ORG
= 'conda-forge'¶
-
DEFAULT_HASH_TYPE
= 'sha256'¶
-
DEFAULT_PROTOCOL
= 'ssh'¶
-
DEFAULT_RECIPE_DIR
= 'recipe'¶
-
property
env_names
¶ Dictionary mapping parameter names to the names of environment varaibles that the activity looks for when it is executed.