This Conda package uses activation/deactivation scripts to set the environment variable
PYTHONPATH=""
when activating a Conda environment, effectively insulating
the Conda environment from Python modules provided by this variable.
The package is hosted on Anaconda Cloud. It can be installed with
conda install merv::envvar-pythonpath-null
Users wishing to have PYTHONPATH=""
set for all environments by default can use
conda config --add create_default_packages merv::envvar-pythonpath-null
which will include this package automatically in all future environments at environment creation.
This package is a proof-of-concept to demonstrate managing environment variables in Conda environments through the "unit of computation" of Conda, which is the Conda package. It is released under a CC0 license (i.e., public domain). Feel free to use this repository as an outline for similar packages.
The environment variables are set/unset in the recipe/[de]activate.{bat,sh}
files.
While there is not a standing convention for packages managing environment variables,
this uses the template envvar-<variable_name>-<value>
.
The repository includes a GitHub Workflow that builds and uploads the package to
Anaconda Cloud. For the uploading portion to work, users should adjust the
ANACONDA_USER
variable in the conda-build.yml
workflow file
and need to set an ANACONDA_TOKEN
repository secret corresponding to an access token
for their Anaconda Cloud account with the "Allow all API operations" permission.