Skip to content

Add test for generating api docs#266

Merged
sverhoeven merged 10 commits intomainfrom
213-test-make-html
May 3, 2021
Merged

Add test for generating api docs#266
sverhoeven merged 10 commits intomainfrom
213-test-make-html

Conversation

@sverhoeven
Copy link
Copy Markdown
Member

@sverhoeven sverhoeven commented Apr 30, 2021

Instead of make html using sphinx-build ... for better cross-platform compatibility.

Also got tests to work on Windows CI (refs #223). It also still works on my laptop:

PS C:\Users\stefanv\git\NLeSC\python-template> .\env\Scripts\pytest.exe -v
==================================================== test session starts ====================================================
platform win32 -- Python 3.9.4, pytest-4.6.11, py-1.10.0, pluggy-0.13.1 -- c:\users\stefanv\git\nlesc\python-template\env\scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\stefanv\git\NLeSC\python-template, inifile: setup.cfg, testpaths: tests
plugins: cookies-0.5.1, cov-2.11.1
collected 8 items

tests/test_project.py::test_project_folder PASSED                                                                      [ 12%]
tests/test_project.py::test_pytest PASSED                                                                              [ 25%]
tests/test_project.py::test_subpackage PASSED                                                                          [ 37%]
tests/test_project.py::test_generate_api_docs PASSED                                                                   [ 50%]

Refs #213

sverhoeven and others added 2 commits April 30, 2021 12:15
As Windows does not have make
@sverhoeven sverhoeven marked this pull request as ready for review April 30, 2021 11:00
Copy link
Copy Markdown
Member

@fdiblen fdiblen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 👍

@sverhoeven sverhoeven requested a review from fdiblen May 3, 2021 05:42
Copy link
Copy Markdown

@jspaaks jspaaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my goodness what an absolute disaster windows is. I was not able to run the tests from the template level, but at least I could generate the package and then run pytest and the sphinx build directly.

For the longer term, I think we should consider having two workflows, one to test the template, the other to test the generated package. The latter workflow would then go through the steps of creating a virtual env, install deps, etc, in the workflow file, not as part of the test.

@sverhoeven
Copy link
Copy Markdown
Member Author

Thanks for reviewing. I am just happy it works on CI now.

@sverhoeven sverhoeven merged commit 08d7951 into main May 3, 2021
@sverhoeven sverhoeven deleted the 213-test-make-html branch May 3, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants