Commit Graph
70 Commits
Author SHA1 Message Date
Takeshi KOMIYA f054b9b976 refactor: Reduce warnings on testing 2020-12-29 19:23:46 +09:00
Takeshi KOMIYA be008a049e test: Apply flake8 to tests/ directory 2020-11-16 20:31:50 +09:00
François Freitag 0949735210 Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
oleg.hoefling 35725f02d9 move registration of public markers to sphinx.testing.fixtures
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2020-10-25 11:29:59 +01:00
Takeshi KOMIYA 3fee5a1ad8 refactor: Catch ImportError for lib2to3 to support future python 2020-05-04 01:47:42 +09:00
Takeshi KOMIYA 3407143023 refactor: Suppress DeprecationWarning for pyximport 2020-05-04 00:27:38 +09:00
Daniel Hahler 2495277b86 pytest: configure testpaths
This avoids having unrelated files being collected.
2020-03-12 16:41:36 +01:00
Takeshi KOMIYA 09623a97d0 Merge branch '2.x' into 3.x 2020-03-05 23:11:14 +09:00
Takeshi KOMIYA 3e7b18e971 Unpin coverage package
coverage-5.0 expects to set "parallel = True" on config file.
refs: https://github.com/nedbat/coveragepy/issues/716#issuecomment-429491441
2020-03-05 22:38:47 +09:00
Takeshi KOMIYA e628afd5cd Merge branch '2.0' 2020-01-01 11:39:46 +09:00
Takeshi KOMIYA ab184ac20d mypy: Enable disallow_incomplete_defs flag for type checking 2019-12-30 17:22:56 +09:00
Jon Dufresne acb2eadc8e Specify the target Python version in the mypy configuration
Currently targets Python 3.5.

This caught a bug. The subprocess.run() function only started taking the
'encoding' keyword argument starting with Python 3.6.
2019-08-16 12:08:28 -07:00
Jon Dufresne 8d93da09ba Remove "universal" configuration from setup.cfg
Sphinx is Python-3-only and therefore is not a universal wheel. It
should still distribute a 'py3' wheel, just not a universal one.

From https://wheel.readthedocs.io/en/stable/user_guide.html

> If your project contains no C extensions and is expected to work on
> both Python 2 and 3, you will want to tell wheel to produce universal
> wheels by adding this to your setup.cfg file: …

As Sphinx doesn't work on Python 2, it should not be universal.

Refs #6470
2019-06-13 08:07:54 -07:00
Takeshi KOMIYA a38ce3bfc7 test: declare pytest markers
To stop PytestUnknownMarkWarning, this declares markers on setup.cfg
https://docs.pytest.org/en/latest/mark.html
2019-05-12 15:21:04 +09:00
Jon Dufresne 5d497d0083 Remove redundant mypy config 'incremental'
The mypy config 'incremental` has defaulted as true since version 0.590.
Can drop the local override. For details, see:

https://github.com/python/mypy/commit/6b13652a466ccb102987a2ab1fa93d4b52fd8e3f
2019-01-06 06:58:26 -08:00
Takeshi KOMIYA 53917f228f Move to py3 mode for mypy (and remove many "type: ignore" comments) 2018-12-15 02:42:42 +09:00
Takeshi KOMIYA c2590a45c1 test: Give filterwarnings=all by ini file
Since pytest-3.9, precedence order of warning options had been
changed.  This moves ``-W all`` option into setup.cfg.

