airspeed-velocity / asv

Airspeed Velocity: A simple Python benchmarking tool with web-based reporting
https://asv.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
866 stars 181 forks source link

DOC: Environment variables in build command #1355

Open sbalian opened 9 months ago

sbalian commented 9 months ago

Is there a way to pass an environment variable to the build command? This is to avoid putting secrets in the JSON config.

For example, USER and PASSWORD in ...

    "build_command": [
        ...
        "python -m poetry config http-basic.private-repo $USER $PASSWORD",
        ...
    ]

Edit: with poetry, I solved my issue using:

export POETRY_HTTP_BASIC_MY_REPOSITORY_USERNAME=user
export POETRY_HTTP_BASIC_MY_REPOSITORY_PASSWORD=secret

This way, there is no need to enter the username and password into the JSON file.

Doc here.

HaoZeke commented 8 months ago

I would suggest consuming the json, modifying it in-place in python and then streaming it to asv. However, a documentation update regarding this would be most welcome :)