Commit Graph

95 Commits

Author SHA1 Message Date
Takeshi KOMIYA
6754b531b9 Do test with py37 2018-07-28 19:12:35 +09:00
Stephen Finucane
93589a3572 tox: Run everything but unit tests under Python 3
The demise of Python 2.7 is not far off and we intend to drop support
for it in Sphinx 2.0. As a result, there probably isn't a better time
than now to start testing with Python 3 by default. There are a couple
of advantages to this:

- flake8 is stricter under Python 3 and we don't need to ignore files
  with Python 3 syntax
- We get to dogfood Sphinx against its own documentation using Python 3
- pylint gains support for Python 3 syntax

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:53:29 +01:00
Takeshi KOMIYA
cd08872cc0 Fix existence check for JRE was broken 2018-03-20 23:35:42 +09:00
Takeshi KOMIYA
3430610a0f test: pass PYTEST_ADDOPTS to pytest 2018-02-04 22:48:45 +09:00
Stephen Finucane
4420b43e5a tox: Ignore distutils deprecation warning
distutils/__init__.py:4: DeprecationWarning: the imp module is
    deprecated in favour of importlib; see the module's documentation
    for alternative uses
      import imp

Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-01-15 09:09:53 +00:00
Takeshi KOMIYA
23533e48b2 Update PYTHONWARNINGS on tox.ini to reduce meaningless warnings 2018-01-06 20:14:20 +09:00
Takeshi KOMIYA
e3efe5884b Fix #4378: tox: use usedevelop option instead skipsdist 2018-01-05 22:26:07 +09:00
Stephen Finucane
60e25090a3 tox: Enable 'skipsdist'
Given that we install Sphinx as part of the dependencies, there's no
reason to do it twice. Skip that step.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:33 +00:00
Stephen Finucane
9a3ebaaff5 Resolve warning filter issues
There's an issue with 'pkgutils' and namespace packages. This has been
reported against setuptools [1], but until this is resolved, we simply
need to live with it. Ensure said warnings are filtered from tox too and
remove some unnecessary ones.

[1] https://github.com/pypa/setuptools/issues/1111

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:32 +00:00
Stephen Finucane
7c0723fd46 tests: Remove 'tests/run.py'
This is no longer necessary. One test needs to be modified to deal with
how 'python -m pytest' modifies the PATH.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-29 13:02:31 +00:00
Takeshi KOMIYA
626e8980cd
Merge pull request #4337 from stephenfin/the-great-toxification
The great toxification (part 6)
2017-12-27 15:29:16 +09:00
Stephen Finucane
77ca894723 tox: Report coverage to user
Run 'coverage report' after a successful coverage run. There's enough
coverage-related stuff here at this point to warrant its own section.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-24 21:24:41 +00:00
Stephen Finucane
a3f9935d95 travis: Enable codecov coverage
This necessitates adding some basic coverage-py configuration [1] and
making sure the pytest-cov plugin uses said configuration [2]. Badges
are included.

Note that we do not run the 'coverage' tox target, which is reserved for
users.

[1] https://github.com/codecov/example-python
[2] https://bitbucket.org/ned/coveragepy/issues/512/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-24 21:24:41 +00:00
Stephen Finucane
411055905c tox: Add 'PERL5LIB' to 'passenv' list
This is required by 'makeinfo'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes #4339
2017-12-24 14:47:31 +00:00
Stephen Finucane
a2a873d58a tox: Add documentation for all targets
This should make 'tox -av' more helpful.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 15:55:10 +00:00
Stephen Finucane
fd1df0815b tox: Make further use of factor-conditional deps
This is how we reduce boilerplate [1]. Succinctness FTW.

[1] https://tox.readthedocs.io/en/latest/config.html#factors-and-factor-conditional-settings

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane
5d812ccefc tox: Add 'coverage' target
Enabling coverage results in an increase in runtime, and while this may
be an acceptable compromise for some developers, it's not necessarily
something we need to run all the time. Move it to a separate target so
it can be run only by those who wish to use it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane
e243e82723 tests: Ignore tests using 'collect_ignore'
Per the pytest docs [1], this is the preferred way to ignore tests. This
necessitates removing the 'test-async' target as it no longer makes any
sense.

[1] https://docs.pytest.org/en/latest/example/pythoncollection.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 20:10:18 +00:00
Stephen Finucane
a102e8e29b setup.py: Include 'flake8' in 'test' requirements
We are using this in our testing and actually need it for the flake8
plugin, so include this in the list of 'test' requirements.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-18 19:44:05 +00:00
Stephen Finucane
67753b7ce3 Remove 'test-reqs.txt'
We were never really using this file for its specified purpose [1]. Now
that we have everything cleanly organized in 'setup.py', there really
isn't any reason to keep it around. Remove it.

[1] https://caremad.io/posts/2013/07/setup-vs-requirement/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-10 14:13:09 +01:00
Stephen Finucane
eb8efce7d8 requirements: Reduce duplication
Simply installing packages will ensure that most of the dependencies in
'setup.py' are installed, meaning 'test-reqs.txt' need only contain
those necessary for testing.

