<commit_before>"""
Exported module that provides build and deploy dependancies and related functions.

Currently only [`pip`](@ref) is implemented.
"""
module Deps

export pip

"""
    pip(deps...)

Installs (as non-root user) all python packages listed in `deps`.

**Examples**

```julia
using Documenter

makedocs(
    # ...
)

deploydocs(
    deps = Deps.pip("pygments", "mkdocs", "mkdocs-material"),
    # ...
)
```
"""
pip(deps...) = () -> run(`pip install --user $(deps...)`)


function localbin()
    OS_NAME === :Linux  ? joinpath(homedir(), ".local", "bin") :
    OS_NAME === :Darwin ? joinpath(homedir(), "Library", "Python", "2.7", "bin") : ""
end

function updatepath!(p = localbin())
    if contains(ENV["PATH"], p)
        ENV["PATH"]
    else
        ENV["PATH"] = "$p:$(ENV["PATH"])"
    end
end

end<commit_msg>Compat for removal of `OS_NAME`.<commit_after>"""
Exported module that provides build and deploy dependancies and related functions.

Currently only [`pip`](@ref) is implemented.
"""
module Deps

export pip

"""
    pip(deps...)

Installs (as non-root user) all python packages listed in `deps`.

**Examples**

```julia
using Documenter

makedocs(
    # ...
)

deploydocs(
    deps = Deps.pip("pygments", "mkdocs", "mkdocs-material"),
    # ...
)
```
"""
pip(deps...) = () -> run(`pip install --user $(deps...)`)


function localbin()
    is_linux() ? joinpath(homedir(), ".local", "bin") :
    is_apple() ? joinpath(homedir(), "Library", "Python", "2.7", "bin") : ""
end

function updatepath!(p = localbin())
    if contains(ENV["PATH"], p)
        ENV["PATH"]
    else
        ENV["PATH"] = "$p:$(ENV["PATH"])"
    end
end

if isdefined(:OS_NAME) && !isdefined(:is_linux) && !isdefined(:is_apple) # compat
    is_linux() = OS_NAME === :Linux
    is_apple() = OS_NAME === :Apple || OS_NAME === :Darwin
end

end
{'fraction_non_alphanumeric': 0.2039151712887439, 'fraction_numerical': 0.002175095160413268, 'mean_word_length': 3.4987775061124693, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5131848', 'n_tokens_mistral': 670, 'n_tokens_neox': 634, 'n_words': 165}