Skip to content

Commit

Permalink
Merge f9bd43f into 8a2580c
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Aug 28, 2020
2 parents 8a2580c + f9bd43f commit 3612e25
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -48,13 +48,16 @@ python:
- "3.6"

before_install:
# Upgrade Travis `numpy` version: default is vulnerable and pipenv check will fail otherwise
- pip uninstall numpy -y
- pip install --ignore-installed "numpy>=1.18"
# Stop the services running by default on travis
- "sudo service mysql stop"
- "sudo service postgresql stop"
# 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"
- "nvm install 14.0.0; nvm use 14.0.0"
- "travis_retry pip install --upgrade pip setuptools py pipenv"
- "travis_retry pip install cookiecutter twine wheel coveralls sphinx"

Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.project_shortname}}/Dockerfile
Expand Up @@ -17,6 +17,9 @@ COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH}

RUN pip install . && \
invenio collect -v && \
# Dirty solution to create templates folder (Needed)
mkdir /opt/invenio/var/instance/assets && \
mkdir /opt/invenio/var/instance/assets/templates && \
invenio webpack create && \
# --unsafe needed because we are running as root
invenio webpack install --unsafe && \
Expand Down
4 changes: 4 additions & 0 deletions {{cookiecutter.project_shortname}}/MANIFEST.in
Expand Up @@ -35,6 +35,10 @@ recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include {{ cookiecutter.package_name }} *.config
recursive-include {{ cookiecutter.package_name }} *.less
recursive-include {{ cookiecutter.package_name }} *.overrides
recursive-include {{ cookiecutter.package_name }} *.variables
recursive-include {{ cookiecutter.package_name }} *.gitkeep
recursive-include {{ cookiecutter.package_name }} *.po *.pot *.mo
recursive-include {{ cookiecutter.package_name }} *.json *.html *.js *.scss
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_shortname}}/Pipfile
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
Babel = ">=2.4.0"
Flask-BabelEx = ">=0.9.3"
invenio = { version = ">=3.4.0a1,<3.5.0", extras = ["base", "auth", "metadata", "files", "{{ cookiecutter.database }}", "elasticsearch{{ cookiecutter.elasticsearch }}" ]}
lxml = ">=3.5.0,<4.2.6"
lxml = ">=4.3.0,<5.0.0"
marshmallow = ">=3.0.0,<4.0.0"
uwsgi = ">=2.0"
uwsgi-tools = ">=1.1.1"
Expand All @@ -20,7 +20,7 @@ Flask-Debugtoolbar = ">=0.10.1"
isort = ">=4.3"
mock = ">=2.0.0"
pydocstyle = ">=2.0.0"
pytest = ">=3.3.1"
pytest = ">=3.3.1, <6.0.0"
pytest-cov = ">=2.5.1"
pytest-invenio = ">=1.2.1,<1.3.0"
pytest-mock = ">=1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_shortname}}/run-tests.sh
Expand Up @@ -3,7 +3,7 @@

pipenv check && \
pipenv run pydocstyle {{ cookiecutter.package_name }} tests docs && \
pipenv run isort -rc -c -df && \
pipenv run isort . --check-only --diff && \
pipenv run check-manifest --ignore ".travis-*,docs/_build*" && \
pipenv run sphinx-build -qnNW docs docs/_build/html && \
pipenv run test
20 changes: 12 additions & 8 deletions {{cookiecutter.project_shortname}}/scripts/bootstrap
Expand Up @@ -2,28 +2,32 @@
{% include 'misc/header.py' %}
set -e


{% raw %}
script_path=$(dirname "$0")
pipfile_lock_path="$script_path/../Pipfile.lock"

# START: PUT ME BACK
# if [ ! -f $pipfile_lock_path ]; then
# echo "'Pipfile.lock' not found. Generating via 'pipenv lock --dev'..."
# pipenv lock --dev
# fi
if [ ! -f $pipfile_lock_path ]; then
echo "'Pipfile.lock' not found. Generating via 'pipenv lock --dev'..."
pipenv lock --dev --pre
fi

# # Installs all packages specified in Pipfile.lock
# pipenv sync --dev
# Installs all packages specified in Pipfile.lock
pipenv sync --dev
# /END: PUT ME BACK

# START: REMOVE ME
pipenv run pip install -e git+https://github.com/inveniosoftware/invenio.git#egg=invenio["base","auth","metadata","files","postgresql","elasticsearch7"]
# pipenv run pip install -e git+https://github.com/inveniosoftware/invenio.git#egg=invenio["base","auth","metadata","files","postgresql","elasticsearch7"]
# /END: REMOVE ME

# Install application code and entrypoints from 'setup.py'
pipenv run pip install -e $script_path/..

# Build assets
pipenv run invenio collect -v
# Dirty solution to create templates folder (Needed)
mkdir $(pipenv --venv)/var/instance/assets/
mkdir $(pipenv --venv)/var/instance/assets/templates
pipenv run invenio webpack buildall

