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

Dev env setup #120

Merged
merged 6 commits into from Apr 2, 2015

Conversation

Projects
None yet
3 participants
@hiromipaw
Contributor

hiromipaw commented Mar 19, 2015

Addressing issue #65. Add paragraph on Contributing documentation on how to prepare your environment for developing Cliquet.

@hiromipaw

This comment has been minimized.

Contributor

hiromipaw commented Mar 19, 2015

Trying to document possible issues as well. Please feel free to jump in and comment in the meantime if you have any advice or you think I should consider something that I have completely overlooked.

@hiromipaw hiromipaw force-pushed the nopressurelabs:dev_env_setup branch from d874378 to d52609e Mar 19, 2015

$ pip install cliquet
$ pip install waitress
$ pip install tox

This comment has been minimized.

@almet

almet Mar 19, 2015

Contributor

you can actually install everything with the dev-requirement.txt file. pip install -r dev-requirements.txt

$ pip install virtualenv
$ virtualenv .venv
$ source .venv/bin/activate

This comment has been minimized.

@almet

almet Mar 20, 2015

Contributor

Normally this is done automatically when doing a "make install".

This comment has been minimized.

@almet

almet Mar 20, 2015

Contributor

So I'm not sure this is so valuable to put here.

This comment has been minimized.

@leplatrem

leplatrem Mar 20, 2015

Contributor

make install-dev I would say

::
$ cd kinto
$ make serve

This comment has been minimized.

@leplatrem

leplatrem Mar 20, 2015

Contributor

I suggest we add kinto to dev-requirements.txt, and add make runkinto here

@leplatrem

This comment has been minimized.

Contributor

leplatrem commented Mar 20, 2015

Thank you very much!

You're the first external contributor and I saw that you're located in Barcelona :) I thus would like to invite you for some lunch/drink/tapas 🎉 !

@hiromipaw

This comment has been minimized.

Contributor

hiromipaw commented Mar 20, 2015

Hey guys. Thanks for feedback. I'll make sure to add that. Hope to start contributing more :)
@leplatrem drinks/lunch/tapas in Barcelona sounds good. Are you passing by or do you live here?

S

@leplatrem

This comment has been minimized.

Contributor

leplatrem commented Mar 23, 2015

I just started on a fresh Ubuntu 14.10 box, here is my log :

$ make runkinto
...
pkg_resources.DistributionNotFound: kinto
$ source .venv/bin/activate
$ pip install kinto

Now I can run it :

$ make runkinto
/home/mathieu/Code/Mozilla/cliquet/.venv/bin/pserve cliquet/tests/config/kinto.ini
2015-03-23 21:16:58,121 INFO  [cliquet.storage.postgresql][MainThread] Created PostgreSQL storage tables 
Starting server in PID 27106.
serving on http://0.0.0.0:8888

Still, it keeps asking for kinto...

$ make tests
Run 'make runkinto' before starting tests.
Makefile:37: recipe for target 'need-kinto-running' failed

Because, curl is not installed by default :

$ sudo apt-get install curl

$ make tests
tox
make: tox: Command not found
Makefile:34: recipe for target 'tests' failed
make: *** [tests] Error 127

Install tox then!

$ pip install tox
Downloading/unpacking tox
  Downloading tox-1.9.1.tar.gz (93kB): 93kB downloaded
  Running setup.py (path:/tmp/pip-build-GI7i1u/tox/setup.py) egg_info for package tox

Downloading/unpacking virtualenv>=1.11.2 (from tox)
  Downloading virtualenv-12.0.7-py2.py3-none-any.whl (1.8MB): 1.8MB downloaded
Downloading/unpacking py>=1.4.17 (from tox)
  Downloading py-1.4.26.tar.gz (190kB): 190kB downloaded
  Running setup.py (path:/tmp/pip-build-GI7i1u/py/setup.py) egg_info for package py

Installing collected packages: tox, virtualenv, py
  Running setup.py install for tox

    Installing tox script to /home/mathieu/Code/Mozilla/cliquet/.venv/bin
    Installing tox-quickstart script to /home/mathieu/Code/Mozilla/cliquet/.venv/bin
  Running setup.py install for py

Successfully installed tox virtualenv py
Cleaning up...

Run tests ? Hey, young padawan, not so fast :)

$ make tests
tox
Traceback (most recent call last):
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/bin/tox", line 9, in <module>
    load_entry_point('tox==1.9.1', 'console_scripts', 'tox')()
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2312, in load
    return self.resolve()
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/tox/__init__.py", line 23, in <module>
    from tox._cmdline import main as cmdline  # noqa
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/tox/_cmdline.py", line 15, in <module>
    from tox._venv import VirtualEnv
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/tox/_venv.py", line 6, in <module>
    from tox._config import DepConfig
  File "/home/mathieu/Code/Mozilla/cliquet/.venv/local/lib/python2.7/site-packages/tox/_config.py", line 12, in <module>
    from pip.req.req_file import parse_requirements
ImportError: No module named req_file
Makefile:34: recipe for target 'tests' failed
make: *** [tests] Error 1

Upgrade pip :

$ pip install -U pip
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-6.0.8-py2.py3-none-any.whl#md5=41e73fae2c86ba2270ff51c1d86f7e09
  Downloading pip-6.0.8-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.6
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...

Yes. Now, you can.

$ make tests
tox
GLOB sdist-make: /home/mathieu/Code/Mozilla/cliquet/setup.py
py27 create: /home/mathieu/Code/Mozilla/cliquet/.tox/py27
py27 installdeps: coverage, mock, nose, psycopg2, raven, statsd, unittest2, webtest
py27 inst: /home/mathieu/Code/Mozilla/cliquet/.tox/dist/cliquet-1.3.3.dev0.zip
py27 runtests: PYTHONHASHSEED='2218185105'
py27 runtests: commands[0] | python --version
Python 2.7.9
....

fatal error: Python.h: No such file or directory with Python3.4 ? oh, forgot this one :)

sudo apt-get install python3.4-dev

@hiromipaw

This comment has been minimized.

Contributor

hiromipaw commented Mar 23, 2015

Oh great! I wanted to try this out just today. On OSX is a bit more complicated and I have been delayed. Will update tomorrow if that's ok.

@almet

This comment has been minimized.

Contributor

almet commented Mar 26, 2015

sure, just let us know :)

@hiromipaw

This comment has been minimized.

Contributor

hiromipaw commented Mar 26, 2015

Sorry for being late. Got sick this week and got delayed :) I have updated the docs. On a side note I would also add tox to the dev-requirements.txt

@hiromipaw hiromipaw changed the title from [WIP] Dev env setup to Dev env setup Mar 30, 2015

@almet

This comment has been minimized.

Contributor

almet commented Apr 2, 2015

Thanks a lot! It's now merged :-)

almet added a commit that referenced this pull request Apr 2, 2015

@almet almet merged commit f559068 into mozilla-services:master Apr 2, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

glasserc pushed a commit that referenced this pull request May 20, 2016

glasserc pushed a commit that referenced this pull request May 20, 2016

glasserc pushed a commit that referenced this pull request May 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment