Commit Graph

25 Commits

Author SHA1 Message Date
Ran Benita 857b5c9ccd
Merge pull request #7185 from bluetech/sigpipe
Handle SIGPIPE/BrokenPipeError in pytest's CLI
2020-05-08 13:32:34 +03:00
Ran Benita 73448f265d Handle EPIPE/BrokenPipeError in pytest's CLI
Running `pytest | head -1` and similar causes an annoying error to be
printed to stderr:

    Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
    BrokenPipeError: [Errno 32] Broken pipe

(or possibly even a propagating exception in older/other Python versions).

The standard UNIX behavior is to handle the EPIPE silently. To
recommended method to do this in Python is described here:
https://docs.python.org/3/library/signal.html#note-on-sigpipe

It is not appropriate to apply this recommendation to `pytest.main()`,
which is used programmatically for in-process runs. Hence, change
pytest's entrypoint to a new `pytest.console_main()` function, to be
used exclusively by pytest's CLI, and add the SIGPIPE code there.

Fixes #4375.
2020-05-08 12:51:02 +03:00
Anthony Sottile dad328bc8a Fix tests for python3.9 2020-05-07 05:26:55 -07:00
Daniel Hahler d017b69f38 mypy: show_error_codes=True 2020-01-27 22:18:35 +01:00
Hugo fe343a79f8 Remove deprecated license_file from setup.cfg
Starting with wheel 0.32.0 (2018-09-29), the `license_file` option is deprecated.

* https://wheel.readthedocs.io/en/stable/news.html

The wheel will continue to include `LICENSE`, it is now included automatically:

* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

And `LICENSE` is still included in sdists thanks to setuptools-scm:

* https://github.com/pytest-dev/pytest/pull/6348#issuecomment-567836331
2020-01-25 17:08:00 +02:00
Bruno Oliveira e5bd7fb053 Convert pytest.py into a package
As discussed in https://github.com/pytest-dev/pytest/issues/3342, this
is the first step to make pytest support static typing fully
2019-12-02 19:27:11 -03:00
Daniel Hahler b461010f32 mypy: config: use mypy_path=src
This allows for checking files inside of "testing" without having
"src/…" as an argument also.
2019-11-18 18:12:59 +01:00
Daniel Hahler 41604eeb3e setup.cfg: fix check-manifest ignore [ci skip] 2019-11-08 22:39:39 +01:00
Ran Benita 89dfde9535 Add rudimentary mypy type checking
Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.

This enables:

- Progressively adding type annotations and enabling more strict
  options, which will improve the codebase (IMO).

- Annotating the public API in-line, and eventually exposing it to
  library users who use type checkers (with a py.typed file).

Though, none of this is done yet.

Refs https://github.com/pytest-dev/pytest/issues/3342.
2019-07-09 12:12:07 -07:00
Bruno Oliveira 4d49ba6529 Drop Python 2.7 and 3.4 support
* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs

Related to #5275
2019-06-02 14:39:11 -03:00
Anthony Sottile 0c6ca0da62 Fix usages of py.io.saferepr 2019-01-20 16:36:23 -08:00
Ronny Pfannschmidt 456715a5c1 fix url quotes in setup.cfg metadata 2018-10-16 21:48:39 +02:00
Ronny Pfannschmidt 7855284ef7 move most setuptools parameters over to setup.cfg 2018-10-15 07:30:07 +02:00
Ronny Pfannschmidt d4351ac5a2 modernize packaging for setuptools>30.3 2018-10-14 21:44:32 +02:00
Ronny Pfannschmidt e02cb6d7ce restore setuptools_scm write_to usage 2017-04-23 16:59:08 +02:00
Philippe Ombredanne aa82db9fe2 Ensure the LICENSE is included in built wheels
Otherwise it is not included by default as wheels do not honor the MANIFEST.in

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2017-01-10 19:25:57 +01:00
holger krekel fe897c81be configure a plain "devpi upload" to create sdist and universal wheel 2015-07-09 14:56:56 +02:00
Ionel Cristian Maries b7d43c5a5d Add support for building proper wheels (universal and proper dependency evnironment markers for argparse/colorama if setuptools is new-ish).
--HG--
branch : pytest-2.7
2015-04-10 21:08:50 +03:00
holger krekel 97c9c10f3c remove "universal wheel" again until the py26/py27 difference (argparse) does not play a role anymore. 2014-10-25 07:21:21 +02:00
Alex Gaynor 5a88a9b22a Mark pytest as a universal wheel
--HG--
branch : alex_gaynor/mark-pytest-as-a-universal-wheel-1414169551518
2014-10-24 16:52:43 +00:00
sontek@gmail.com 0ea46e6aef Removed marking pytest as universal, py26 and py27 are not compatible.
--HG--
branch : fix_universal
2014-08-21 12:47:53 -07:00
Alex Gaynor b7d046527e Marked pytest as being a universal wheel.
--HG--
branch : alex_gaynor/marked-pytest-as-being-a-universal-wheel-1405267754279
2014-07-13 16:09:24 +00:00
holger krekel 263b0e7d99 add setup.cfg for building sphinx_docs 2013-10-03 12:35:13 +02:00
hpk d7f09cfc0a [svn r57550] * fixing syntax error
* removing setup.cfg

--HG--
branch : trunk
2008-08-21 15:12:31 +02:00
hpk d5e61e470d [svn r57529] preparing experiments with "dev" tags and pypi.
--HG--
branch : trunk
2008-08-21 09:48:44 +02:00