Skip to content

Tests: Add missing dependency and improve documentation #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ magics/__pycache__
build
dist
*.sublime-workspace
.idea/
# Ignore local virtual environment
venv/
.venv/

# Ignore static typing
.pytype
Expand Down
21 changes: 13 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ and "help wanted" is open to whoever wants to implement it.
Get Started!
------------

Ready to contribute? Here's how to set up `magics-python` for local development. Please note this documentation assumes
Ready to contribute? Here's how to set up ``magics-python`` for local development. Please note this documentation assumes
you already have `virtualenv` and `Git` installed and ready to go.

1. Fork the `magics-python` repo on GitHub.
1. Fork the ``magics-python`` repo on GitHub.
2. Clone your fork locally::

$ cd path_for_the_repo
Expand All @@ -58,21 +58,26 @@ you already have `virtualenv` and `Git` installed and ready to go.
This should change the shell to look something like
(magics-python-env) $

4. Install system dependencies as described in the README.rst file then install a known-good set of python dependencies and the your local copy with::
4. Install program and dependencies as described in the README.rst file then install a known-good set of Python dependencies and the your local copy with::

$ pip install -r ci/requirements-tests.txt
$ pip install -e .
$ pip install --editable=.
$ pip install -r tests/requirements.txt

5. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

6. The next step would be to run the test cases. `magics-python` uses py.test, you can run PyTest. Before you run pytest you should ensure all dependancies are installed::
6. The next step would be to run the test cases. ``magics-python`` uses py.test, you can run PyTest::

$ pip install -r ci/requirements-dev.txt
$ pytest -v --flakes
# First, install some fixtures the test suite needs to run.
$ git clone --depth 1 https://github.com/ecmwf/magics-test.git
$ export MAGICS_PYTHON_TESTS=magics-test/test/gallery

# Invoke test suite.
export MAGPLUS_HOME=/usr/local/opt/magics-4.9.3
$ pytest -vvv --flakes

7. Before raising a pull request you should also run tox. This will run the tests across different versions of Python::

Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ You may run a simple selfcheck command to ensure that your system is set up corr
Found: Magics '4.0.0'.
Your system is ready.

If it does not work out of the box, try setting up the path to your MagPlus installation beforehand::

$ export MAGPLUS_HOME=/usr/local/opt/magics-4.9.3


Usage
-----
Expand All @@ -55,8 +59,6 @@ a 2m temperature grib file::

You may try out the high level API in a python interpreter::



from Magics import macro as magics

name = 'magics'
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest
pytest-flakes
xarray
scipy
cftime