In detail, see https://github.com/pytest-dev/pytest/issues/3946
2018-10-30 00:01:39 +09:00
Takeshi KOMIYA 3e57ea0a52 Merge branch '1.7' 2018-07-17 00:37:40 +09:00
Takeshi KOMIYA 2bdbe3aaf4 Fix flake8 violations 2018-07-16 21:03:32 +09:00
Stephen Finucane d9ccc95717 doc: Add "extensions" to usage guide
Signed-off-by: Stephen Finucane <stephen@that.guru>
2018-06-20 09:30:47 +01:00
Takeshi KOMIYA 656f80cca9 mypy: add --no-strict-optional
Since mypy-0.600, validations for Optional becomes very strict. It
interfere our development. So this disables it temporarily.
2018-05-03 10:26:59 +09:00
Dmitry Shachnev 16d4e00043 Remove sphinx.pycode.pgen2 from flake8 exclude 2018-03-01 18:33:42 +03:00
Takeshi KOMIYA 4344fa149c Merge pull request #4505 from tk0miya/use_flake8-import-order
Use flake8-import-order
2018-01-29 22:13:48 +09:00
Takeshi KOMIYA 6926a3ed91 Merge branch '1.7-release' into use_flake8-import-order 2018-01-28 19:03:31 +09:00
Takeshi KOMIYA 41d99d3627 Give local-plugins.paths option to flake8
It will be available on flake8-3.5.0+.
(see https://gitlab.com/pycqa/flake8/issues/379)
2018-01-28 15:22:11 +09:00
Takeshi KOMIYA 9f5c676322 Use flake8-import-order 2018-01-28 01:52:16 +09:00
Stephen Finucane f3074d1747 setup: Configure flake8 extension as a local plugin
We don't want to install this as a system plugin. Now that flake8 3.5.0
is in the wild, we can use this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4492
2018-01-26 09:41:50 +00:00
Takeshi KOMIYA 3736768a59 test: Reduce DeprecationWarning on testing (from docutils) 2018-01-06 15:56:37 +09: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 f74b6756ac setup.cfg: Restructure file
Place configuration of the package itself first in the file, followed by
configuration of other tools.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-12-19 12:06:16 +00:00
Takeshi KOMIYA e3baf213f5 Merge branch 'stable' 2017-10-23 23:04:32 +09:00
Takeshi KOMIYA 47c869c89a Fix flake8 and style-check violations 2017-10-23 23:01:18 +09:00
Takeshi KOMIYA c39459ea7a Merge pull request #4155 from jdufresne/wheel-license
Include license file in the generated wheel package
2017-10-16 14:07:00 +09:00
Jon Dufresne c53dc54a30 Include license file in the generated wheel package
The wheel package format supports including the license file. This is
done using the [metadata] section in the setup.cfg file. For additional
information on this feature, see:

https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file
2017-10-15 19:40:10 -07:00
Jon Dufresne 327e6f27fb Rename [wheel] section to [bdist_wheel] as the former is legacy
For additional details, see:

https://bitbucket.org/pypa/wheel/src/54ddbcc9cec25e1f4d111a142b8bfaa163130a61/wheel/bdist_wheel.py?fileviewer=file-view-default#bdist_wheel.py-119:125

http://pythonwheels.com/
2017-10-15 19:33:10 -07:00
Stephen Finucane f5c0d64658 utils: Move "header check" to a flake8 plugin
If we want to check style, we run 'tox -e flake8': it shouldn't be
necessary to run some obscure 'make' command too. Make this possible by
moving the sole useful test from the target of this make command to a
flake8 plugin.

This includes a fix for a header that was previously excluded from
checks, but is now included.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 17:17:27 +01:00
Stephen Finucane 8f1905c4ae mypy: Make output a little friendlier
Two default-disabled options are enabled:

- show_column_numbers - Shows context notes before errors
- show_error_context - Shows column numbers in error messages

This should make the output of mypy a little easier to parse.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 16:01:21 +01:00
Stephen Finucane 017f124be5 mypy: Move configuration to 'setup.cfg'
Less top-level files = winning [1].

[1] https://mypy.readthedocs.io/en/stable/config_file.html

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-10-05 09:29:40 +01:00
Stephen Finucane 5e1af8df77 setup.cfg: Ignore .venv
We started ignoring this file from Git in commit 75154196b. Now do the
same for flake8.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-09-26 15:43:45 +01:00
Takeshi KOMIYA 41bb5f7fd2 Fix #3833: command line messages are translated unintentionally 2017-06-25 17:55:54 +09:00
Takeshi KOMIYA f1a3e45878 Update setup.cfg 2017-05-09 23:40:29 +09:00
Takeshi KOMIYA 56d3458584 Fix flake8 violations 2017-05-09 21:57:36 +09:00
Takeshi KOMIYA fc41f43a70 Merge branch 'stable' 2017-04-02 19:05:50 +09:00
Takeshi KOMIYA f730297187 egg_info: drop --no-svn-revision option because it has been deprecated 2017-04-02 18:58:22 +09:00
Stephen Finucane 6de6e81b0c setup.cfg: Enable 'warning-is-error'
Dog food this feature. Validated with the following (broken) change:

    --- a/doc/contents.rst
    +++ b/doc/contents.rst
    @@ -18,6 +18,9 @@ Sphinx documentation contents
        intl
        theming
        setuptools
    +
    +   .. This is broken!!!
    +
        templating
        latex
        markdown

Signed-off-by: Stephen Finucane <stephen@that.guru>
2017-02-24 13:41:46 -05:00
Takeshi KOMIYA cf2061dfad Fix flake8 violations 2017-01-26 01:13:17 +09:00
Takeshi KOMIYA c03da8fdf4 Merge branch 'stable' into 3256_update_release_script 2017-01-14 00:26:03 +09:00
Takeshi KOMIYA 7dcb40d135 Update flake8 rules 2017-01-12 10:11:54 +09:00
Takeshi KOMIYA 412bb9aae8 Fix flake8 violations 2017-01-12 10:09:44 +09:00
Takeshi KOMIYA 60d4846e0f Fix flake8 violations 2017-01-12 10:07:05 +09:00