Skip to content

Commit

Permalink
Release 0.2 to mangaki.fr (#381)
Browse files Browse the repository at this point in the history
* requirements: move pandas, sklearn to production due to DPP recent introduction (#262)

* Link to meta.mangaki.fr deleted (#266)

* Add all recommendation algorithms to production (#265)

* Unify KNN

* Add __init__.py in test folder

* Allow ANY algorithm in production

* Take reviews into account

* Last changes

* Create Dataset class and fit_algo management command (#268)

* Factorize algorithms, create Dataset class and fit_algo management command

* Fix bug

* Remove useless code

* Add migration (#269)

* Add new class RecommendationAlgorithm and refactor algorithms (#270)

* Add new class RecommendationAlgorithm and refactor algorithms

* Fix typo, BTW this PR fixes #267

* Add comment

* Cleanup

* nb_users and nb_works are instance attributes

* Add a template for settings.ini (#272)

* Remove first_name and last_name from Artist (#271)

* Remove first_name and last_name from Artist

* Remove from model as well

* Enable anonymous user to rate works (#277)

This is a first step towards the resolution of #59. It allows
anonymous users to rate works, and keeps the state of the rated works
across consecutive page loads in Django's session.

For now, the usage of this information is limited: although anonymous
user can rate works, they cannot get recommendations from those
ratings, transfer them to a new or existing account, etc. Support for
these will come in subsequent patches.

* Fix path of pickle files (broken so far) (#273)

* Since TensorFlow 1.0, MangakiWALS models cannot be saved anymore

* Fix pickle path everywhere

* Add minimal test for recommendations

* Fix unused parameter

* Enable anonymous users to get recommendations (#278)

This is a second step towards the resolution of #59. It allows
anonymous users to get recommendations (using the KNN algorithm only,
since we do not have trained models for them).

This is implemented by making the various algorithms take directly a
list or (user_id, work_id, choice) triplets instead of building those
from a queryset, as well as some glue to add the relevant triplets
from anonymous users at the interface between the database and the
algorithms themselves.

* Update seed data (unreviewed)

The seed_data.json was not updated after first_name and last_name were
removed from Artist. This fixes that.

* Simplify circle-ci integration (#281)

* Simplify circle config

* Fix matplotlib.pyplot

* Speculative improvements

* relative paths...

* Move coverarc to mangaki

* Try enabling test reports

* Test reports, take 2

* Parallel run is slower

* Remove the Profile.score field (#283)

This provides little information (especially considering how cryptic what it
does is), and the way it is computed gets in the way whenever we want to change
things relative to ratings.

Note that it would be easy to add this again if the needs arises as even though
the value is dynamically updated in various places, it is easy to re-compute it
from the sets of Suggestions and Recommendations the user submitted.

* Completely remove discourse from Mangaki (#282)

We are not using it anymore. Fixes #264.

* Allow import of anonymous ratings on account creation (#279)

Allow users without an existing account to import anonymous ratings upon
account creation.

The backend logic behind this is relatively simple and simply requires
overriding django-allauth's signup view to move the anonymous ratings from the
session to the database, associating them to the freshly created user.

On the frontend side, this adds:
 - On the signup page, if the user has made any anonymous ratings, we add a
   checkbox allowing them to import their ratings (active by default), as well
   as a condensed view of their existing ratings. This leverages the
   works_no_poster.html view and allows the user to change their anonymous
   ratings directly on the signup page if they wish to do so.

 - On the login page, if the user has made any anonymous ratings, we add a
   warning message telling them that they will lose their anonymous ratings
   upon login (even though technically, they lose it upon logging out) and that
   they should create a new account if they want to keep those ratings. In the
   future, this should be replaced with a mechanism to merge existing anonymous
   ratings with the user's existing ratings.

As a byproduct, this patch includes a slight re-design of the login and signup
pages, and changes the library we use for displaying bootstrap forms from
django-bootstrap-form to django-bootstrap3. django-bootstrap3 provides better
hooks to customize forms and made said re-design much easier than it would have
been with django-bootstrap-form (in addition, it is
[faster](zostera/django-bootstrap3#160))

* Enable AniDB testing through mocking using responses library (#285)

* tests: Enable AniDB testing through mocking using responses library

→ Minor fixes in `anidb.py` file (default arguments)
→ Add fixture directory and test fixture directory in settings.
→ Use test fixture directory to feed mocking (fresh fixture from AniDB!)
→ Test `AniDB.search`.
→ Test `AniDB.get_dict`.
→ Add AniDB constants inside the class for convenience purpose.
→ Reformatting and imports optimization.

* Some April cleanup! (#289)

* WorkList: use a property for `is_dpp`

* management command: fix analytics

* knn: fix constructor and reformat according to PEP8.

* chrono: remove unused keyword argument.

* imports: clean unused imports.

* knn: remove the ugly [\n and put a comment on its own line

* knn: moar formatting implementation

* management command: remove analytics

* anonymous-ratings: Review page, clear all ratings, remainder banner (#287)

* anonymous-ratings: Review page, clear all ratings, remainder banner

- Add a remainder banner of anonymous ratings.
- Add a review page by reusing `get_profile` view.
- Add a way to clear all ratings (ugly link)

* chore: reformat for better readability

* views: enforce POST to get CSRF token check and return proper JSON (#293)

* Reformat and remove useless classes in admin (#294)

* admin: reformat code and remove useless classes

* admin: improve code style

* perf/views: select category to prevent performance issue (#292)

* work-list: fetch int_poster also to prevent duplicated queries (#295)

* Update about and events (#286)

* Update about and events

* Add videos

* Fix Soubi and Elarnon

* Fix OpenGraph and Twittercard

* Okay, it was a bad idea

* Remove TensorFlow logging at once

* Let's forget about removing logging

* Factor recommendation algorithms to handle backups (#276)

* Since TensorFlow 1.0, MangakiWALS models cannot be saved anymore

* Fix pickle path everywhere

* Add minimal test for recommendations

* Fix unused parameter

* Add notebook for benchmarks for cold-start

* Fix KNN

* Add LinearRegression for cold-start

* Add MangakiProxyDPP

* Cleanup compare management command

* Edit experiment

* Add computation of delta and update for ALS

* Add BGS from Anava et al.'s WWW 2015 paper

* Fix BGS, withdraw paper from RecSys

* Fix NMF

* Add Autoencoder with TensorFlow

* Now users receive SVD if it exists, otherwise KNN

* Order whole rating list by any algorithm

* Finally manage those damn logs

* Add logging and fix paths

* Fix DPP and clean a lot of code

* Remove useless print

* Oops, forgot one file

* Fix problems linked to merge

* Add an admin interface for merging works (#299)

* Add an admin interface for merging works

* Factor code

* Add minor changes

* Fix bug, and Language to admin

* Take Raito changes into account

* Fix bugs and display number of ratings of each work

* [Hotfix] MAL imports (#301)

* mal-import: refactor the whole code into something more maintainable

- Fix doctor's fields and use MALEntry.
- MAL:
        - Refactor the whole module using a requests.Session and
          instantiating a MALClient which handles the API operations.
        - Rewrite the DB interaction to be more efficient and fix it in
          some edge cases.

* add a default user-agent

* mangaki: fix when MAL import is not available

* mal: add some tests and refactor duplicated / unused code

* mal: rewrite the doctests with None

* mal: add missing fixtures

* Hotfix, KNN did not work

* Improve MAL usage in Mangaki (#302)

* mal-import: refactor the whole code into something more maintainable

- Fix doctor's fields and use MALEntry.
- MAL:
        - Refactor the whole module using a requests.Session and
          instantiating a MALClient which handles the API operations.
        - Rewrite the DB interaction to be more efficient and fix it in
          some edge cases.

* add a default user-agent

* mangaki: fix when MAL import is not available

* mal: add some tests and refactor duplicated / unused code

* mal: rewrite the doctests with None

* mal: add missing fixtures

* MAL: add synonyms and prepare for genres / types

→ Make language a nullable field for WorkTitle.
→ Added the related migration.

* Hotfix profile page with user recommendations

* Hotfix MAL

* [Hotfix] Toggling ratings (+test!) (#306)

* Fix toggle rating and add test

* reducing current_user_set_toggle_rating does too many queries

* Upgrade to Django 1.11

* Revert "Upgrade to Django 1.11"

This reverts commit 4f58bc470afb395c22197ac2aecaff1b042a0b75.

Meant to ask for review ;-)

* Upgrade to Django 1.11 (#315)

* Add attribute research_ok to Profile (#316)

* Add attribute research_ok to Profile

* Handling tokens

* ADD TESTS §§§

* Add HASH_NACL to Circle settings

* ADD TESTS FOR REAL

* Remove print

* Use built-in Django functions for hashing

* Add token utils

* Salt is not a secret anymore

* Put salt at the correct place

* Fix settings

* Use None instead of 0 for anonymous user identifier.

Previously, we were using 0 for the identifier of an anonymous user,
except that it made us use a `current_user_id` variable for tracking
that and it was easy to just use (erroneously) `request.user.id`
instead.

Since there actually are no requirements on `current_user_id` being a
numeric value, this patch makes it so that we use `None` instead, since
that is the value of `user.id` for an anonymous user, and removes
`current_user_id` altogether.

Fixes #317.

* [Hotfix] Handle recommended ghost works (#323)

* Non-anonymous users don't have anonymous ratings (#324)

While we keep them until the session ends for technical reasons, they
shouldn't be shown.

* Ajout du meta description (#325)

* Add link in profile for sorting any wishlist (#326)

* Fix #322, one could not see their own profile if private

* Add link in profile for sorting any wishlist

* Send templated mail with tokens (#327)

* Fix CSS for footer navbar

* Fix error handling in the research view

* Send mails with tokens

* I mean everyone

* Add jinja2 to production requirements

* Add os.access

* List users in tokens mgmt command

* Only require tensorflow when needed (#329)

TensorFlow is only required by the WALS algorithm, and loading the
library has a prohibitive overhead on lower-powered devices. Let's only
load it when the WALS algorithm is needed, which for now is only when
running the algorithm, which shouldn't be done on the webserver anyways.

* Clarify questions for usage of ratings in Kyoto challenge (#330)

* Kill Doctor management command (#333)

* Better Ansible setup (#321)

This gives a relift to the Ansible setup, allowing several things that
were not included in the previous setup:

 - Possibility to provision a development machine (e.g. Vagrant box)
 - Possibility to easily dump & restore a database
 - Multi-site deployment (deployments are identified by name; except for
   some global nginx and postgresql configuration that shouldn't change
   anyways, care has been taken to ensure all other settings are
   properly isolated so that several deployments with different
   `mangaki_name` values can co-exist on the same machine)
 - git-free deployment; Mangaki can now be built as a PIP package that
   is copied to the remote machine for installation

This deployment is implemented as a single playbook that was made as
declarative as possible; tags and (Ansible's) environment variables
should be used to run the few actions that should be run (collectstatic,
dumping or loading a database, etc.)

* Remove unused test.css file. (#335)

Also, why did we have executable CSS files? WTF.

* Make French great again (space before '!' become  ) (#332)

* add   at good places and make french great again

* typography: add a missing  

* Improve drastically MAL import performance (#311)

* models(work,fts): add full text search fields for Work / WorkTitle

* mal: optimise the hell out of the MAL import procedure

- Use full text search to match all synonyms / titles to prevent
  duplicates.
- Get all existing ratings and then, deduce which ratings to add (not
  fully working, some ratings still appears even though they're already
  in DB!).
- Import your MAL at the speed of the light without any guarantee on
  future violations of theoretical physics.

- Possible improvements: batch full text search queries and deduce a
  subset of works to get from MAL (also figure out a good batch_size).

* migrations: add GIN indexes / triggers / ts vectors fields on Work / WorkTitle

* Address PR comments and correct a test using search

* mal: add some tests using hypothesis

Fix also a bug with empty synonyms fields.

* mal(tests): Use subtests for status code testing

* mal(utils): Explicit the class behind the namedtuple

* migrations: add merge migrations between research OK and MAL data

* Address PR comments

* House-keeping of gitignore and dependencies (#341)

* gitignore: ignore build files when packaging Mangaki

* djdt: bump to 1.8

* Add a data migration to fix MAL external posters (#347)

Move to new MAL's CDN.

* Reduce the amount of queries for ratings selection (#348)

* Load all ratings only at fitting time (recommendations) (#340)

* recommendations: load all ratings if only and only we will fit the algorithm (SVD, ALS, WALS, …)

* Proper handling of algo_name

* Add WorkCluster class for merging works (dedupe, suggestions, or merge from admin) (#307)

* Add WorkCluster to admin

* Add migration

* Allow call to merge from WorkCluster admin

* Add test for merge action

* Add all_objects manager and format_html

* Add migration file for manager

* Butchering migrations

* Make a better test for merging, in order to reduce the number of queries

* Cover all merge functions with tests, reduce the number of queries which was tremendous

* Resolve multiplication of migration leaves

* Cut line

* Use an array rather than string for source_domains on mangaki_dev group vars (#352)

* Kill /users route (#354)

* Kill /users route

* Remove user_list template

* Use timezone-aware now rather than naive datetime (#355)

* [Hotfix] Make posters refreshable once again (fix get_potential_poster) (#357)

* Add get_entry_from_work and fix get_potential_posters for admin

* Address PR comments

* Thanks Django ; I thought I didn't know how to compute in Boole's algebra.

* Remove moar useless comments

* Re-design the work cards (#331)

* Add ribbons displaying card category (#362)

Fixes #141

* Fill Language model and use it with AniDB and MAL (#338)

We add a data migration to support many AniDB and MAL languages, fixing the previous inability of administrators to edit languages of a WorkTitle.

Then, we make MAL import and AniDB API aware of these models so that they can attach more data to our works when operating (e.g. importing, adding new works in the DB).

Finally, we add a new administrator action to refresh WorkTitle of a work linked to AniDB, also its `ext_synopsis` which will be useful for l10n of Mangaki I suppose.

* Add migration for ext_lang / type of WorkTitle (#366)

Missing migration from last PR.

* Rewrite profile view (#364)

This new rewrite gives a huge boost of performance for profiles with a lot of works (1k+).

Also, it improves the privacy of profiles by not displaying information about the count of animes rated, and so on.

Finally, it is paginated and a bit more mobile-friendly that the previous version.

* Integrate Sentry (#350)

Now Mangaki supports Sentry integration, especially for beta.mangaki.fr.

It'll make it easier to track unexpected exceptions on the back-end.

* Add raven>=6.1.0 in setup.py (unreviewed)

* Move to INFO and add console to the root handler (#368)

Fixes Sentry reporting of views exception.

* Hotfix: do not show recommendations tab on anonymous profiles (#369)

* Add i18n in English and Japanese (#356)

Initial i18n of "about us" pages.

* Do not show alternative titles on work detail page (#371)

* Add AniDB to settings template (#372)

* Release the 0.2 (#361)

* s/jp/ja is the good way (#380)

* Forgotten s/jp/ja in base.html template (unreviewed)
  • Loading branch information
collinsmuriuki6kttx committed Apr 28, 2025
1 parent 60a3ac0 commit 70502ee
Show file tree
Hide file tree
Showing 237 changed files with 12,600 additions and 3,502 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ restore.sh
media
/provisioning/inventory
/provisioning/env_vars/
*.mo
.hypothesis
/mangaki/debug.log
14 changes: 0 additions & 14 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
Alexis Rivière <[email protected]>
Basile Clement <[email protected]> Basile Clément <[email protected]>
Benoît Fort <[email protected]>
cynddl <[email protected]> Cynddl <[email protected]>
Dylan Tanguy <[email protected]>
Emmanuel Gil Peyrot <[email protected]>
Erwan 'Nyquist' Milis <[email protected]>
fravoi <[email protected]>
Jill-Jênn Vie <[email protected]> Jill-Jênn Vie <[email protected]>
makoto1412 <[email protected]>
pierre <[email protected]>
Ryan Lahfa <[email protected]> Raito Bezarius <[email protected]>
Ryan Lahfa <[email protected]> Lahfa Ryan <[email protected]>
Soubi <[email protected]> Soubi <[email protected]>
vendethiel <[email protected]>
Xia Li-yao <[email protected]>
Étienne Simon <[email protected]>
28 changes: 14 additions & 14 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Alexis Rivière <[email protected]>
Basile Clement <[email protected]>
Benoît Fort <[email protected]>
cynddl <[email protected]>
Dylan Tanguy <[email protected]>
Emmanuel Gil Peyrot <[email protected]>
Erwan 'Nyquist' Milis <[email protected]>
fravoi <[email protected]>
Alexis Rivière
Basile Clement
Benoît Fort
Camille Poquet
Dylan Tanguy
Emmanuel Gil Peyrot
Erwan 'Nyquist' Milis
François Voisin
Jill-Jênn Vie <[email protected]>
makoto1412 <[email protected]>
pierre <[email protected]>
Luc Rocher
Pierre Vigier
Ryan Lahfa <[email protected]>
Soubi <[email protected]>
vendethiel <[email protected]>
Xia Li-yao <[email protected]>
Étienne Simon <[email protected]>
vendethiel
Li-yao Xia
Zeletochoy
Étienne Simon
197 changes: 197 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
# Mangaki v0.2

# New Features

## Public

- Translate "about us" page (#356) [Jill-Jênn Vie] and [Ryan Lahfa]

- Redesign the profile view (#364) [Ryan Lahfa]

- Add ribbons displaying card category (anime, manga, album) (#362) [Basile Clement]

- Re-design the work cards (#331) [Basile Clement]

- Send templated mail with tokens (#327) [Jill-Jênn Vie]

For the Kyoto Data Challenge, you should have received emails containing an opt-out link.

- Add link in profile for sorting any wishlist (#326) [Jill-Jênn Vie]

You can use our algorithms to sort your wishlist (SVD or ALS are available).

- Add attribute research_ok to Profile (#316) [Jill-Jênn Vie]

Enable people to opt-out from Kyoto Data Science challenge.

- Enable anonymous recommendations [Basile Clement] and [Ryan Lahfa]

Fixes #59. It allows anonymous users to rate works,
and keeps the state of the rated works across consecutive page loads
in Django's session.

Then, get recommendations (using KNN algorithm).

Finally, it is possible to sign up and load these ratings in your new account.

Next step is to handle social login and conflicts when logging in already existing accounts.
If you rate works anonymously and log in your account, you will lose your anonymous ratings.

References: #277, #278, #279, #287, #320, #324

- Updated about and events pages (#286) [Jill-Jênn Vie]

## Administration / Development

- Support Sentry (#350) [Ryan Lahfa]

- Better Ansible setup (#321) [Basile Clement]

This gives a relift to the Ansible setup, allowing several things that
were not included in the previous setup:

- Possibility to provision a development machine (e.g. Vagrant box)
- Possibility to easily dump & restore a database
- Multi-site deployment (deployments are identified by name; except for
some global nginx and postgresql configuration that shouldn't change
anyways, care has been taken to ensure all other settings are
properly isolated so that several deployments with different
`mangaki_name` values can co-exist on the same machine)
- git-free deployment; Mangaki can now be built as a PIP package that
is copied to the remote machine for installation

This deployment is implemented as a single playbook that was made as
declarative as possible; tags and (Ansible's) environment variables
should be used to run the few actions that should be run (collectstatic,
dumping or loading a database, etc.)

- Add WorkCluster class for merging works (dedupe, suggestions, or merge
from admin) (#307) [Jill-Jênn Vie]

- Add an admin interface for merging works (#299) [Jill-Jênn Vie]

# Improvement

## Algorithms

- Add all recommendation algorithms to production (#265) [Jill-Jênn Vie]

Also, introduced in #268 a new management command `fit_algo` to fit these algorithms locally and save a model.
Which is refactored in #270.

References: #265, #268, #270, #276.

## Tests

- Enable AniDB testing through mocking using responses library (#285)
[Ryan Lahfa]

## Performance

- Reduce the amount of queries for ratings selection (#348) [Ryan Lahfa]

- Improve drastically MAL import performance (#311) [Ryan Lahfa]

- Load all ratings only at fitting time (recommendations) (#340) [Ryan
Lahfa]

Now, recommendations should be faster on your local instance.

- Only require tensorflow when needed (#329) [Basile Clement]

TensorFlow is only required by the WALS algorithm, and loading the
library has a prohibitive overhead on lower-powered devices. Let's only
load it when the WALS algorithm is needed, which for now is only when
running the algorithm, which shouldn't be done on the webserver anyways.

- WorkList: fetch int_poster also to prevent duplicated queries (#295)
[Ryan Lahfa]

- Views: Select category to prevent duplicated queries (#292) [Ryan
Lahfa]

## Misc

- House-keeping of gitignore and dependencies (#341) [Ryan Lahfa]
(bump Django Debug Toolbar to 1.6 and clean the gitignore file)

- Ajout du meta description (#325) [Camille P]

- Upgrade to Django 1.11 (#315) [Basile Clement]

- Reformat and remove useless classes in admin (#294) [Ryan Lahfa]

Code cleanup.

- Some April cleanup! (#289) [Ryan Lahfa]

Random cleanup (PEP8, reformatting, etc.)

- Simplify circle-ci integration (#281) [Basile Clement]

- Add a template for settings.ini (#272) [Zeletochoy]

- Requirements: move pandas, sklearn to production due to DPP recent
introduction (#262) [Ryan Lahfa]

# Fixes

- Make French great again (space before '!' become &nbsp;) (#332) [Ryan
Lahfa]

- Update seed data (unreviewed) [Basile Clement]

The seed_data.json was not updated after first_name and last_name were
removed from Artist. This fixes that.

- Toggling ratings (#306) [Jill-Jênn Vie]

You may have been unable to "remove" (toggle) a rating, this should be fixed.

- Views: Enforce POST to get CSRF token check and return proper JSON
(#293) [Ryan Lahfa]

## MAL

- Add a data migration to fix MAL external posters (#347) [Ryan Lahfa]

- Improve MAL usage in Mangaki (#302) [Ryan Lahfa]

Refactor of MAL module, handle basic alternative titles de-duplication.

- MAL imports (#301) [Ryan Lahfa]

Some of you may have experienced broken MAL imports, from now on, you should be able to re-import your MAL.
Some works might still not appear on your profile, e.g. Code Geass: Fukkatsu no Lelouch.
This will be fixed definitely in 0.3.

## Vagrant

- Use an array rather than string for source_domains on mangaki_dev
group vars (#352) [Ryan Lahfa]

# Removed since v0.1.4.2

- Kill /users route (#354) [Ryan Lahfa]

- Remove unused test.css file. (#335) [Basile Clement]

- Kill Doctor management command (#333) [Ryan Lahfa]

- Completely remove discourse from Mangaki (#282) [Basile Clement]

We are not using it anymore. Fixes #264.

- Remove the Profile.score field (#283) [Basile Clement]

This provides little information (especially considering how cryptic what it
does is), and the way it is computed gets in the way whenever we want to change
things relative to ratings.

Note that it would be easy to add this again if the needs arises as even though
the value is dynamically updated in various places, it is easy to re-compute it
from the sets of Suggestions and Recommendations the user submitted.

- Remove first_name and last_name from Artist (#271) [Jill-Jênn Vie]

- Link to meta.mangaki.fr deleted (#266) [Camille P]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ l'application. Pour une installation de développement, il suffit de faire :
EOF

Si vous souhaitez mettre en production une instance de Mangaki, le fichier de
configuration est un peu plus complexe - regardez dans `mangaki/settings.py`
pour un aperçu des options utiles.
configuration est un peu plus complexe - regardez dans `settings.template.ini`
et `mangaki/settings.py` pour un aperçu des options utiles.

Remplir la base de données
--------------------------
Expand Down Expand Up @@ -103,7 +103,7 @@ Ceci va lancer les [doctests](https://docs.python.org/3.5/library/doctest.html)

Pour calculer la couverture de test, il faut plutôt faire:

coverage run ./mangaki/manage.py test --with-coverage --cover-package=mangaki,irl,discourse --cover-html
coverage run ./mangaki/manage.py test --with-coverage --cover-package=mangaki,irl --cover-html

Ainsi, vous aurez un dossier `cover` qui contiendra les informations de couverture en HTML.

Expand Down
33 changes: 25 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'time'

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
#

require_relative './provisioning/vagrant/key_authorization'

Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
#
config.vm.box = "debian/contrib-jessie64"

# Add the current user key inside the machine so that SSH is easy.
# (useful for running ansible on the VM)
authorize_key_for_root config, '~/.ssh/id_rsa.pub'
config.vm.synced_folder ".", "/vagrant"

config.vm.box = "debian/jessie64"
config.vm.provision "ansible" do |ansible|
ansible.inventory_path = "provisioning/inventories/vagrant/hosts"
ansible.playbook = "provisioning/site.yml"
ansible.extra_vars = {
mangaki_sync_migrate: true,
mangaki_sync_collectstatic: false,
mangaki_sync_load_seed: true,
}
end

# Provisioner for dumping the database
config.vm.provision "dumpdb", type: "ansible", run: "never" do |ansible|
ansible.inventory_path = "provisioning/inventories/vagrant/hosts"
ansible.playbook = "provisioning/site.yml"
ansible.tags = ['action']
ansible.extra_vars = {
mangaki_db_dump: true,
mangaki_db_dump_path_local: "pgdumps/vagrant/mangaki-#{Time.now.utc.iso8601}.pgdump",
}
end

config.vm.provision :shell, path: "provisioning/bootstrap.sh"
config.vm.network "private_network", ip: "192.168.33.10"

# Useful with: https://github.com/cogitatio/vagrant-hostsupdater
config.vm.hostname = "app.mangaki.dev"
config.vm.hostname = "mangaki.dev"
config.vm.provider "virtualbox" do |vb|
vb.name = "Mangaki"
end
Expand Down
37 changes: 8 additions & 29 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
---
machine:
timezone:
Europe/Paris
pre:
- wget https://s3.amazonaws.com/circle-downloads/circle-pyenv-python-3.5.1_1.0_amd64.deb
- sudo dpkg -i circle-pyenv-python-3.5.1_1.0_amd64.deb
- sudo apt-get update
- sudo apt-get install -y python3-numpy python3-psycopg2
environment:
MATPLOTLIBRC: tests
python:
version: 3.5.1
version: 3.5.2
dependencies:
pre:
# We want to use the system packages (NumPy, psycopg2), we remove the venv.
- rm -rf '/home/ubuntu/virtualenvs/venv-3.5.1'; pushd '/home/ubuntu/virtualenvs'; virtualenv -p python3.5 --system-site-package venv-3.5.1; popd
- pip install -U pip
post:
- pip install -r requirements/dev.txt
database:
override:
Expand All @@ -26,21 +16,10 @@ database:
- python mangaki/manage.py top director
test:
pre:
- python mangaki/manage.py collectstatic --no-input
- cd mangaki && python manage.py collectstatic --no-input
override:
# FIXME: Figure out how to configure this thing.
# - git lint --last-commit
# Must:
# - run inside of the root folder
# - tell to nosetests how to find tests.
# - get the coverage and store a XUnit format in the $CIRCLE_TESTS_REPORTS folder.
# - cover only the package we care about (e.g. no third-party, migrations).
- coverage run mangaki/manage.py test
mangaki
--with-coverage
--with-xunit
--xunit-file=$CIRCLE_TEST_REPORTS/nosetests.xml
--cover-package=mangaki,irl,discourse
- mkdir -p $CIRCLE_TEST_REPORTS/django
- cd mangaki && coverage run manage.py test --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/django/nosetests.xml
post:
# CodeCov MUST absolutely run in the project root folder
- bash <(curl -s https://codecov.io/bash)
- cd mangaki && coverage html -d $CIRCLE_ARTIFACTS
- cd mangaki && bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion fixtures/seed_data.json

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions .coveragerc → mangaki/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[run]
include = mangaki/mangaki/*, mangaki/irl/*, mangaki/discourse/*
source = mangaki, irl
omit = */tests/*.py, */migrations/*.py
plugins =
django_coverage_plugin

Expand All @@ -9,9 +10,5 @@ exclude_lines =
def __repr__
def __str__

omit =
mangaki/*/migrations/*
mangaki/tools/*

show_missing = True
skip_covered = True
Loading

0 comments on commit 70502ee

Please sign in to comment.