Skip to content

Commit

Permalink
Added Tox and Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuluPro committed Sep 28, 2015
1 parent bee462e commit f17310e
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 47 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: python
services: mysql
sudo: false
python: "2.7"

env: TOX_ENV=py2.7-rl32-django1.8

install:
- pip install tox
- tox -e $TOX_ENV -- pip install coveralls
script: tox -e $TOX_ENV
after_success: tox -e $TOX_ENV -- coveralls $COVERALLS_OPTION
58 changes: 58 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,62 @@
=========
Django-CV
=========

.. image :: https://travis-ci.org/ZuluPro/django-cv.svg?branch=master
:target: https://travis-ci.org/ZuluPro/django-cv
.. image:: https://coveralls.io/repos/ZuluPro/django-cv/badge.svg?branch=master
:target: https://coveralls.io/r/ZuluPro/django-cv?branch=master

.. image:: https://landscape.io/github/ZuluPro/django-cv/master/landscape.svg?style=flat
:target: https://landscape.io/github/ZuluPro/django-cv/master
:alt: Code Health

Django application for manage and export your resume.

Install
=======

::

python setup.py install
git+git://github.com/ojii/pymaging.git#egg=pymaging
git+git://github.com/ojii/pymaging-png.git#egg=pymaging-png

Edit your ``settings.py`` for add ``curriculum`` to ``INSTALLED_APPS``: ::

INSTALLED_APPS = (
...
'curriculum',
...
)


Usage
=====

All data can be filled in Django's administration site or by custom way.
Export is made with views:

- ``curriculum.views.export_single_page``: For create a single page resume
- ``curriculum.views.export_classic``: For create a classic resume

Tests
=====

You can run tests with Tox: ::

tox -e py2.7-rl32-django1.8

Try it quickly
==============

Install it as describe above and launch the following commands: ::

pip install django
python tests/runtests.py migrate
python tests/runtests.py createsuperuser
# Create your login and password
python tests/runtests.py runserver 0.0.0.0:8080

Now you can go to http://0.0.0.0:8080 and try the app.
6 changes: 4 additions & 2 deletions curriculum/admin/modeladmins.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ResumeAdmin(admin.ModelAdmin):
('resume', 'image'),
('phone', 'email', 'website'),
('country', 'city', 'address'),
('skype', 'stackoverflow', 'github'),
('linkedin', 'skype', 'stackoverflow', 'github'),
('driving_license', 'hobbies'),
'tags',
)
Expand Down Expand Up @@ -47,7 +47,9 @@ class CertificationItemAdmin(admin.ModelAdmin):

