jli  Linuxx86_641.10.3v1.10.30b4590a5507d3f3046e5bafc007cacbbfc9b310b|CondaGYM-x#N5=,/opt/julia/packages/Conda/sDjAP/src/Conda.jlfAyϱBTjޠ,hJSON2_ށVersionParsingax$,J $:Downloads,/opt/julia/packages/Conda/sDjAP/deps/deps.jl@A CoremуJ5Basemу]J5MainmуJ5ArgToolsBń x(mуF K5 Artifactsmr-V3|mу K5Base64UlD*_mу> K5CRC32c\y.jmуj K5 FileWatchingXzsy`{,zmуh& K5LibdluVW59˗,mу-" K5LoggingT{VhUXM=mуrU" K5MmapP~:xg,Omу|' K5NetworkOptionsC0YW,mуʠ, K5SHAQ<$!<%mу1 K5 Serialization [)*k1mу-G K5Sockets1V$ bdސݗmуYBY K5UnicodeP>I>Nrmуeszo K5 LinearAlgebraSm7̏mуuux K5 OpenBLAS_jll[(Śb6EcQ FmуDux K5libblastrampoline_jllLSۆ }lxӠmу^} K5MarkdownZPn7z`smу/Ed~ K5Printfg^cX׸QDmу;h K5Random_ɢ?\Ymу? K5TarOi>աmу!t, K5DatesEY8pj2 mуX K5FuturebS;3{I xVMmуsD K5InteractiveUtilsWL ~@'ZmуVg K5LibGit2Z[&RPTv3EКRmу8J K5 LibGit2_jll YXg}]$mуD K5 MbedTLS_jllAX 3ȡ_mу- K5 LibSSH2_jlloTZk)߆ :x86, :powerpc64le => :ppc64le) if Sys.isapple() arch2conda[:aarch64] = :arm64 end conda_platform = string(conda_os, '-', get(arch2conda, Sys.ARCH, Sys.ARCH)) MINIFORGE_PLATFORMS = ["Linux-aarch64", "Linux-x86_64", "Linux-ppc64le", "MacOSX-arm64", "MacOSX-x86_64", "Windows-x86_64"] MINICONDA_PLATFORMS = ["Linux-aarch64", "Linux-x86_64", "Linux-ppc64le", "Linux-x86", "Linux-s390x", "MacOSX-arm64", "MacOSX-x86_64", "MacOSX-x86", "Windows-x86", "Windows-x86_64"] if USE_MINIFORGE if !(conda_platform in MINIFORGE_PLATFORMS) error("Unsupported miniforge platform: $(conda_platform)") else res = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-" end else if !(conda_platform in MINICONDA_PLATFORMS) error("Unsupported miniconda platform: $(conda_platform)") else res = "https://repo.continuum.io/miniconda/Miniconda$(MINICONDA_VERSION)-latest-" end end res *= conda_platform res *= Sys.iswindows() ? ".exe" : ".sh" return res end """ _quiet() Returns `conda` command-line argument to suppress progress bar in continuous integration (CI) environments. """ _quiet() = get(ENV, "CI", "false") == "true" ? `-q` : `` """ _install_conda(env::Union{AbstractString,Symbol}, force::Bool=false) Install miniconda/miniforge into `env` if it hasn't been installed yet; `_install_conda(env, true)` re-installs Conda even if it has already been installed. """ function _install_conda(env::Environment, force::Bool=false) if force || !isfile(Conda.conda) @assert startswith(abspath(Conda.conda), abspath(PREFIX)) "CONDA_EXE, $(conda), does not exist within $PREFIX" if (' ' ∈ PREFIX) || (Sys.iswindows() && !isascii(PREFIX)) error("""Conda.jl cannot be installed to its default location $(PREFIX) as Miniconda does not support the installation to a directory with a space or a non-ASCII character on Windows. The work-around is to install Miniconda to a user-writable directory by setting the CONDA_JL_HOME environment variable. For example on Windows: ENV["CONDA_JL_HOME"] = raw"C:\\Conda-Julia\\3" using Pkg Pkg.build("Conda") The Julia session need to be restarted. More information is available at https://github.com/JuliaPy/Conda.jl. """) end @info("Downloading miniconda installer ...") INSTALLER_DIR = tempdir() if Sys.isunix() installer = joinpath(INSTALLER_DIR, "installer.sh") end if Sys.iswindows() installer = joinpath(INSTALLER_DIR, "installer.exe") end mkpath(INSTALLER_DIR) Downloads.download(_installer_url(), installer) @info("Installing miniconda ...") mkpath(PREFIX) if Sys.isunix() chmod(installer, 33261) # 33261 corresponds to 755 mode of the 'chmod' program run(`$installer -b -f -p $PREFIX`) end if Sys.iswindows() run(Cmd(`$installer /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 /D=$PREFIX`, windows_verbatim=true)) end write("$PREFIX/condarc-julia.yml", "auto_update_conda: false") end if !isdir(prefix(env)) create(env) end end const PkgOrPkgs = Union{AbstractString, AbstractVector{<: AbstractString}} """ add(pkg, env::Union{AbstractString,Symbol}=ROOTENV) Installs new package(s) `pkg` into the conda environment `env` (defaulting to `ROOTENV`). `pkg` can be a string giving the name of a single package, or a vector of strings giving the names of several packages. """ function add(pkg::PkgOrPkgs, env::Environment=ROOTENV; channel::AbstractString="", satisfied_skip_solve::Bool = false, args::Cmd = ``, ) c = isempty(channel) ? `` : `-c $channel` @static if Sys.iswindows() && Sys.WORD_SIZE == 32 if satisfied_skip_solve @warn """ The keyword satisfied_skip_solve was set to true, but conda does not support --satisfied-skip-resolve on 32-bit Windows. """ end S = `` else S = satisfied_skip_solve ? `--satisfied-skip-solve` : `` end runconda(`install $(_quiet()) -y $c $S $args $pkg`, env) end """ rm(pkg, env::Union{AbstractString,Symbol}=ROOTENV) Uninstall package(s) `pkg` from the conda environment `env` (defaulting to `ROOTENV`). `pkg` can be a string giving the name of a single package, or a vector of strings giving the names of several packages. """ function rm(pkg::PkgOrPkgs, env::Environment=ROOTENV) runconda(`remove $(_quiet()) -y $pkg`, env) end """ create(env::Union{AbstractString,Symbol}) Create a new conda environment `env` (running `conda create`). """ function create(env::Environment) runconda(`create $(_quiet()) -y -p $(prefix(env))`) end """ update(env::Union{AbstractString,Symbol}=ROOTENV) Update all installed packages for the conda environment `env` (defaulting to `ROOTENV`). """ function update(env::Environment=ROOTENV) if env == ROOTENV runconda(`update $(_quiet()) -y --all conda`, env) else runconda(`update $(_quiet()) -y --all`, env) end end """ _installed_packages_dict(env::Union{AbstractString,Symbol}=ROOTENV) Return a list of all installed packages for the conda environment `env` (defaulting to `ROOTENV`) as a dictionary mapping package names to tuples of `(version_number, fullname)`. """ function _installed_packages_dict(env::Environment=ROOTENV) _install_conda(env) package_dict = Dict{String, Tuple{VersionNumber, String}}() for line in eachline(_set_conda_env(`$conda list`, env)) line = chomp(line) if !startswith(line, "#") name, version, build_string = split(line) try package_dict[name] = (vparse(version), line) catch package_dict[name] = (v"9999.9999.9999", line) warn("Failed parsing string: \"$(version)\" to a version number. Please open an issue!") end end end return package_dict end """ _installed_packages(env::Union{AbstractString,Symbol}=ROOTENV) Return an array of names of all installed packages for the conda environment `env` (defaulting to `ROOTENV`). """ _installed_packages(env::Environment=ROOTENV) = keys(_installed_packages_dict(env)) """ list(env::Union{AbstractString,Symbol}=ROOTENV) List all installed packages for the conda environment `env` (defaulting to `ROOTENV`) to standard output (`stdout`). """ function list(env::Environment=ROOTENV) runconda(`list`, env) end """ export_list(filepath, env=$ROOTENV) export_list(io, env=$ROOTENV) List all installed packages for the conda environment `env` (defaulting to `ROOTENV`) and write them to an export `filepath` or I/O stream `io`, mainly for use the [`import_list`](@ref) function. """ function export_list(filepath::AbstractString, env::Environment=ROOTENV) _install_conda(env) open(filepath, "w") do fobj export_list(fobj, env) end end function export_list(io::IO, env::Environment=ROOTENV) write(io, read(_set_conda_env(`$conda list --export`, env))) end """ version(name::AbstractString, env::Union{AbstractString,Symbol}=ROOTENV) Return the installed version of the package `name` (as a [`VersionNumber`](@ref) for the conda environment `env` (defaulting to `ROOTENV`). """ function version(name::AbstractString, env::Environment=ROOTENV) packages = parseconda(`list`, env) for package in packages pname = get(package, "name", "") startswith(pname, name) && return vparse(package["version"]) end error("Could not find the $name package") end """ search(matchspec::AbstractString, env::Union{AbstractString,Symbol}=ROOTENV; version::Union{AbstractString,VersionNumber,Nothing}=nothing) Search the list of available conda packages for the string `matchspec`, for the conda environment `env` (defaulting to `ROOTENV`), and return the result as an array of package names. If the optional keyword `version` is passed, then only packages having a match for this version number will be returned. """ function search(matchspec::AbstractString, env::Environment=ROOTENV; version::Union{AbstractString,VersionNumber,Nothing}=nothing) ret = parseconda(`search $matchspec`, env) if isnothing(version) return collect(keys(ret)) else ver = string(version) verv = vparse(ver) return collect(filter(keys(ret)) do k any(ret[k]) do pkg kver = pkg["version"] kver==ver || vparse(kver)==verv end end) end end # old API, has a method ambiguity for `search(package, version)` when # `version` is a string: search(package::AbstractString, _ver::AbstractString, env::Environment) = search(package, env; version=_ver) search(package::AbstractString, _ver::VersionNumber, env::Environment=ROOTENV) = search(package, env; version=_ver) """ exists(package::AbstractString, env::Union{AbstractString,Symbol}=ROOTENV) Return whether the given `package` exists for the conda environment `env` (defaulting to `ROOTENV`). A particular version may be specified by passing `"package==version"` as the `package` string. """ function exists(package::AbstractString, env::Environment=ROOTENV) if occursin("==", package) pkg,ver=split(package,"==") # Remove version if provided return pkg in search(pkg,env; version=ver) else return package in search(package,env) end end """ channels(env::Union{AbstractString,Symbol}=ROOTENV) Return an array of channels used to search packages in the conda environment `env` (defaulting to `ROOTENV`). """ function channels(env::Environment=ROOTENV) ret=parseconda(`config --get channels --file $(conda_rc(env))`, env) if haskey(ret["get"], "channels") return collect(String, ret["get"]["channels"]) else return String[] end end """ add_channel(channel::AbstractString, env::Union{AbstractString,Symbol}=ROOTENV) Add `channel` to the list of channels used to search packages in the conda environment `env` (defaulting to `ROOTENV`). """ function add_channel(channel::AbstractString, env::Environment=ROOTENV) runconda(`config --add channels $channel --file $(conda_rc(env)) --force`, env) end """ rm_channel(channel::AbstractString, env::Union{AbstractString,Symbol}=ROOTENV) Remove `channel` from the list of channels used to search packages in the conda environment `env` (defaulting to `ROOTENV`). """ function rm_channel(channel::AbstractString, env::Environment=ROOTENV) runconda(`config --remove channels $channel --file $(conda_rc(env)) --force`, env) end """ clean(; debug=false, index=true, locks=false, tarballs=true, packages=true, sources=false ) Runs `conda clean -y` with the specified flags. """ function clean(; debug=false, index=true, locks=false, tarballs=true, packages=true, sources=false ) kwargs = [debug, index, locks, tarballs, packages, sources] if !any(kwargs[2:end]) @warn( "Please specify 1 or more of the conda artifacts to clean up (e.g., `packages=true`)." ) end if locks @warn "clean --lock is no longer supported in Anaconda 4.8.0" end if sources @warn "clean --source-cache is no longer supported" end flags = [ "--debug", "--index-cache", "--lock", "--tarballs", "--packages", "--source-cache", ] cmd = Cmd([conda, "clean", "--yes", flags[kwargs]...]) run(_set_conda_env(cmd)) end """" import_list(filename, env=ROOTENV; channels=String[]) import_list(io, env=ROOTENV; channels=String[]) Create a new environment `env` (defaulting to `ROOTENV`) with various channels and a packages list file `filename` (or I/O stream `io`) """ function import_list( filepath::AbstractString, env::Environment=ROOTENV; channels=String[] ) channel_str = ["-c=$channel" for channel in channels] run(_set_conda_env( `$conda create $(_quiet()) -y -p $(prefix(env)) $(Cmd(channel_str)) --file $filepath`, env )) # persist the channels given for this environment for channel in reverse(channels) add_channel(channel, env) end end function import_list(io::IO, args...; kwargs...) mktemp() do path, fobj write(fobj, read(io)) close(fobj) import_list(path, args...; kwargs...) end end """ pip_interop(enabled::Bool, env::Union{AbstractString,Symbol}=ROOTENV) Sets the `pip_interop_enabled` value to `enabled` for the conda environment `env` (defaulting to `ROOTENV`) If `enabled==true`, then the conda solver is allowed to interact with non-conda-installed python packages. """ function pip_interop(enabled::Bool, env::Environment=ROOTENV) runconda(`config --set pip_interop_enabled $enabled --file $(conda_rc(env))`, env) end """ pip_interop(env::Union{AbstractString,Symbol}=ROOTENV) Gets the `pip_interop_enabled` value from the conda config for the conda environment `env` (defaulting to `ROOTENV`) """ function pip_interop(env::Environment=ROOTENV) dict = parseconda(`config --get pip_interop_enabled --file $(conda_rc(env))`, env)["get"] get(dict, "pip_interop_enabled", false) end function check_pip_interop(env::Environment=ROOTENV) pip_interop(env) || error(""" pip_interop is not enabled Use `Conda.pip_interop(true; [env::Environment=ROOTENV])` to enable """) end _pip() = Sys.iswindows() ? "pip.exe" : "pip" """ _pip(env::Union{AbstractString,Symbol}=ROOTENV) Return the path of the `pip` command for the conda environment `env` (defaulting to `ROOTENV`), installing `pip` if necessary. """ function _pip(env::Environment) "pip" ∉ _installed_packages(env) && add("pip", env) joinpath(script_dir(env), _pip()) end """ pip(cmd::AbstractString, pkg, env::Union{AbstractString,Symbol}=ROOTENV) Run the `pip` command `cmd` for the package(s) `pkg` in the conda environment `env` (defaulting to `ROOTENV`). `pkg` can be a string giving the name of a single package, or a vector of strings giving the names of several packages. """ function pip(cmd::AbstractString, pkgs::PkgOrPkgs, env::Environment=ROOTENV) check_pip_interop(env) # parse the pip command _cmd = String[split(cmd, " ")...] @info("Running $(`pip $_cmd $pkgs`) in $(env==ROOTENV ? "root" : env) environment") run(_set_conda_env(`$(_pip(env)) $_cmd $pkgs`, env)) nothing end end ,/opt/julia/packages/Conda/sDjAP/deps/deps.jlconst ROOTENV = "/opt/julia/conda/3/x86_64" const MINICONDA_VERSION = "3" const USE_MINIFORGE = true const CONDA_EXE = "/opt/julia/conda/3/x86_64/bin/conda" cu-