Skip to content

Commit

Permalink
Merge pull request #119 from EricCousineau-TRI/feature-venv
Browse files Browse the repository at this point in the history
install: Expose test + docs requirements, encourage use of virtualenv
  • Loading branch information
iMichka authored Jul 16, 2020
2 parents 486bc4d + 62d6d13 commit 4b3e42a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 11 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,12 @@ jobs:
- name: Setup castxml config
if: matrix.compiler == 'gcc' && matrix.version == '7'
run: mv unittests/configs/gcc7.cfg unittests/xml_generator.cfg;
- name: Setup Python test libs
- name: Install Python lib and test libs
run: |
pip install coveralls
pip install coverage
pip install pycodestyle
pip install .[test]
- name: Run tests
run: |
export PATH=~/castxml/bin:$PATH
python setup.py install
coverage run -m unittests.test_all
coverage combine
- name: Upload coverage to Codecov
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ docs/examples/caching/example.hpp.xml
test_cost.log
docs/apidocs
htmlcov
/venv/
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.') + "/../")

from ..release_utils import utils # nopep8
from release_utils import utils # nopep8

# -- General configuration ------------------------------------------------

Expand Down
8 changes: 5 additions & 3 deletions docs/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ Building the documentation locally
You can build the documentation yourself. In order for this to work you need
sphinx doc (http://sphinx-doc.org) and the readthedocs theme:

pip install sphinx
.. code-block:: shell
pip install sphinx_rtd_theme
pip install .[docs]
Then just run the following command in the root folder:

.. code-block:: shell
make html
This will build the documentation locally in the `docs/_build/html` folder.
This will build the documentation locally in the ``docs/_build/html`` folder.

For each commit on the master and develop branches, the documentation is
automatically built and can be found here: https://readthedocs.org/projects/pygccxml/
18 changes: 17 additions & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ Installation of pygccxml

You can use pip to install pygccxml:

pip install pygccxml
.. code-block:: shell
pip install pygccxml
To install from source, you can use the usual procedure:

.. code-block:: shell
python setup.py install
For development
%%%%%%%%%%%%%%%

You should use a ``virtualenv`` when possible. Example recipe:

.. code-block:: shell
cd pygccxml # git root
python -m virtualenv ./venv
source ./venv/bin/activate
pip install --editable .[test]
GCC-XML (Legacy)
----------------

Expand Down
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

version = utils.find_version("../pygccxml/__init__.py")

requirements_test = {
"coverage",
"coveralls",
"pycodestyle",
}
requirements_docs = {
"sphinx",
"sphinx_rtd_theme",
}

setup(name="pygccxml",
version=version,
author="Roman Yakovenko",
Expand All @@ -25,6 +35,10 @@
"pygccxml.declarations",
"pygccxml.parser",
"pygccxml.utils"],
extras_require={
"test": list(requirements_test),
"docs": list(requirements_docs),
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand Down
3 changes: 2 additions & 1 deletion unittests/pep8_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
# See http://www.boost.org/LICENSE_1_0.txt

import os
import pycodestyle
import unittest
import fnmatch

import pycodestyle


class Test(unittest.TestCase):

Expand Down

0 comments on commit 4b3e42a

Please sign in to comment.