-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Virtualenv support #55
Conversation
45017e6
to
f6fcd68
Compare
This feature is basically complete though I'm sure there's bugs! Needs tests as well which won't be easy. |
If I'm reading this correctly it creates a virtualenv for every distinct project right? If so: 👍 |
yep exactly
…On Sun, Aug 18, 2019 at 6:53 PM Austin Pray ***@***.***> wrote:
If I'm reading this correctly it creates a virtualenv for every distinct
project right? If so: 👍
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#55?email_source=notifications&email_token=AACIFNMGOL5IB32ZAXDWTH3QFHHHZA5CNFSM4IMQKBOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RKNIY#issuecomment-522364579>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACIFNMTZYLSSBH6F5WLNELQFHHHZANCNFSM4IMQKBOA>
.
|
return release.Version | ||
} | ||
|
||
func FetchLatestRelease(repo string) Release { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we provide a way to keep repo (e.g: roots/trellis
) git history?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 that's a tough one. I guess it's possible to use the same API to get the release tag_name
, then do a Git clone (via https?).. and then? git clone --branch <tag_name> <repo_url>
is supported in newer Gits.
I'm going to "unit" test this as much as possible but this feature makes that especially difficult and it won't really be testing that much functionality. @tangrufus do you have any ideas for integration tests with it using docker? For the best coverage, I'd need to test multiple Python versions as well. And some things (such as installing Virtualenv) require the network as well 😞 |
This is my current setup:
Then I ran
Question: How to I verify dependencies are installed via virtualenv ansible instead of my original ansible? |
It's a little difficult right now because the virtualenv is only "activated" for the versionCmd := execCommand("ansible-playbook", "--version")
logCmd(versionCmd, c.UI, true)
versionCmd.Run()
path, err := exec.LookPath("ansible-playbook")
c.UI.Info(path) I would just uninstall Ansible locally to test this feature which is another way to ensure it works 🤷♂ Maybe some helpful debug information like this should be added to the |
364cd99
to
c199814
Compare
I just pushed a new
So it will exec any command within the activated virtual env. This mirrors Ruby's |
3d1159e
to
f3f58fa
Compare
f3f58fa
to
24f07da
Compare
24f07da
to
2a47431
Compare
This should be ready to go now |
The first one seems unused (it is empty). _, _ = os.OpenFile(venvPath, os.O_CREATE, 0555) golang question: Do we need Other than these 2, everything else looks good to me. |
`TRELLIS_VENV=false` won't activate virtualenv
2a47431
to
9386451
Compare
Thanks @tangrufus. Fixed the issue with creating two Also caused me to do more testing and identified another issue using python3's |
e031cc5
to
f44d238
Compare
Using Am I missing something?
|
Besides,
|
Looking to see if I can reproduce your other issue. Do you have |
I don't have
If it helps, I installed both
Do you need any other info for debugging? |
I'm guessing it was the addition of Can you try removing that flag and see if it helps? |
And now I can't reproduce the original problem without |
Removing |
f44d238
to
1003b69
Compare
Fixed in here too |
1003b69 works! 🎉 🎉 🎉 |
Thanks for all the testing ❤️ |
trellis-cli exists to make Trellis easier to install, use, and manage. So far all the features have made it easier to create new projects and manage them, but nothing to help install Trellis' initial requirements. We've seen people struggle to use the proper python, install
pip
, install the correct versions of Ansible, etc.This PR adds virtualenv support which is a tool to create isolated Python environments. The idea is that a Trellis user only needs Python installed and trellis-cli will take care of the rest. Thankfully most OS' have Python installed by default, so nothing else will be needed.
High-level workflow:
new
, a virtualenv is created per project and activatedinit
command will "initialize" a project with virtualenvbin
dir (as part of$PATH
trellis-cli will attempt the following to use virtualenv:
venv
modulevirtualenv
exists then just use it directlyNote: this relies on changes in roots/trellis#1100