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

development environment wizard #511

Merged
merged 7 commits into from
Nov 28, 2018
Merged

development environment wizard #511

merged 7 commits into from
Nov 28, 2018

Conversation

jesteria
Copy link
Member

development environment-bootstrapping script develop

based on dssg/install-cli

resolves #444
resolves #456

changes:

  • the repository no longer insists on a pyenv virtualenv via the file
    .python-version, and otherwise avoids edge cases wherein this file caused
    issues
  • a bootstrap "wizard" 🌟 script makes recommendations -- heavily reliant
    on pyenv -- but which the developer may opt in or out of, (and instead
    use more as an interactive checklist)

the script prompts to do the following:

  • install pyenv
  • install the python version now reflected by .python-version.current
    (the check does not assume pyenv; but, it does not support
    installation of the expected python version without pyenv)
  • install a pyenv virtualenv named like what's in .python-version.current
  • write a symlink .python-version to enable auto-activation of the
    virtualenv (if the pyenv virtualenv was created)
  • pip install all development dependencies
  • pip install "editable" / in "develop mode" the triage library itself

…issues

rather than insist that developers use pyenv and have a pyenv-virtualenv with the name suggested by .python-version, we'll only record this name (with current python version included) here.

a subsequent bootstrapper can set this up as before (via symlink) or suggest how to customize (locally)
based on [dssg/install-cli]

resolves #444
resolves #456

changes:

* the repository no longer insists on a pyenv virtualenv via the file
.python-version, and otherwise avoids edge cases wherein this file caused
issues
* a bootstrap "wizard" script makes recommendations -- heavily reliant
on pyenv -- but which the developer may opt in or out of, (and instead
use more as an interactive checklist)

the script **prompts** to do the following:

* install pyenv
* install the python version now reflected by .python-version.current
  (the _check_ does not assume pyenv; but, it does not support
  _installation_ of the expected python version without pyenv)
* install a pyenv virtualenv named like what's in .python-version.current
* write a symlink .python-version to enable auto-activation of the
  virtualenv (if the pyenv virtualenv was created)
* pip install all development dependencies
* pip install "editable" / in "develop mode" the triage library itself
@codecov-io
Copy link

codecov-io commented Nov 16, 2018

Codecov Report

Merging #511 into master will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #511      +/-   ##
==========================================
+ Coverage   82.51%   82.64%   +0.12%     
==========================================
  Files          81       82       +1     
  Lines        4662     5202     +540     
==========================================
+ Hits         3847     4299     +452     
- Misses        815      903      +88
Impacted Files Coverage Δ
src/triage/component/architect/utils.py 30.4% <0%> (-3.6%) ⬇️
src/triage/component/architect/planner.py 95.23% <0%> (-0.99%) ⬇️
...age/component/architect/cohort_table_generators.py 93.02% <0%> (ø)
src/triage/experiments/base.py 94.61% <0%> (+1.82%) ⬆️
...c/triage/component/architect/feature_generators.py 86.57% <0%> (+2.38%) ⬆️
src/triage/experiments/validate.py 76% <0%> (+2.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19696ba...4f1f98e. Read the comment docs.

@jesteria
Copy link
Member Author

@ivanhigueram Let me know if this really does (appear) to resolve the issues you raised.

@thcrock I'm not positive this addresses everything we'd discussed -- and really, everything that's reasonable to document and/or automate here -- but let me know.

@thcrock
Copy link
Contributor

thcrock commented Nov 16, 2018

Could you modify CONTRIBUTING.md, especially the 'Triage Development Environment' section, as a part of this PR? You could link to this section of the README instead of duplicating content, or whatever you think would be most clear, but I think the introduction of the new development environment instructions should supercede what was written there.

@thcrock
Copy link
Contributor

thcrock commented Nov 19, 2018

There is something inconsistent about how the develop script checks for pyenv and how it expects to use it. My first try using the script, I got this...

(install) begin 

(pyenv) installed ✓ 

(python-3.6.2) v3.6.2 not found – install? 
1) yes, install {pyenv install -s $py_version}
2) no, ignore
#? 1
./develop: line 114: pyenv: command not found
(python-3.6.2) installation failed ✗ 

In short, it recognized some previous installation of pyenv I had, and so elected not to do the installation part of it, but then was unable to use it on the next step.

@jesteria
Copy link
Member Author

@thcrock I would say there's something inconsistent about your environment... 😸

But yes, because of incomplete installations, I had to make the check a bit funky. This is another datapoint. Lemme see!

@jesteria
Copy link
Member Author

@thcrock All right, based on a deeper look and some conversation, I think the script now does as thorough a check of your pyenv setup as we would have it do.

The check it was doing for the installation was correct, and no less thorough than the check the pyenv-installer does, itself. However, as it was in your situation, it's possible to miss / ignore / lose the required pyenv setup, (in your shell profile), never mind that the installer prompts you for it when you (first) run it.

I've added a check that pyenv, if installed, is set up to actually be available; and, if the check fails, it repeats the pyenv set-up instructions, and attempts to bootstrap it s.t. subsequent checks can run.

Let me know how that works for y'all....

@jesteria
Copy link
Member Author

All right, I think we're good here…! (And we can continue to develop this as we find need.)

@jesteria jesteria merged commit 934179b into master Nov 28, 2018
@jesteria jesteria deleted the jsl/develop branch November 28, 2018 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Developing environment .python-version file not obvious
3 participants