{% endraw %}
Expand Up @@ -6,5 +6,5 @@
def test_frontpage(live_server, browser):
"""Test retrieval of front page."""
browser.get(url_for('invenio_theme_frontpage.index', _external=True))
assert "Welcome to {{cookiecutter.project_name}}." == browser.find_element_by_class_name(
'marketing').find_element_by_tag_name('h1').text
assert "Welcome to {{cookiecutter.project_name}}." == browser.find_element_by_id(
'frontpage-h1').text
Expand Up @@ -10,7 +10,8 @@
themes={
'semantic-ui': dict(
entry={
'{{ cookiecutter.project_shortname }}-search-app': './js/{{ cookiecutter.package_name }}/search_app_customizations.js',
'{{ cookiecutter.project_shortname }}-search-app':
'./js/{{ cookiecutter.package_name }}_records/search_app_customizations.js',
},
dependencies={
"react": "^16.9.0",
Expand Down
@@ -0,0 +1,3 @@
{% include 'misc/header.js' %}

@import "../../theme.less";
@@ -0,0 +1,3 @@
{% include 'misc/header.js' %}

@import "../../variables.less";
@@ -0,0 +1,96 @@
{% include 'misc/header.js' %}

/*

████████╗██╗ ██╗███████╗███╗ ███╗███████╗███████╗
╚══██╔══╝██║ ██║██╔════╝████╗ ████║██╔════╝██╔════╝
██║ ███████║█████╗ ██╔████╔██║█████╗ ███████╗
██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██╔══╝ ╚════██║
██║ ██║ ██║███████╗██║ ╚═╝ ██║███████╗███████║
╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝

*/

/*******************************
Theme Selection
*******************************/

/* To override a theme for an individual element
specify theme name below
*/

/* Global */
@site : 'invenio';
@reset : 'default';

/* Elements */
@button : 'default';
@container : 'invenio';
@divider : 'default';
@flag : 'default';
@header : 'default';
@icon : 'default';
@image : 'default';
@input : 'invenio';
@label : 'default';
@list : 'default';
@loader : 'default';
@placeholder : 'default';
@rail : 'default';
@reveal : 'default';
@segment : 'invenio';
@step : 'default';

/* Collections */
@breadcrumb : 'default';
@form : 'default';
@grid : 'default';
@menu : 'invenio';
@message : 'default';
@table : 'default';

/* Modules */
@accordion : 'default';
@checkbox : 'default';
@dimmer : 'default';
@dropdown : 'default';
@embed : 'default';
@modal : 'default';
@nag : 'default';
@popup : 'default';
@progress : 'default';
@rating : 'default';
@search : 'default';
@shape : 'default';
@sidebar : 'default';
@sticky : 'default';
@tab : 'default';
@transition : 'default';

/* Views */
@ad : 'default';
@card : 'default';
@comment : 'default';
@feed : 'default';
@item : 'default';
@statistic : 'default';

/*******************************
Folders
*******************************/

/* Path to theme packages */
@themesFolder : 'themes';

/* Path to site override folder */
@siteFolder : '../../less/{{ cookiecutter.package_name }}/site';

/*******************************
Import Theme
*******************************/

@import (multiple) "~semantic-ui-less/theme.less";

@fontPath : "../../../themes/@{theme}/assets/fonts";

/* End Config */
@@ -0,0 +1 @@
{% include 'misc/header.js' %}
@@ -0,0 +1,8 @@
{% include 'misc/header.js' %}

/*-------------------
Invenio
--------------------*/

// Change this to change the branding color (frontpage, navbar, etc.)
// @brandColor : #793e8e;
Expand Up @@ -7,7 +7,7 @@
<div class="row">
<div class="column">
{%- endraw -%}
<h1 class="ui header centered">Welcome to {{cookiecutter.project_name}}.</h1>
<h1 id="frontpage-h1"class="ui header centered">Welcome to {{cookiecutter.project_name}}.</h1>
{%- raw -%}
</div>
</div>
Expand Down
Expand Up @@ -10,12 +10,15 @@
themes={
'semantic-ui': dict(
entry={
# CHANGE ME TO LESS '{{ cookiecutter.project_shortname }}-theme': './less/{{ cookiecutter.package_name }}/theme.less',
'{{ cookiecutter.project_shortname }}-theme': './less/{{ cookiecutter.package_name }}/theme.less',
'{{ cookiecutter.project_shortname }}-preview': './js/{{ cookiecutter.package_name }}/previewer.js',
},
dependencies={
# add any additional npm dependencies here...
}
)
},
aliases={
'../../theme.config$': 'less/{{ cookiecutter.package_name }}/theme.config',
},
),
}
)

0 comments on commit 3612e25

Please sign in to comment.