Commit Graph

46 Commits

Author SHA1 Message Date
Jon Dufresne
dc80863254 Update isort URL to new location: https://github.com/PyCQA/isort (#4841) 2020-12-19 22:15:09 -05:00
Sebastian Rittau
4586ed9adc Require black and isort for contributions (#3329)
* Add explanation to CONTRIBUTNG.md
* Add sample pre-commit script
* Check for correctly formatted files in CI

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-06-28 15:28:28 -07:00
Sebastian Rittau
ef74bee249 Protocol naming guidelines (#4229)
Closes: #4174
2020-06-14 17:00:19 +02:00
Mikhail Golubev
231998a0a1 Fix a typo in the section about type hinting context managers (#4185) 2020-06-05 08:43:43 -07:00
Sebastian Rittau
b2b397c5ce Add @CraftSpider and @hauntsaninja as maintainers (#4138) 2020-05-28 16:34:45 -07:00
Sebastian Rittau
adafaf1964 Add review guidlines (#4132)
Closes: #3448
2020-05-28 15:18:05 +02:00
Sebastian Rittau
885c2fd65e Fix example code (#3592) 2020-01-08 09:52:23 -08:00
Sebastian Rittau
d60b7ae26d New libs: Change permission requirement to notification (#3443)
This was discussed on the typing-sig mailing list and in
python/peps#1218, has met the approval of the steering council, and
was incorporated into PEP 484.
2019-11-07 07:35:35 -08:00
Michael Lee
b294782183 Make most contextmanager __exit__ signatures return Optional[bool] (#3179)
This pull request is a follow-up to https://github.com/python/mypy/issues/7214.

In short, within that mypy issue, we found it would be helpful to
determine between contextmanagers that can "swallow" exceptions vs ones
that can't. This helps prevent some false positive when using flags that
analyze control flow such as `--warn-unreachable`. To do this,
Jelle proposed assuming that only contextmanagers where the `__exit__`
returns `bool` are assumed to swallow exceptions.

This unfortunately required the following typeshed changes:

1. The typing.IO, threading.Lock, and concurrent.futures.Executor
   were all modified so `__exit__` returns `Optional[None]` instead
   of None -- along with all of their subclasses.

   I believe these three types are meant to be subclassed, so I felt
   picking the more general type was correct.

2. There were also a few concrete types (e.g. see socketserver,
   subprocess, ftplib...) that I modified to return `None` -- I checked
   the source code, and these all seem to return None (and don't appear
   to be meant to be subclassable).

3. contextlib.suppress was changed to return bool. I also double-checked
   the unittest modules and modified a subset of those contextmanagers,
   leaving ones like `_AssertRaisesContext` alone.
2019-08-16 16:13:33 -07:00
Jon Dufresne
679e1a9a8c Update URL: python/black → psf/black (#3180) 2019-08-10 13:31:58 -07:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Sebastian Rittau
0e5b3770f8 Add a "pull requests welcome" batch (#3033)
We get quite a few bug reports where after a maintainer writes
"Pull Requests Welcome" we get a PR by the submitter. Maybe this
badge will help a bit to encourage people directly submit PRs,
reducing maintainer workload.
2019-06-05 07:51:01 -07:00
Jon Dufresne
910c71050d Update Black URL (#2950) 2019-05-04 11:42:44 -04:00
Jelle Zijlstra
ce2b8a838c reword "What to include" (#2861) 2019-04-08 19:02:01 +02:00
Ivan Levkivskyi
9ffa1d8237 Update stubgen link and add a bit more info (#2779) 2019-02-03 14:47:34 +00:00
Sebastian Rittau
53d8756214 Guidelines for incomplete stubs (#2661)
* Remove the guideline to use any for preliminary stubs

Closes #2648
2018-12-04 19:20:13 +01:00
Michael Lee
7b76fb9b20 Make contribution guidelines state when to use (and not use) 'Any' (#2540)
This pull request modifies the contribution guidelines to clarify
when and where 'Any' should be used.

In particular, it clarifies that 'Any' is meant mainly to be used as
a "fallback" -- if it's not possible to express a certain type, if we're not
sure what the correct type in some case is, to avoid Union returns, etc...

It also explicitly notes that 'object' should be used over 'Any' when we
want to indicate that some function can accept literally anything.

Typing stubs this way probably won't impact most people, but does make
life a bit easier for people (like me) who want to restrict/forbid the
use of Any as much as possible.
2018-12-02 15:16:29 -08:00
Sebastian Rittau
4fb22f61e4 Reference black, split long functions (#2651)
Closes #2598
2018-12-01 22:45:10 +01:00
Sebastian Rittau
36671663cc Accept upstream stubs when receiving no response (#2608)
Also, don't explicitly ask for people to ask for missing packages.

Closes #2573
2018-11-20 17:59:46 +01:00
Sebastian Rittau
b77da551d9 Remove label descriptions from CONTRIBUTING (#2572)
Closes #2562
2018-10-31 09:22:52 -07:00
Jelle Zijlstra
761b620e1a add @srittau to maintainers (#2420) 2018-08-28 16:50:50 +02:00
Yusuke Miyazaki
b91cb87249 Add a convention for platform-dependent APIs to CONTRIBUTING.md (#2281) 2018-06-26 09:14:12 -07:00
Jelle Zijlstra
da7b04904c Limit lines to 130 chracters (#2169)
Fixes #2124.

As mentioned in the issue, the current guidelines lead to extremely long lines of many hundreds of characters, which make code hard to read and review. I think there should be some limit to line length, but it's OK for stubs to have somewhat longer lines than normal code.

For reference, there are currently 115 lines in typeshed over 200 characters; 523 over 120 characters; and 2980 over 79 characters.

We picked 130 because that's the longest line GitHub displays on a 13" laptop in a unified diff without folding. There are currently 382 lines in typeshed that are over 130 characters.
2018-05-29 08:28:08 -07:00
Guido van Rossum
9d9527c94c Get rid of BLOCKED label in favor of [WIP] subject prefix (#1956)
We (I) introduced the BLOCKED label ~2 years ago, but it never got much usage, and I remember it startled some developers (Ivan may recall...). A better convention seems to put [WIP] in the subject, so let's standardize on that and get rid of the BLOCKED label.

I already removed the BLOCKED label and edited the subject of the one issue under it.

We also don't make good use of the other labels, but they seem more useful and less controversial.
2018-03-09 10:39:30 -08:00
Guido van Rossum
ac465ea224 Add guideline for undocumented objects. (#1938)
Also add Ivan as a typeshed core dev (since he is in the group).
2018-03-02 11:54:51 -08:00
Sebastian Rittau
35edccce68 CONTRIBUTING: Use PEP 526 syntax in example (#1803)
* Add an example property, whitespace for grouping
* No default values from module-level constants
* Document that PEP 526 syntax is preferred
2018-01-17 10:28:45 -08:00
Elliott Beach
f207bc3cc3 add note about not squashing (#1830) 2018-01-16 16:26:48 -08:00
Thomas Broadley
2a30532f8d docs: fix typo (#1799) 2017-12-23 20:33:51 +01:00
Sebastian Rittau
9656febaee Merge style guide from README.md into CONTRIBUTING.md (#1696) 2017-11-08 09:02:59 -08:00
Jelle Zijlstra
b54a711778 Recommend against creating incomplete stubs (#1659)
I disagree with the recommendation that users create incomplete stubs, because such stubs lead to false positive type checker errors (see for example #525). I would like to instead set a norm that all stubs should contain all public objects in the library they cover.
2017-10-10 08:27:47 -07:00
Jelle Zijlstra
e20a36ada2 add to CONTRIBUTING (#1560)
Ask contributors to better explain their changes and link to documentation and code. These things generally make pull requests easier to review.
2017-08-21 13:26:00 -07:00
Guido van Rossum
350563223f Add Optional[] for all remaining cases of x: <type> = None (#1424)
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Ethan Smith
ac36193550 Add Gitter chat badge (#1399)
And update other gitter links.
2017-06-12 15:55:05 -07:00
Emily Morehouse
85d017d1e8 Documentation updates for testing information (#1293)
- Removes references to 'runtests.sh', as it has been removed
- Adds links from the contributing file to the readme - testing section
- Updates flake8 stats
2017-05-22 16:10:26 -07:00
Emily Morehouse
b6d08b81a3 #1286 Remove header comments from stubs (#1292)
- Updates documentation related to previously required comment headers.
- Removes all comment headers from stubs
- Occasionally included a header for stubs that were noted to be incomplete or contained todo's.
2017-05-22 15:14:15 -07:00
Emily Morehouse
b2deca8c83 Add description of how the directory structure targets Python versions. (#1288) 2017-05-22 12:03:53 -07:00
Jelle Zijlstra
093a16f398 allow PEP 526-style annotations in all stubs (#1285)
Mypy, pytype, and PyCharm now all allow variable annotations in stubs; I think we already have some.
2017-05-22 11:15:48 -07:00
Jelle Zijlstra
15b6ace1e7 Add to core dev guidelines (#1279)
From https://github.com/python/typeshed/pull/1266#issuecomment-302916761.
2017-05-22 06:34:37 -07:00
Guido van Rossum
24f5bc4a2a Explain the set of labels we actually use (#1226) 2017-04-30 10:46:44 -07:00
Guido van Rossum
de95aac022 Remind core devs to delete their branches (#1073) 2017-03-22 20:23:37 -07:00
Jelle Zijlstra
34575af8e4 Add core dev guidelines (#1058)
* Add core dev guidelines
* add link to "Squash and merge"
2017-03-21 08:36:00 -07:00
Łukasz Langa
86864dc824 Add Jelle to the team 2017-03-20 21:22:09 -07:00
Jelle Zijlstra
d04b9b204e Function bodies should be empty (#959)
I've seen some stubs like

```
class X:
    def __init__(self, x: str) -> None:
        self.x = x
        self.y = 0
```
I think this should be written instead as
```
class X:
    x: str
    y: int
    def __init__(self, x: str) -> None: ...
```
2017-03-10 15:35:34 -08:00
Łukasz Langa
598c1d5545 Expand CONTRIBUTING.md with information about sys.version_info checks (#853) 2017-01-20 11:41:44 -08:00
Łukasz Langa
05c6c66fa4 Improve CONTRIBUTING.md (#824)
1. Mentioned review requirement for core contributors.
2. Made stub coding style on par with requirements specified on
   the Mypy wiki (we can merge them now).
2017-01-11 17:55:14 -08:00
Łukasz Langa
08432484d5 CONTRIBUTING.md (#790)
Fixes #772.
2016-12-24 08:46:08 -08:00