Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install bash activate script on Windows when using venv #66539

Closed
marfire mannequin opened this issue Sep 5, 2014 · 12 comments
Closed

Install bash activate script on Windows when using venv #66539

marfire mannequin opened this issue Sep 5, 2014 · 12 comments
Assignees
Labels
3.7 (EOL) end of life OS-windows type-feature A feature request or enhancement

Comments

@marfire
Copy link
Mannequin

marfire mannequin commented Sep 5, 2014

BPO 22343
Nosy @pfmoore, @vsajip, @ncoghlan, @evanunderscore
Files
  • activate.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/vsajip'
    closed_at = <Date 2017-01-13.10:19:04.337>
    created_at = <Date 2014-09-05.20:24:08.683>
    labels = ['type-feature', '3.7', 'OS-windows']
    title = 'Install bash activate script on Windows when using venv'
    updated_at = <Date 2017-01-13.10:19:04.337>
    user = 'https://bugs.python.org/marfire'

    bugs.python.org fields:

    activity = <Date 2017-01-13.10:19:04.337>
    actor = 'vinay.sajip'
    assignee = 'vinay.sajip'
    closed = True
    closed_date = <Date 2017-01-13.10:19:04.337>
    closer = 'vinay.sajip'
    components = ['Windows']
    creation = <Date 2014-09-05.20:24:08.683>
    creator = 'marfire'
    dependencies = []
    files = ['38851']
    hgrepos = []
    issue_num = 22343
    keywords = ['patch']
    message_count = 12.0
    messages = ['226452', '226483', '226504', '240170', '282741', '283538', '285255', '285286', '285304', '285335', '285336', '285369']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'vinay.sajip', 'ncoghlan', 'marfire', 'evan_', 'Brandon VanVaerenbergh - NOAA Affiliate']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22343'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @marfire
    Copy link
    Mannequin Author

    marfire mannequin commented Sep 5, 2014

    When I use venv to create a new virtual environment in Windows I'm given two activate scripts, a .bat file and a .ps1 file (which is consistent with the documentation).

    However, bash (and probably the other shells as well) works just fine in Windows under Cygwin. Since you have these scripts anyway, please include them in the Windows virtual environment (as virtualenv did).

    @marfire marfire mannequin added OS-windows type-feature A feature request or enhancement labels Sep 5, 2014
    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Sep 6, 2014

    +1 from me - Vinay?

    @vsajip
    Copy link
    Member

    vsajip commented Sep 6, 2014

    I have no particular objection to this, and it's not a lot of work to make it happen. The POSIX scripts were left out in case the opposite view was advanced - that these scripts would be of no use to most people on Windows, and shouldn't be there cluttering up the place :-)

    @pfmoore
    Copy link
    Member

    pfmoore commented Apr 6, 2015

    Presumably this would just be a case of moving "activate" from venv/scripts/posix to venv/scripts/common? I don't think including csh or fish scripts on Windows is worthwhile...

    Attached is a patch on that basis. I didn't see any tests for which scripts were installed, so I don't think there's anything to change there.

    @BrandonVanVaerenbergh-NOAAAffiliate
    Copy link
    Mannequin

    +1 just experienced this issue migrating from Python3.4 to Python3.5 on windows with bash (MINGW git bash) as primary shell

    Temporarily resolved issue (on this workstation) by simply copying Python35\Lib\venv\scripts\posix\activate file, into folder: Python35\Lib\venv\scripts\nt\

    then recreating venv

    @BrandonVanVaerenbergh-NOAAAffiliate BrandonVanVaerenbergh-NOAAAffiliate mannequin added the 3.7 (EOL) end of life label Dec 8, 2016
    @evanunderscore
    Copy link
    Mannequin

    evanunderscore mannequin commented Dec 18, 2016

    +1, I'm also using Windows with Git Bash and venv is unusable for me without Brandon's workaround.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 11, 2017

    If we do this, the activate script will have LF (POSIX) line endings on Windows. Will this work for things like cygwin, Git-bash etc?

    @marfire
    Copy link
    Mannequin Author

    marfire mannequin commented Jan 12, 2017

    I can confirm that LF endings work fine on Cygwin, and it's hard to imagine any bash implementation not handling that properly.

    @evanunderscore
    Copy link
    Mannequin

    evanunderscore mannequin commented Jan 12, 2017

    Works for me in Git Bash.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 12, 2017

    I've pushed the changes, but due to some SMTP problem this issue wasn't updated by Roundup:

    remote: SMTPServerDisconnected: Connection unexpectedly closed: timed out
    remote: error: changegroup.roundup hook raised an exception: Connection unexpectedly closed: timed out

    However, the changes appear to be in the repository. Interested parties might want to pull the changes and test things out on Windows so that the issue can be closed.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 12, 2017

    Changesets:

    3.5 d6ae934da199
    3.6 8f77c4f93806
    default 7afe82ad34e7

    @evanunderscore
    Copy link
    Mannequin

    evanunderscore mannequin commented Jan 13, 2017

    Works for me on the master branch. Thanks, Vinay.

    @vsajip vsajip closed this as completed Jan 13, 2017
    @vsajip vsajip self-assigned this Jan 13, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life OS-windows type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants