Sistema de Apoio ao Processo Legislativo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Marcio Mazza 61d43c971d Adiciona script para atualizar código de produção 9 years ago
.tx Add transifex project config 10 years ago
base Adapt subnavs for master detail crud 9 years ago
comissoes Adiciona listagem ao crud mestre detalhe 9 years ago
compilacao Merge pull request #304 from interlegis/compilacao 9 years ago
crud Correção de falha ao fazer rebase 9 years ago
legacy Remove global e corrige alguns textos 9 years ago
lexml Define namespace em urls.py via app_name 9 years ago
locale Update translation files 10 years ago
materia Impede que seja adicionado dois autores iguais na matéria 9 years ago
norma Adiciona listagem ao crud mestre detalhe 9 years ago
painel Fix #281 9 years ago
parlamentares Crud autoria 9 years ago
protocoloadm Ao recarregar a tela da pesquisa traz nome do autor. 9 years ago
relatorios Substitui o formato de exibição do PDF de 'attachment;' para 'inline;' 9 years ago
requirements Move isort para test-requirements 9 years ago
sapl Merge pull request #282 from interlegis/217-refatora-pesquisa-materia-django-filter 9 years ago
scripts Adiciona script para atualizar código de produção 9 years ago
scripts_docker Muda porta do banco usado pelo docker 9 years ago
sessao Adiciona listagem ao crud mestre detalhe 9 years ago
static FIX Pesquisa Matéria 9 years ago
templates Crud numeracao 9 years ago
.coveragerc Add coverage config file 10 years ago
.gitignore Remove linha redundante do .gitignore 9 years ago
.travis.yml Add travis conf for basic tests 10 years ago
Dockerfile Muda o bower install para o docker compose 9 years ago
LICENSE.txt Adiciona GNU License ao projeto. FIX #148 9 years ago
README.rst Configura gunicorn para máquina de homologação/produção 9 years ago
check_qa.sh Adição de checagem de debug breakpoint e mais testes 9 years ago
conftest.py Simplifica conf do webtest (refatoração) 9 years ago
crispy_layout_mixin.py HOT FIX: checa se value is not None 9 years ago
docker-compose.yml Muda o bower install para o docker compose 9 years ago
fix_qa.sh Adiciona script para corrigir problemas de QA 9 years ago
gunicorn_start.sh Atualiza scripts de deploy da produção 9 years ago
manage.py Init 10 years ago
pytest.ini Move crud para crud.base 9 years ago
sapl_30-03-16.tar Muda porta do banco usado pelo docker 9 years ago
simple_gunicorn.sh Recupera IP dinamico para rodar gunicorn simples 9 years ago
test_and_check_qa.sh Move crud para crud.base 9 years ago
test_crispy_layout_mixin.py Usa arqs yaml para definição de layouts 9 years ago

README.rst

.. image:: https://badge.waffle.io/interlegis/sapl.png?label=ready&title=Ready
:target: https://waffle.io/interlegis/sapl
:alt: 'Stories in Ready'

***********************************************
SAPL - Legislative Process Support System
***********************************************

This page brings together useful information on the current development of
**SAPL - Sistema de Apoio ao Processo Legislativo** (Legislative Process Support System).

That means all information presented here applies only to **version 3.1** and greater.

For more information about the the project as a whole and the current working version of the system (2.5)
please visit the `project page at Interlegis wiki <https://colab.interlegis.leg.br/wiki/ProjetoSapl>`_.


Development Environment Installation
====================================

* Install the following system dependencies (command bellow for Ubuntu)::

sudo apt-get install git nginx python3-dev libpq-dev graphviz-dev graphviz \
pkg-config postgresql postgresql-contrib pgadmin3 python-psycopg2 nodejs npm \

sudo ln -s /usr/bin/nodejs /usr/bin/node

sudo npm install -g bower

* Setup git, following the instructions in https://help.github.com/articles/set-up-git.

* Fork and clone this repository, following the instructions in https://help.github.com/articles/fork-a-repo.

* If you don't have pip installed then execute the following instructions:

sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv

