Skip to content

Commit

Permalink
global: initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
lnielsen committed Feb 20, 2018
0 parents commit fa36368
Show file tree
Hide file tree
Showing 34 changed files with 3,113 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .editorconfig
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

root = true

[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Python files
[*.py]
indent_size = 4
# isort plugin configuration
known_first_party = pytest_invenio
multi_line_output = 2
default_section = THIRDPARTY
skip = .eggs

# RST files (used by sphinx)
[*.rst]
indent_size = 4

# CSS, HTML, JS, JSON, YML
[*.{css,html,js,json,yml}]
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_size = 2

# Dockerfile
[Dockerfile]
indent_size = 4
62 changes: 62 additions & 0 deletions .gitignore
@@ -0,0 +1,62 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# Idea software family
.idea/

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Vim swapfiles
.*.sw?
88 changes: 88 additions & 0 deletions .travis.yml
@@ -0,0 +1,88 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

addons:
chrome: stable # https://docs.travis-ci.com/user/chrome

dist: trusty # Chrome driver fails if not trusty dist

notifications:
email: false

# Chrome Webdriver fails if not on sudo
# See https://github.com/travis-ci/travis-ci/issues/8836
sudo: true

language: python

matrix:
fast_finish: true

cache:
- pip

env:
global:
- E2E_OUTPUT=base64
- ES_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.4.tar.gz
matrix:
- REQUIREMENTS=lowest
- REQUIREMENTS=release DEPLOY=true
- REQUIREMENTS=devel

python:
- "2.7"
- "3.5"

before_install:
# Download and start ES
- "mkdir /tmp/elasticsearch"
- "wget -O - $ES_URL | tar xz --directory=/tmp/elasticsearch --strip-components=1"
- "/tmp/elasticsearch/bin/elasticsearch &"
# Chrome webdriver for Selenium
- "PATH=$PATH:$HOME/webdrivers"
- "if [ ! -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"
# Install packages
- "travis_retry pip install --upgrade pip setuptools py"
- "travis_retry pip install twine wheel coveralls requirements-builder"
- "requirements-builder -e all --level=min setup.py > .travis-lowest-requirements.txt"
- "requirements-builder -e all --level=pypi setup.py > .travis-release-requirements.txt"
- "requirements-builder -e all --level=dev --req requirements-devel.txt setup.py > .travis-devel-requirements.txt"

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

before_script:
# https://docs.travis-ci.com/user/gui-and-headless-browsers/
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
# Allow ES and xvfb to start
- "sleep 10"

script:
- "./run-tests.sh"

after_success:
- coveralls

deploy:
provider: pypi
user: inveniosoftware
password:
secure: TODO:PYPISECUREHASH
distributions: "sdist bdist_wheel"
on:
tags: true
python: "3.5"
repo: inveniosoftware/pytest-invenio
condition: $DEPLOY = true
6 changes: 6 additions & 0 deletions AUTHORS.rst
@@ -0,0 +1,6 @@
Authors
=======

Pytest fixtures for Invenio.

- Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
6 changes: 6 additions & 0 deletions CHANGES.rst
@@ -0,0 +1,6 @@
Changes
=======

Version 0.1.0 (released TBD)

- Initial public release.
118 changes: 118 additions & 0 deletions CONTRIBUTING.rst
@@ -0,0 +1,118 @@
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/inveniosoftware/pytest-invenio/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

pytest-invenio could always use more documentation, whether as part of the
official pytest-invenio docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at
https://github.com/inveniosoftware/pytest-invenio/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `pytest-invenio` for local development.

1. Fork the `inveniosoftware/pytest-invenio` repo on GitHub.
2. Clone your fork locally:

.. code-block:: console
$ git clone git@github.com:your_name_here/pytest-invenio.git
3. Install your local copy into a virtualenv. Assuming you have
virtualenvwrapper installed, this is how you set up your fork for local
development:

.. code-block:: console
$ mkvirtualenv pytest-invenio
$ cd pytest-invenio/
$ pip install -e .[all]
4. Create a branch for local development:

.. code-block:: console
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.

5. When you're done making changes, check that your changes pass tests:

.. code-block:: console
$ ./run-tests.sh
The tests will provide you with test coverage and also check PEP8
(code style), PEP257 (documentation), flake8 as well as build the Sphinx
documentation and run doctests.

6. Commit your changes and push your branch to GitHub:

.. code-block:: console
$ git add .
$ git commit -s
-m "component: title without verbs"
-m "* NEW Adds your new feature."
-m "* FIX Fixes an existing issue."
-m "* BETTER Improves and existing feature."
-m "* Changes something that should not be visible in release notes."
$ git push origin name-of-your-bugfix-or-feature
7. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests and must not decrease test coverage.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring.
3. The pull request should work for Python 2.7, 3.3, 3.4 and 3.5. Check
https://travis-ci.org/inveniosoftware/pytest-invenio/pull_requests
and make sure that the tests pass for all supported Python versions.
36 changes: 36 additions & 0 deletions INSTALL.rst
@@ -0,0 +1,36 @@
Installation
============

pytest-invenio is on PyPI so all you need is:

.. code-block:: console
$ pip install pytest-invenio
Normally, you would add it to your package's ``setup.py`` to have it
automatically installed:

.. code-block:: python
setup(
# ...
setup_requires=[
'pytest-runner>=3.0.0,<5',
],
tests_require=[
'pytest-invenio>=1.0.0,<1.1.0',
]
)
**Tip**: Add the following alias to your ``setup.cfg``:

.. code-block:: ini
[aliases]
test = pytest
In this way, the standard Python way of executing test still works:

.. code-block:: console
$ python setup.py test
23 changes: 23 additions & 0 deletions LICENSE
@@ -0,0 +1,23 @@
Copyright (C) 2017 CERN.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

In applying this license, CERN does not waive the privileges and immunities
granted to it by virtue of its status as an Intergovernmental Organization or
submit itself to any jurisdiction.

0 comments on commit fa36368

Please sign in to comment.