class ExperienceAdmin(admin.ModelAdmin):
form = forms.ExperienceForm
list_display = ('title', 'entreprise', 'resume', 'weight')
list_display = ('title', 'entreprise', 'start_year', 'start_month',
'end_year', 'end_month',
'resume', 'weight')
fieldsets = (
(None, {
'fields': (
Expand Down
1 change: 1 addition & 0 deletions curriculum/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Migration(migrations.Migration):
('tags', models.CharField(max_length=500, verbose_name='tags', blank=True)),
('skype', models.CharField(max_length=100, verbose_name='Skype ID', blank=True)),
('twitter', models.CharField(max_length=100, verbose_name='Twitter', blank=True)),
('linkedin', models.CharField(max_length=100, verbose_name='LinkedIn ID', blank=True)),
('stackoverflow', models.IntegerField(verbose_name='StackOverflow ID', blank=True)),
('github', models.CharField(max_length=300, verbose_name='GitHub ID', blank=True)),
],
Expand Down
1 change: 1 addition & 0 deletions curriculum/models/resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Resume(models.Model):

skype = models.CharField(max_length=100, blank=True, verbose_name=_("Skype ID"))
twitter = models.CharField(max_length=100, blank=True, verbose_name=_("Twitter"))
linkedin = models.CharField(max_length=100, blank=True, verbose_name=_("LinkedIn ID"))
stackoverflow = models.IntegerField(blank=True, verbose_name=_("StackOverflow ID"))
github = models.CharField(max_length=300, blank=True, verbose_name=_("GitHub ID"))

Expand Down
84 changes: 48 additions & 36 deletions curriculum/templates/classic.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<tr>
<td style="width: 330px">
{% if resume.image %}
<img height="120" width="120" src="{{ resume.image.url }}"/>
<img height="120" width="120" src="{{ resume.image.url }}"/>
{% endif %}
</td>
<td class="center">
Expand All @@ -63,46 +63,58 @@ <h1 class="h1">{{ resume.firstname }} {{ resume.lastname }}<br>{{ resume.title }
</td>
</tr>
</table>
<hr class=separator>
<h2 class="center h2">{% trans "Skills" %}</h2>
{% for skill in skills %}
{% ifchanged skill.category %}
<h3 class="h3">{{ skill.category|capfirst }}</h3>
{% endifchanged %}
{{ skill }},
{% endfor %}
{% if skills %}
<hr class=separator>
<h2 class="center h2">{% trans "Skills" %}</h2>
{% for skill in skills %}
{% ifchanged skill.category %}
<h3 class="h3">{{ skill.category|capfirst }}</h3>
{% endifchanged %}
{{ skill }},
{% endfor %}
{% endif %}

<hr class=separator>
<h2 class="center h2">{% trans "Projects" %}</h2>
{% for project in projects %}
<h3 class="h3">{{ project.project.title }} <small>{% daterange_display project.start_year project.start_month project.end_year project.end_month %}</small></h3>
{{ project.contribution|linebreaksbr }}
{% endfor %}
{% if projects %}
<hr class=separator>
<h2 class="center h2">{% trans "Projects" %}</h2>
{% for project in projects %}
<h3 class="h3">{{ project.project.title }} <small>{% daterange_display project.start_year project.start_month project.end_year project.end_month %}</small></h3>
{{ project.contribution|linebreaksbr }}
{% endfor %}
{% endif %}

<hr class=separator>
<h2 class="center h2">{% trans "Experiences" %}</h2>
{% for experience in experiences %}
<h3 class="h3">{{ experience }} <small>{% daterange_display experience.start_year experience.start_month experience.end_year experience.end_month %}</small></h3>
{{ experience.description|linebreaksbr }}
{% endfor %}
{% if experiences %}
<hr class=separator>
<h2 class="center h2">{% trans "Experiences" %}</h2>
{% for experience in experiences %}
<h3 class="h3">{{ experience }} <small>{% daterange_display experience.start_year experience.start_month experience.end_year experience.end_month %}</small></h3>
{{ experience.description|linebreaksbr }}
{% endfor %}
{% endif %}

<hr class=separator>
<h2 class="center h2">{% trans "Training" %}</h2>
{% for training in trainings %}
<h3 class="h3">{{ training.degree }} in {{ training.topic }} <small>{% daterange_display training.year training.month %}</small></h3>
{{ training.description|linebreaksbr }}
{% endfor %}
{% if trainings %}
<hr class=separator>
<h2 class="center h2">{% trans "Training" %}</h2>
{% for training in trainings %}
<h3 class="h3">{{ training.degree }} in {{ training.topic }} <small>{% daterange_display training.year training.month %}</small></h3>
{{ training.description|linebreaksbr }}
{% endfor %}
{% endif %}

<hr class=separator>
<h2 class="center h2">{% trans "Certifications" %}</h2>
{% for certification in certifications %}
<h3 class="h3">{{ certification }} <small>{% daterange_display certification.start_year certification.start_month %}</small></h3>
{{ certification.certification.description|linebreaksbr }}
{% endfor %}
{% if certifications %}
<hr class=separator>
<h2 class="center h2">{% trans "Certifications" %}</h2>
{% for certification in certifications %}
<h3 class="h3">{{ certification }} <small>{% daterange_display certification.start_year certification.start_month %}</small></h3>
{{ certification.certification.description|linebreaksbr }}
{% endfor %}
{% endif %}

<hr class=separator>
<h2 class="center h2">{% trans "Hobbies" %}</h2>
{{ resume.hobbies|linebreaksbr }}
{% if resume.hobbies %}
<hr class=separator>
<h2 class="center h2">{% trans "Hobbies" %}</h2>
{{ resume.hobbies|linebreaksbr }}
{% endif %}
</div>
</body>
</html>
5 changes: 5 additions & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
factory-boy>=2.6
pep8
flake8
pylint
mock
coverage<4
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
xhtml2pdf
qrcode
git+git://github.com/ojii/pymaging.git#egg=pymaging
git+git://github.com/ojii/pymaging-png.git#egg=pymaging-png
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
from setuptools import setup, find_packages
import curriculum


def read_file(path):
with open(path, 'r') as fd:
return fd.read()

setup(
name='django-cv',
version=curriculum.__version__,
url=curriculum.__url__,
description=curriculum.__doc__,
long_description=open('README.rst').read(),
long_description=read_file('README.rst'),
author=curriculum.__author__,
author_email=curriculum.__email__,
license=curriculum.__license__,
Expand All @@ -15,7 +20,6 @@
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Environment :: Console',
'Framework :: Django',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
Expand All @@ -24,14 +28,14 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
# 'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.2',
# 'Programming Language :: Python :: 3.3',
# 'Programming Language :: Python :: 3.4',
'Framework :: Django',
],
packages=find_packages(exclude=['tests.runtests.main']),
include_package_data=True,
test_suite='tests.runtests.main',
install_requires=[],
install_requires=read_file('requirements.txt').splitlines(),
)
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
envlist = py{2.7,pypy,3.2,3.3,3.4,3.5}-rl{27,30,31,32}-django{1.7,1.8,1.9}

[testenv]
passenv = *
basepython =
py2.7: python2.7
pypypy: pypy
py3.2: python3.2
py3.3: python3.3
py3.4: python3.4
py3.5: python3.5
deps =
git+git://github.com/ojii/pymaging.git#egg=pymaging
git+git://github.com/ojii/pymaging-png.git#egg=pymaging-png
-r{toxinidir}/requirements-tests.txt
r27: reportlab>=2.7,<3.0
r30: reportlab>=3.0,<3.1
r31: reportlab>=3.1,<3.2
r32: reportlab>=3.2,<3.3
django1.7: Django>=1.7,<1.8
django1.8: Django>=1.8,<1.9
django1.9: Django>=1.9,<1.10
commands = {posargs:coverage run {toxinidir}/tests/runtests.py}

0 comments on commit f17310e

Please sign in to comment.