* Create a virtualenv using python 3 for the project and activate it.
If you use `virtualenvwrapper <https://virtualenvwrapper.readthedocs.org/en/latest/install.html#basic-installation>`_::

mkvirtualenv -p /usr/bin/python3 sapl

* Install python dependencies (run on the project root)::

pip install -r requirements/dev-requirements.txt

* Install bower dependencies (run on the project root)::

./manage.py bower install

* Install `PostgreSQL <https://help.ubuntu.com/community/PostgreSQL>`_ if you haven't already.

* Create a ``sapl`` role with:

- Password ``sapl``
- The privilege ``can create databases``
- A big expiration date (or infinite, using eg ``ALTER ROLE SAPL VALID UNTIL 'infinity';``)

* Create a database ``sapl`` with owner ``sapl``.

* Either run ``./manage.py migrate`` (for an empty database) or restore a database dump.

* In ``sapl/sapl`` directory create one file called ``.env``. Write the following attributes in it:

- DATABASE_URL = postgresql://USER:PASSWORD@HOST:PORT/NAME
- SECRET_KEY = Generate some key and paste here
- DEBUG = [True/False]
- EMAIL_USE_TLS = [True/False]
- EMAIL_PORT = [Set this parameter]
- EMAIL_HOST = [Set this parameter]
- EMAIL_HOST_USER = [Set this parameter]
- EMAIL_HOST_PASSWORD = [Set this parameter]

`Generate your secret key here <https://docs.djangoproject.com/es/1.9/ref/settings/#std:setting-SECRET_KEY>`_

Instructions for Translators
============================

We use `Transifex <https://www.transifex.com>`_ to manage the project's translations.
If you want to contribute, please setup an account there and request to join us at
the `Transifex SAPL Page <https://www.transifex.com/projects/p/sapl>`_.
Once your join request is accepted, you can start to translate.

To integrate the last translations on a working instance follow these steps:

* Follow the instructions at `Development Environment Installation`_.

* Install `Transifex Client <http://docs.transifex.com/client/config/>`_.

.. warning::
The Transifex Client stores passwords in plain text on the file ``~/.transifexrc``.

We personally prefer to log into Transifex website with social network credentials and change the password used for the client frequently.

* `Pull translations <http://docs.transifex.com/client/pull/>`_ or `push translations <http://docs.transifex.com/client/push/>`_ using the client. Pull only on a clean repo, i.e. commit your changes before pulling new translations.

* Run the program with ``.manage.py runserver`` and check the system to see the translations into effect.

.. note::
The browser language preference is used to choose the translations to display.


General implementation guidelines
=================================

Best practices
--------------

* Use English for all the code, commit messages and project docs.

* Commit messages following the standard 50/72 columns. Start every commit message with a verb in infinitive. For more info on this please check:

- Http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
- Http://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting

* Keep all code in standard PEP8 (without exceptions).

* Before every ``git push``:
- Run ``git pull --rebase`` (almost always).
- In exceptional cases simply use ``git pull`` to produce a merge.

* Before ``git commit``, always:
- Run ``./manage.py check``
- Run all tests with ``py.test`` at the root of the project tree

.. attention::
The database user ``sapl`` needs to have the permission ``create database`` in postgres for the tests to complete successfully

* If you're not part of the core team, fork the repo and submit pull requests.
All are welcome to contribute. Please make a separate pull request for each bugfix/new feature.

* New features are subject to approval, since they may impact a lot of people.
We suggest you open an issue to discuss new features. That can be made in Portuguese, as well as in English.


Tests
-----

* Write tests for all the functionality you implement.

* Keep the test coverage near 100%.

* To run all tests activate your virtualenv and issue these commands
**at the root of the repository**::

py.test

* To run the tests with coverage issue the command::

py.test --cov . --cov-report term --cov-report html && firefox htmlcov/index.html

* The first time you run the tests after a migration (``./manage.py migrate``) use the db recreation option.
This needs to be done only once::

py.test --create-db

Issues
------

* Open all issues about the current development version (3.1) at the
`Github Issue Tracker <https://github.com/interlegis/sapl/issues>`_.

* You can file issues in either Portuguese or English (at least for the time being).