Test & Code

130: virtualenv activation prompt consistency across shells - an open source dev and test adventure - Brian Skinn


Listen Later

virtualenv supports six shells: bash, csh, fish, xonsh, cmd, posh. Each handles prompts slightly differently. Although the virtualenv custom prompt behavior should be the same across shells, Brian Skinn noticed inconsistencies. He set out to fix those inconsistencies. That was the start of an adventure in open source collaboration, shell prompt internals, difficult test problems, and continuous integration quirks.

Brian Skinn initially noticed that on Windows cmd, a space was added between a prefix defined by --prompt and the rest of the prompt, whereas on bash no space was added.

For reference, there were/are three nominal virtualenv prompt modification behaviors, all of which apply to the prompt changes that are made at the time of virtualenv activation:

  1. If the environment variable VIRTUAL_ENV_DISABLE_PROMPT is defined and non-empty at activation time, do not modify the prompt at all. Otherwise:
  2. If the --prompt argument was supplied at creation time, use that argument as the prefix to apply to the prompt; or,
  3. If the --prompt argument was not supplied at creation time, use the default prefix of "() " as the prefix (the environment folder name surrounded by parentheses, and with a trailing space after the last paren.
  4. Special Guest: Brian Skinn.

    Sponsored By:

    • Talk Python Training: Online video courses for Python developers
    • HoneyBadger: When bad things happen, it's nice to know that Honeybadger has your back. 30% off for first 6 months when you mention Test & Code Podcast when signing up.
    • PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22

    Links:

    • virtualenv
    • Initial issue that started the adventure
    • final PR
    • pent: pent Extracts Numerical Text -- Mini-language driven parser for structured numerical data
    • Lightening talk on pent
    ★ Support this podcast on Patreon ★
    ...more
    View all episodesView all episodes
    Download on the App Store

    Test & CodeBy Brian Okken

    • 4.7
    • 4.7
    • 4.7
    • 4.7
    • 4.7

    4.7

    71 ratings


    More shows like Test & Code

    View all
    Hanselminutes with Scott Hanselman by Scott Hanselman

    Hanselminutes with Scott Hanselman

    378 Listeners

    Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

    Software Engineering Radio - the podcast for professional software developers

    262 Listeners

    The Changelog: Software Development, Open Source by Changelog Media

    The Changelog: Software Development, Open Source

    285 Listeners

    Thoughtworks Technology Podcast by Thoughtworks

    Thoughtworks Technology Podcast

    43 Listeners

    Data Skeptic by Kyle Polich

    Data Skeptic

    474 Listeners

    Talk Python To Me by Michael Kennedy

    Talk Python To Me

    584 Listeners

    Software Engineering Daily by Software Engineering Daily

    Software Engineering Daily

    630 Listeners

    The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence) by Sam Charrington

    The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence)

    429 Listeners

    Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

    Super Data Science: ML & AI Podcast with Jon Krohn

    295 Listeners

    Python Bytes by Michael Kennedy and Brian Okken

    Python Bytes

    212 Listeners

    Data Engineering Podcast by Tobias Macey

    Data Engineering Podcast

    143 Listeners

    Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

    Syntax - Tasty Web Development Treats

    985 Listeners

    Practical AI by Practical AI LLC

    Practical AI

    196 Listeners

    The Stack Overflow Podcast by The Stack Overflow Podcast

    The Stack Overflow Podcast

    63 Listeners

    The Real Python Podcast by Real Python

    The Real Python Podcast

    137 Listeners