The only notable change is that the 'simplejson' module is dropped from
the requirements list. This included as a dependency for the PyPy
target, but it appears that this is not necessary today (though it may
have been when the target was added in 2011).

This retains 'setup.py test' which, as noted in the tox docs [1], is
sometimes expected for downstream distribution testing. We may wish to
find a way to synchronize requirements between 'test-reqs.txt' and this
section in the future, but that's work for another day.

[1] https://tox.readthedocs.io/en/latest/example/basic.html#integration-with-setup-py-test-command

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-10 14:06:10 +01:00
Stephen Finucane
6086d7b608 tox: Don't bother setting 'PYTHONDONTWRITEBYTECODE'
As I've previously discovered [1], this doesn't actually do anything in
modern tox. Simply remove it.

[1] https://review.openstack.org/#/c/369986/

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
e023c296e8 tox: Pass posargs to docs
This allows us to do something like the following:

  tox -e docs -- -b man

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
40c8f661ef tox: Ensure 'mypy' targets runs with Python 3.x
Turns out this requires Python 3.2 at a minimum. Who knew? We don't
support Python 3.1 so simply fix to 'python3'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:59:08 +01:00
Stephen Finucane
71a5ec18be tox: Always show 25 slowest tests
pytest supports this natively [1] and this is what is currently used by
Travis. There's value in seeing similar data locally.

[1] https://docs.pytest.org/en/latest/usage.html#profiling-test-execution-duration

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:57:58 +01:00
Stephen Finucane
6d6d3a40f1 tox: Always run coverage
There is value in examining coverage for something like Sphinx. Start
doing this by default, in anticipation of increasing coverage over time.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:18:20 +01:00
Stephen Finucane
c5dec1b6a9 tox: Add pylint target to tox
This isn't enabled by default because it throws so many damn errors.
Perhaps we should simply remove this?

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:18:20 +01:00
Takuya Noguchi
3e94878871 Add support for docutils 0.14 2017-09-10 09:23:09 +09:00
Bernat Gabor
7697683b3d add proxy to tox, so the tests can succeed even behind a proxy network 2017-07-26 20:09:33 +01:00
Takeshi KOMIYA
0135948485 Fix #3683: sphinx.websupport module is not provided by default 2017-05-03 23:00:03 +09:00
Takeshi KOMIYA
b9b982d5f0 Fix dependency errors 2017-04-30 01:04:30 +09:00
Takeshi KOMIYA
13e7ae2f1f Revert "Add dependency (temporary)"
This reverts commit 56f51cb6aa.
2017-04-23 21:04:40 +09:00
Takeshi KOMIYA
56f51cb6aa Add dependency (temporary) 2017-04-22 17:54:21 +09:00
Takeshi KOMIYA
c0a39eb3f7 Simplify testcases for websupport
Now websupport modules has separated and move into
sphinxcontrib-websupport package.  They are also tested in the
package.  Hence, we should test the bridge code for them.
2017-04-22 17:54:20 +09:00
Stephen Finucane
8b500fe383 tox: Add 'mypy' target
Like the recently added 'docs' target, this is easier than creating a
virtualenv, installing deps and running make.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-02-28 17:32:34 +00:00
Stephen Finucane
020e77b794 tox: Add 'docs' target
This is easier than creating a virtualenv, installing deps and running
make. It also makes explicit use of the setuptool integration that is
now documented.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-02-24 13:41:46 -05:00
Takeshi KOMIYA
b2d8803545 Upgrade to newest mypy package 2017-02-21 14:05:18 +09:00
Takeshi KOMIYA
5c72b8cf47 Merge branch 'stable' 2017-01-07 15:36:55 +09:00
Takeshi KOMIYA
5cff4b15c2 Fix tox.ini for pytest 2017-01-07 15:36:07 +09:00
Takeshi KOMIYA
bd382528d0 Merge branch 'stable' 2016-12-25 12:40:27 +09:00
Takeshi KOMIYA
a5b15195e2 Add du13 target to tox.ini 2016-12-25 12:22:54 +09:00
Takeshi KOMIYA
934ec657d4 Remove unsupported platform from tox.ini 2016-12-25 12:19:16 +09:00
Takeshi KOMIYA
36eab77c3d Add py36 support 2016-12-25 12:19:15 +09:00
Takeshi KOMIYA
866da5a8d0 Clarify test command (refs: #3264) 2016-12-24 23:51:30 +09:00
Takeshi KOMIYA
7ab20262ff Set PYTHONDONTWRITEBYTECODE=true on testing (refs: #3264) 2016-12-24 22:23:49 +09:00
Takeshi KOMIYA
8dcc3a259c Fix 'tox -e du12' fails (refs: #3264) 2016-12-24 19:30:32 +09:00
Takeshi KOMIYA
f65c5ee3de Install enum34 on testing pypy (refs: #3264) 2016-12-24 19:30:32 +09:00
shimizukawa
0a7d039df5 Merge branch '1.5-release' into master 2016-12-05 23:14:25 +09:00
shimizukawa
1c8935adae Inprovement of warnings mechanism. Now support disabling emit warnings and add documentation. 2016-12-04 18:05:16 +09:00
Takeshi KOMIYA
db732ac0b8 Prepare to type-check using mypy 2016-11-16 12:05:44 +09:00