Skip to content

Commit

Permalink
instance: pipenv
Browse files Browse the repository at this point in the history
* NEW Makes use of pipenv.
* BETTER Adapts deployment scripts.
* NEW Adds an homepage.

Signed-off-by: Peter Weber <[email protected]>
  • Loading branch information
rerowep authored and jma committed May 23, 2019
1 parent 9fb1035 commit de03c10
Show file tree
Hide file tree
Showing 26 changed files with 2,096 additions and 107 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.git
*.gitignore
.env

*.mo
*.pyc
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ target/

# Vim swapfiles
.*.sw?

# Celery Beat
celerybeat-schedule

# Environment variables
.env
34 changes: 12 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,11 @@ notifications:

language: python

matrix:
fast_finish: true

cache:
- pip

services:
- postgresql
- redis
- rabbitmq
addons:
postgresql: "9.6"
- docker

env:
global:
Expand All @@ -58,37 +51,34 @@ env:
# Enable end-to-end tests
- E2E=no
matrix:
- REQUIREMENTS=prod E2E=yes
- REQUIREMENTS=prod
- REQUIREMENTS=qa

python:
- "3.6"

before_install:
- mkdir /tmp/elasticsearch
- wget -O - https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.2.tar.gz | tar xz --directory=/tmp/elasticsearch --strip-components=1
- "/tmp/elasticsearch/bin/elasticsearch > /tmp/local-es.log &"
# Stop default travis services
- "sudo service mysql stop"
- "sudo service postgresql stop"
# Start docker services
- "docker-compose up -d"
# Chrome webdriver for Selenium
- "PATH=$PATH:$HOME/webdrivers"
- "if [ ${E2E} == 'yes' ] && [ ! -f $HOME/webdrivers/chromedriver ]; then wget https://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip -P $HOME/webdrivers; unzip -d $HOME/webdrivers $HOME/webdrivers/chromedriver_linux64.zip; fi"
- "nvm install 6; nvm use 6"
- "travis_retry pip install --upgrade pip setuptools py"
- "travis_retry pip install twine wheel coveralls requirements-builder"
- "cat requirements.txt > .travis-prod-requirements.txt"
- "requirements-builder -e all --level=pypi setup.py > .travis-qa-requirements.txt"
- "./scripts/bootstrap"
- "travis_retry pip install --upgrade setuptools py pipenv==2018.10.9"
- "travis_retry pip install twine wheel coveralls"

install:
- "travis_retry pip install -r .travis-${REQUIREMENTS}-requirements.txt"
- "travis_retry pip install -e .[all]"
- "./scripts/bootstrap --ci"

before_script:
# https://docs.travis-ci.com/user/gui-and-headless-browsers/
- "export DISPLAY=:99.0"
- "if [ ${E2E} == 'yes' ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi"
# Allow ES to start
- sleep 10
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 && echo "Elasticsearch is up!" || cat /tmp/local-es.log
# Allow services running inside docker to start
- "./docker/wait-for-services.sh"

script:
- ./run-tests.sh # E2E tests are skipped if E2E env is set to 'no'
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ recursive-include rero_ebooks *.json

# added by check_manifest.py
recursive-include deployment *.yml
include *.lock
include Pipfile
recursive-include rero_ebooks *.png
recursive-include rero_ebooks *.scss
44 changes: 44 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
Babel = ">=2.4.0"
dojson = ">=1.3.2"
Flask-BabelEx = ">=0.9.3"
invenio = {version = "~=3.0.0",extras = ["base", "metadata", "postgresql", "auth", "elasticsearch6" ]}
isbnlib = ">=3.9.1"
PyYAML = ">=3.13"
rero-ebooks = {editable = true,path = "."}
uwsgi = ">=2.0"
invenio-oaiharvester = {ref = "v1.0.0a4",git = "https://github.com/inveniosoftware/invenio-oaiharvester.git"}
invenio-oaiserver = "*"
pipenv = "*"
requests = ">=2.20.0"

[dev-packages]
Sphinx = ">=1.5.1"
check-manifest = ">=0.35"
isort = ">=4.3.5,<4.3.10"
mock = ">=2.0.0"
pydocstyle = ">=2.0.0"
pytest = ">=3.3.1"
pytest-cov = ">=2.5.1"
pytest-invenio = ">=1.0.2,<1.1.0"
pytest-mock = ">=1.6.0"
pytest-pep8 = ">=1.0.6"
pytest-random-order = ">=0.5.4"
pytest-runner = ">=3.0.0,<5"
requests = ">=2.20.0"
rero-ebooks = {editable = true,path = "."}

[requires]
python_version = "3.6"

[scripts]
test = "python setup.py test"
build_sphinx = "python setup.py build_sphinx"

[pipenv]
allow_prereleases = true
Loading

0 comments on commit de03c10

Please sign in to comment.