Skip to content

Commit

Permalink
Merge pull request #7 from smoia/doc/windows_install
Browse files Browse the repository at this point in the history
Doc/windows install
  • Loading branch information
vinferrer authored Oct 26, 2020
2 parents 51efe95 + 70346f5 commit ab932ee
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 76 deletions.
77 changes: 38 additions & 39 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ This will let you run the program with the latest modification, without requirin
If you want to check, type ``python --version`` in a terminal.


Linux, Mac and Windows developer installation
------------------------------------
Linux, Mac and Windows developer installation
---------------------------------------------

Be sure to have ``git`` and ``pip`` installed. Fork the phys2bids repository in GitHub, then open a terminal and run the following code to clone the forked repository and set it as your `origin`::

git clone https://github.com/{username}/phys2bids.git
# or in case you have an ssh key set up:
git clone [email protected]:{username}/phys2bids.git
git clone https://github.com/{username}/phys2bids.git
# or in case you prefer to use ssh:
git clone [email protected]:{username}/phys2bids.git

We also recommend to set up the physiopy/phys2bids repository as `upstream`.
In this way you can always keep your main branch up to date with the command `git pull upstream master`::

cd phys2bids
git remote add upstream https://github.com/physiopy/phys2bids.git
git pull upstream master
cd phys2bids
git remote add upstream https://github.com/physiopy/phys2bids.git
git pull upstream master


Basic installation
Expand All @@ -49,7 +49,7 @@ are already installed in your system.

Move into the ``phys2bids`` folder and execute the command::

pip3 install -e .
pip3 install -e .

Full developer installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -59,48 +59,47 @@ to collaborate with us, you can install ``phys2bids`` with all the other package

Move into the ``phys2bids`` folder and execute the command::

pip3 install -e .[all]
pip3 install -e .[all]

This will install:

- ``phys2bids`` as an editable package, which means that you can modify the program and run it without having to reinstall it every time!
- All the ``phys2bids`` dependencies.
- All the **interface** modules, that deal with the interfaces for all the file formats.
- All the **style** modules, such as ``flake8``, to help you linter the code!
- All the **documentation** modules, like ``sphinx``, so that you can build the docs locally before submitting them.
- All the **test** modules, like ``pytest``, in order for you to test your code locally before committing it!
- ``phys2bids`` as an editable package, which means that you can modify the program and run it without having to reinstall it every time!
- All the ``phys2bids`` dependencies.
- All the **interface** modules, that deal with the interfaces for all the file formats.
- All the **style** modules, such as ``flake8``, to help you linter the code!
- All the **documentation** modules, like ``sphinx``, so that you can build the docs locally before submitting them.
- All the **test** modules, like ``pytest``, in order for you to test your code locally before committing it!

Check your installation!
^^^^^^^^^^^^^^^^^^^^^^^^

Type the commands::

cd phys2bids/tests
cd phys2bids/tests
pytest

This will execute the tests locally and check that your phys2bids installation works properly.

