From 824060bc7abb23fa5e4f26e5f385eee36448eeec Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Wed, 5 Dec 2018 22:15:20 +0100 Subject: [PATCH] Update contributing and readme to xapian dependency --- CONTRIBUTING.md | 20 +++++++++++--------- README.md | 32 +++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d68371e..a2fd3bdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,24 +18,26 @@ Ensuite, tu fais : Avec cette commande, tu clones le sith AE dans le dossier courant. ```bash - cd Sith - virtualenv --clear --python=python3 env_sith - source env_sith/bin/activate - pip install -r requirements.txt +cd Sith +virtualenv --system-site-packages --python=python3 env_sith +source env_sith/bin/activate +pip install -r requirements.txt ``` +Attention aux dépendances système, à voir dans le README.md + Maintenant, faut passer le sith en mode debug dans le fichier de settings personnalisé. ```bash - echo "DEBUG=True" > sith/settings_custom.py - echo 'EXTERNAL_RES = "False"' >> sith/settings_custom.py - echo 'SITH_URL = "localhost:8000"' >> sith/settings_custom.py +echo "DEBUG=True" > sith/settings_custom.py +echo 'EXTERNAL_RES = "False"' >> sith/settings_custom.py +echo 'SITH_URL = "localhost:8000"' >> sith/settings_custom.py ``` Enfin, il s'agit de créer la base de donnée de test lors de la première utilisation ```bash - ./manage.py setup +./manage.py setup ``` Et pour lancer le sith, tu fais `python3 manage.py runserver` @@ -50,7 +52,7 @@ Pour uniformiser le formattage du code nous utilisons [Black](https://github.com Installation de black: ```bash - pip install black +pip install black ``` ## Sous VsCode: diff --git a/README.md b/README.md index fb459574..b8804063 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ To start working on the project, just run the following commands: - git clone https://ae-dev.utbm.fr/ae/Sith.git - cd Sith - virtualenv --clear --python=python3 env - source env/bin/activate - pip install -r requirements.txt - ./manage.py setup +```bash +git clone https://ae-dev.utbm.fr/ae/Sith.git +cd Sith +virtualenv --system-site-packages --python=python3 env +source env/bin/activate +pip install -r requirements.txt +./manage.py setup +``` To start the simple development server, just run `python3 manage.py runserver` @@ -36,17 +38,25 @@ already. You can check all of them with: -``` +```bash sudo apt install libmysqlclient-dev libssl-dev libjpeg-dev zlib1g-dev python3-dev libffi-dev python3-dev libgraphviz-dev pkg-config python3-xapian ``` +On macos, you will need homebrew + +```bash +brew install --build-from-source xapian --with-python +``` + +If it doesn't work it's because it need [this pull request](https://github.com/Homebrew/homebrew-core/pull/34835) to be validated. + The development is done with sqlite, but it is advised to set a more robust DBMS for production (Postgresql for example) ### Collecting statics for production: We use scss in the project. In development environment (DEBUG=True), scss is compiled every time the file is needed. For production, it assumes you have already compiled every files and to do so, you need to use the following commands : -``` +```bash ./manage.py collectstatic # To collect statics ./manage.py compilestatic # To compile scss in those statics ``` @@ -75,9 +85,9 @@ appropriate group fields, or the right method to check user permissions. #### Counting the number of line of code -``` -# apt install cloc -$ cloc --exclude-dir=doc,env . +```bash +sudo apt install cloc +cloc --exclude-dir=doc,env . ``` #### Updating doc/SYNTAX.md