{"action":"created","issue":{"url":"https://api.github.com/repos/hypothesis/h/issues/5261","repository_url":"https://api.github.com/repos/hypothesis/h","labels_url":"https://api.github.com/repos/hypothesis/h/issues/5261/labels{/name}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/5261/comments","events_url":"https://api.github.com/repos/hypothesis/h/issues/5261/events","html_url":"https://github.com/hypothesis/h/pull/5261","id":356898161,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMDQzODAw","number":5261,"title":"Run `make dev` and `make lint` in tox","user":{"login":"seanh","id":22498,"node_id":"MDQ6VXNlcjIyNDk4","avatar_url":"https://avatars3.githubusercontent.com/u/22498?v=4","gravatar_id":"","url":"https://api.github.com/users/seanh","html_url":"https://github.com/seanh","followers_url":"https://api.github.com/users/seanh/followers","following_url":"https://api.github.com/users/seanh/following{/other_user}","gists_url":"https://api.github.com/users/seanh/gists{/gist_id}","starred_url":"https://api.github.com/users/seanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanh/subscriptions","organizations_url":"https://api.github.com/users/seanh/orgs","repos_url":"https://api.github.com/users/seanh/repos","events_url":"https://api.github.com/users/seanh/events{/privacy}","received_events_url":"https://api.github.com/users/seanh/received_events","type":"User","site_admin":false},"labels":[{"id":546994724,"node_id":"MDU6TGFiZWw1NDY5OTQ3MjQ=","url":"https://api.github.com/repos/hypothesis/h/labels/WIP","name":"WIP","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-09-04T17:03:25Z","updated_at":"2018-09-13T11:29:24Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/5261","html_url":"https://github.com/hypothesis/h/pull/5261","diff_url":"https://github.com/hypothesis/h/pull/5261.diff","patch_url":"https://github.com/hypothesis/h/pull/5261.patch"},"body":"`make test test-py3 docs checkdocs docstrings` and `checkdocstrings` each run in their own tox-managed venvs already. This PR changes `make dev` and `lint` to run in tox venvs too (two venvs: one for `make dev` and one for `make lint`). This means that everything in `Makefile` now runs in tox, except `make clean docker` and `run-docker` which wouldn't make sense in tox.\r\n\r\nThis means that developers no longer need to create and activate a virtualenv. You just install tox (system-wide: `sudo apt-get|brew install tox`) and then run `make dev`, without having created or activated a venv, and it works.\r\n\r\nIf some developers _do_ still want to use their own venv, and manager it with virtualenvwrapper or virtualfish, they can do so. All the dependencies are still specified in `requirements` files. You just have to run `bin/hypothesis devserver` instead of `make dev`.\r\n\r\nThe advantages of running `make dev` and `lint` inside tox are:\r\n\r\n* Makes onboarding easier for developers (venv management is one thing that trips up new developers, until they start using virtualenvwrapper or virtualfish and get the hang of it)\r\n* Make our dev install docs shorter and simpler\r\n* Reduces \"Something isn't working in my particular dev env\" problems\r\n* Reduces difference between different developers envs, CI and prod\r\n* By using a separate venv for each command only the deps needed for the particular command need to be installed in the particular venv, rather than installing everything in one big development venv, so that chance of dependency collisions or incompatibilties is reduced, and we gain some freedom as the venvs for different make commands can use different versions of Python, or different versions of the same Python package\r\n\r\n## Future plans\r\n\r\n* Do the same change for bouncer and lms so that all our projects are consistent\r\n\r\n* Maybe move `docker-compose` into a venv.\r\n\r\n  Since docker-compose is just a Python package we could install docker-compose into its own tox-managed docker-compose venv and then provide a command that's just an alias for the docker-compose in the venv. `tox -e docker-compose -- <ARGS>` would certainly work. Maybe `make docker-compose [args]`. You want to be able to pass your own args to it anyway, so you can pass `up`, or `up -d`, or `stop`, etc depending on what you want to do now.\r\n\r\n  The advantage of doing this is that we could remove the \"install docker-compose\" step from our install docs - tox can install it for us, which is one less thing for devs to worry about, and no more problems with installing docker-compose on one dev's system because of problems unique to their environment, it's installed automatically into its very own venv.\r\n\r\n* Add some new tox-based make commands: `make shell` to run a Python shell, `make sql` to connect to the DB with SQL\r\n\r\n## See also\r\n\r\n* Work-in-progress `make sql` command: https://github.com/hypothesis/h/pull/5231"},"comment":{"url":"https://api.github.com/repos/hypothesis/h/issues/comments/420974713","html_url":"https://github.com/hypothesis/h/pull/5261#issuecomment-420974713","issue_url":"https://api.github.com/repos/hypothesis/h/issues/5261","id":420974713,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDk3NDcxMw==","user":{"login":"seanh","id":22498,"node_id":"MDQ6VXNlcjIyNDk4","avatar_url":"https://avatars3.githubusercontent.com/u/22498?v=4","gravatar_id":"","url":"https://api.github.com/users/seanh","html_url":"https://github.com/seanh","followers_url":"https://api.github.com/users/seanh/followers","following_url":"https://api.github.com/users/seanh/following{/other_user}","gists_url":"https://api.github.com/users/seanh/gists{/gist_id}","starred_url":"https://api.github.com/users/seanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanh/subscriptions","organizations_url":"https://api.github.com/users/seanh/orgs","repos_url":"https://api.github.com/users/seanh/repos","events_url":"https://api.github.com/users/seanh/events{/privacy}","received_events_url":"https://api.github.com/users/seanh/received_events","type":"User","site_admin":false},"created_at":"2018-09-13T11:29:24Z","updated_at":"2018-09-13T11:29:24Z","author_association":"CONTRIBUTOR","body":"> One problem I ran into is that on my system tox has been installed with pip and it is invoked with my system Python 3 by default which is Python 3.7. This in turn creates a \"dev\" tox-env using Python 3.7 which is not compatible with h. Ideally I would prefer make dev to use the latest compatible version of Python 3.\r\n\r\nThis should be fixed by https://github.com/hypothesis/h/pull/5261/commits/01ebdb8a4e46071edd6411296200082b64f69c8a"}}
{"actor":{"display_login":"seanh"}}