.. code-block:: shell
pytest
=================================================================== test session starts ===================================================================
platform win32 -- Python 3.8.6, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: C:\Users\sento\phys2bids, configfile: setup.cfg
plugins: cov-2.10.1
collected 61 items
test_acq.py . [ 1%]
test_bids.py ................ [ 27%]
test_integration.py ... [ 32%]
test_phys2bids.py ... [ 37%]
test_physio_obj.py ....... [ 49%]
test_txt.py .................. [ 78%]
test_utils.py ........... [ 96%]
test_viz.py .x [100%]
================================================================= short test summary info =================================================================
XFAIL test_viz.py::test_plot_trigger
======================================================== 60 passed, 1 xfailed in 142.58s (0:02:22) ========================================================
Do Not worry about the xfail error in the test_viz.py, this is only happening because at the moment we cannot run this test in our Continous integration workflow.
However if you do encounter any other error, check that you have all the extra dependencies install and contact us if necessary.
pytest
=================================== test session starts ===================================
platform win32 -- Python 3.8.6, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: C:\Users\sento\phys2bids, configfile: setup.cfg
plugins: cov-2.10.1
collected 61 items
test_acq.py . [ 1%]
test_bids.py ................ [ 27%]
test_integration.py ... [ 32%]
test_phys2bids.py ... [ 37%]
test_physio_obj.py ....... [ 49%]
test_txt.py .................. [ 78%]
test_utils.py ........... [ 96%]
test_viz.py .x [100%]
================================= short test summary info =================================
XFAIL test_viz.py::test_plot_trigger
======================== 60 passed, 1 xfailed in 142.58s (0:02:22) ========================
Do **not** worry if there is a xfail error in the log. This happens when we know that a test will fail for known reasons, and we are probably working to fix it (see `here <https://docs.pytest.org/en/latest/skipping.html#xfail-mark-test-functions-as-expected-to-fail>`_. However, if you do encounter any other error, check that you have all the extra dependencies installed and their version meets ``phys2bids`` requirements. Contact us on `gitter <https://gitter.im/physiopy/community>`_ if you need help!
51 changes: 14 additions & 37 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,30 @@ Install with ``pip``
Install ``phys2bids`` alone
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Pypi has the latest stable release of ``phys2bids`` as a package. Just run::
Pypi has the latest stable release of ``phys2bids`` as a package. Since we use ``auto`` to publish the latest features as soon as they are ready, it will *really* be the latest release. Just run::

pip3 install phys2bids

If you want the latest development version of the program, download the package from `github <https://github.com/physiopy/phys2bids>`_ and uncompress it.
Alternatively, if you have ``git``, use the command::

git clone https://github.com/physiopy/phys2bids.git

Open a terminal in the ``phys2bids`` folder and execute the command::

pip3 install .

Install extra modules
~~~~~~~~~~~~~~~~~~~~~

If you are planning to use file formats other than plain ``txt``, you need to install extra modules to have the right interface.
Extra modules installation can be done with the syntax::

pip3 install <package>[<extra>]
pip3 install phys2bids[<extra>]

Where ``<package>>`` is either ``phys2bids`` or ``.``, depending on whether you want to use ``pip`` or ``git`` for the installation, and ``<extra>`` is one of the following:
Where ``<extra>`` is one of the following:

- ``acq``: if you plan to use native AcqKnowledge files (``.acq`` extension)
- ``interfaces``: for all the interfaces above.

For instance, if you plan to install ``phys2bids`` and use all the interfaces, run::
For instance, if you plan to install ``phys2bids`` and use all of the interfaces, run::

pip3 install phys2bids[interfaces]

.. note::
If you "missed" or skipped this trick when you installed ``phys2bids`` the first time, don't worry!
You can do it any time - this will update ``phys2bids`` and install all the extra modules you want.
You can do it any time - this will update ``phys2bids`` and install all extra modules you want.


Install without ``pip``
Expand All @@ -94,39 +85,25 @@ Type the command::

phys2bids -v

If your output is: ``phys2bids 1.3.0-beta`` or similar, ``phys2bids`` is ready to be used.
If your output is: ``phys2bids 2.2.2`` or similar, ``phys2bids`` is ready to be used.

Windows installation
--------------------------
--------------------

First of all let's check you have python installed. Open a windows power shell window in ADMIN MODE and type::
First of all let's check you have python installed. Open a windows power shell window in **admin mode** and type::

python --version

In case you don't have it, either install it from this link https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l?activetab=pivot:overviewtab or type the command::
In case you don't have it, either install it from `here <https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l?activetab=pivot:overviewtab>`_ or type the command::

python

It will redirect you to the windows store python install (in the creation of this tutorial the newest version of python was 3.8).

Once python is installed, you can either install phys2bids directly with pip::

pip install phys2bids
.. warning::
``phys2bids`` supports Python 3.6 and later versions. We can't guarantee it will work if you use python 2.

If you want the latest development version of the program, download the package from `github <https://github.com/physiopy/phys2bids>`_ and uncompress it.
Alternatively, if you have ``git``, use the command::

git clone https://github.com/physiopy/phys2bids.git
Once python is installed, you can follow the instructions to install ``phys2bids`` reported `above <#install-with-pip>`_

Open a terminal in the ``phys2bids`` folder in ADMIN MODE and execute the command::

pip install .
# or if you want all the extra dependencies installed:
pip install .[all]

Check your installation!
^^^^^^^^^^^^^^^^^^^^^^^^

Type the command::

phys2bids -v
.. note::
Remember to open a terminal in **admin mode** to install libraries!

0 comments on commit ab932ee

Please sign in to comment.