Skip to content

Commit a21da78

Browse files
committed
Merge branch 'trunk' into unsupportedmethod-str-7744
* trunk: (2745 commits) too many newlines as per review dev0 prefix ok maybe fix twistedchecker for realises? fix twistedchecker topfile make the test pass add tox minversion because of `extras` usage failing test topfile Explicitly ignore extension modules to work around twisted/twistedchecker#118. twistedchecker defer acquisition of the threadpool forward and backward compatibility twistedchecker distinct names since these need to live on the same object compatibility layer socktype socket types no, Nones are bad None first less code more data fewer lines hoist constant tests & fix for various AF_ types twistedchecker clean vws pacify twistedchecker docstring adjustment without that class, it should pass misc file for dev process change and now it should fail something that will _really_ fail diff-cover deleted lines won't warn it's not failing anyway be consistent about naming This should cause a new twistedchecker error, but it doesn't. address family selection quote of the release final newsfiles Revert "newsfiles" versions Remove unused import Move ConchOptions parsing tests to test_default Remove unused import Move ConchOptions parsing tests to test_default Modules used by tkconch on Python 3 should be removed from here Fix test on Python 3 Fix the name of the topfile for twisted#3746. Update topfile. Test the default timeout. ...
2 parents 11f068e + 5178c33 commit a21da78

File tree

1,787 files changed

+209765
-180550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,787 files changed

+209765
-180550
lines changed

.coveragerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[run]
2+
branch = True
3+
parallel = True
4+
source = twisted
5+
6+
[paths]
7+
source=
8+
src/twisted
9+
build/*/lib/python*/site-packages/twisted
10+
build/*/Lib/site-packages/twisted
11+
build/pypy*/site-packages/twisted
12+
13+
[report]
14+
precision = 2
15+
ignore_errors = True

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
*.egg-info/
2+
.eggs/
23
*.o
34
*.py[co]
45
*.so
6+
*.DS_Store
57
_trial_temp*/
68
build/
79
dropin.cache
810
doc/
911
docs/_build/
12+
dist/
13+
venv/
14+
htmlcov/
15+
.coverage*
16+
*~
17+
*.lock
18+
apidocs/

.travis.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#
2+
# This is the Travis-CI configuration.
3+
#
4+
# The actual dependency installation and test execution is done via tox as a
5+
# way to share the same process between Travis-CI and Buildbot.
6+
#
7+
language: python
8+
sudo: false
9+
10+
11+
# Only run tests on push on a few branches.
12+
# Test on PR should be execute for all branches and forks.
13+
branches:
14+
only:
15+
- trunk
16+
- /^release-.*$/
17+
18+
19+
env:
20+
global:
21+
- TRIAL_REPORTER=text
22+
23+
24+
matrix:
25+
include:
26+
- python: 2.7
27+
env: TOXENV=py27-alldeps-withcov-posix,codecov-publish
28+
# FIXME: https://twistedmatrix.com/trac/ticket/8633
29+
# Coverage should also be reported for nomodules tests so that we also
30+
# get report for those conditional branches.
31+
- python: 2.7
32+
env: TOXENV=py27-nodeps-withcov-posix,codecov-publish
33+
- python: 3.3
34+
env: TOXENV=py33-alldeps-withcov-posix,codecov-publish
35+
- python: 3.4
36+
env: TOXENV=py34-alldeps-withcov-posix,codecov-publish
37+
- python: 3.5
38+
env: TOXENV=py35-alldeps-withcov-posix,codecov-publish
39+
# For now all non-trial tests are in a single job to reduce the time spent
40+
# on starting separate jobs.
41+
- python: 2.7
42+
env: TOXENV=narrativedocs,apidocs,pyflakes,topfile,manifest-checker
43+
- python: 3.5
44+
env: TOXENV=pyflakes3
45+
# Twistedchecker is running as a separate job so that we can ignore if it
46+
# fails.
47+
- python: 2.7
48+
env: TOXENV=txchecker-travis
49+
#
50+
# OSX 10.10
51+
#
52+
- language: generic
53+
os: osx
54+
# 7.1 is OS X 10.10.x
55+
# see: https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
56+
osx_image: xcode7.1
57+
python: 2.7
58+
env: TOXENV=py27-alldeps-withcov-macos1010,codecov-publish
59+
#
60+
# OSX 10.11
61+
#
62+
- language: generic
63+
os: osx
64+
# 8 is OS X 10.11.x
65+
# see: https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
66+
osx_image: xcode8
67+
env: TOXENV=py35-alldeps-withcov-macos,codecov-publish
68+
- language: generic
69+
os: osx
70+
osx_image: xcode8
71+
# Test cfreactor explicitly
72+
env:
73+
- TOXENV=py35-alldeps-withcov-macos,codecov-publish
74+
- TWISTED_REACTOR=cf
75+
76+
77+
allow_failures:
78+
- osx_image: xcode7.1
79+
- osx_image: xcode8
80+
81+
82+
addons:
83+
apt:
84+
packages:
85+
- libssl-dev
86+
- libssl1.0.0
87+
88+
89+
cache:
90+
directories:
91+
- $HOME/.cache/pip
92+
- $HOME/.pyenv
93+
94+
95+
install:
96+
- ./.travis/install.sh tox
97+
98+
99+
# FIXME: https://twistedmatrix.com/trac/ticket/8373
100+
# By default, Travis only clones one branch.
101+
# Some tests require the presence of the `trunk` branch so here we are, also
102+
# fetching `trunk` for each test.
103+
before_script:
104+
- git remote set-branches --add origin trunk
105+
- git fetch origin trunk
106+
107+
108+
# Run tox from the created virtualenv.
109+
script:
110+
- ./.travis/run.sh

.travis/install.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
if [[ "$(uname -s)" == 'Darwin' ]]; then
6+
curl -O https://bootstrap.pypa.io/get-pip.py
7+
python get-pip.py --user
8+
python -m pip install --user virtualenv
9+
python -m virtualenv ~/.venv
10+
source ~/.venv/bin/activate
11+
12+
if [[ "${TOXENV}" == "py35-alldeps-withcov-macos,codecov-publish" ]]; then
13+
14+
brew update;
15+
brew upgrade openssl;
16+
brew install pyenv;
17+
PYENV_ROOT="$HOME/.pyenv";
18+
PATH="$PYENV_ROOT/bin:$PATH";
19+
eval "$(pyenv init -)";
20+
pyenv install -s 3.5.2;
21+
pyenv global system 3.5.2;
22+
pyenv rehash;
23+
24+
fi
25+
fi
26+
27+
# Temporary workaround for https://github.com/pypa/setuptools/issues/776;
28+
# install (and thereby cache a built wheel of) cryptography. (NB: We're
29+
# already using the same Python version in this venv as in the test env,
30+
# thanks to travis.yml).
31+
pip install -U pip 'setuptools<26'
32+
pip install cryptography
33+
34+
pip install $@

.travis/run.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
5+
if [[ "$(uname -s)" == "Darwin" ]]; then
6+
# Initialize the virtualenv created at install time.
7+
source ~/.venv/bin/activate
8+
9+
if [[ "${TOXENV}" == "py35-alldeps-withcov-macos,codecov-publish" ]]; then
10+
# Add pyenv path
11+
PYENV_ROOT="$HOME/.pyenv";
12+
PATH="$PYENV_ROOT/bin:$PATH";
13+
eval "$(pyenv init -)";
14+
fi
15+
fi
16+
17+
tox -- $TOX_FLAGS

.travis/twistedchecker-trunk-diff.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env sh
2+
#
3+
# Helper for running twistedchecker and reporting only errors that are part
4+
# of the changes since trunk.
5+
#
6+
# Call it as:
7+
# * SCRIPT_NAME twisted
8+
# * SCRIPT_NAME twisted/words/
9+
# * SCRIPT_NAME twisted.words
10+
11+
target=$1
12+
13+
# FIXME: https://github.com/twisted/twistedchecker/issues/116
14+
# Since for unknown modules twistedchecker will return the same error, the
15+
# diff will fail to detect that we are trying to check an invalid path or
16+
# module.
17+
# This is why we check that the argument is a path and if not a path, it is
18+
# an importable module.
19+
if [ ! -d "$target" ]; then
20+
python -c "import $target" 2> /dev/null
21+
if [ $? -ne 0 ]; then
22+
>&2 echo "$target does not exists as a path or as a module."
23+
exit 1
24+
fi
25+
fi
26+
27+
# Make sure we have trunk on the local repo.
28+
git fetch origin +refs/heads/trunk:refs/remotes/origin/trunk
29+
30+
# Explicitly ignore extension modules. See: https://github.com/twisted/twistedchecker/issues/118
31+
mkdir -p build/
32+
twistedchecker --ignore='raiser.so,portmap.so,_sendmsg.so' -f parseable "$target" > build/twistedchecker-branch.report
33+
34+
# Make sure repo is producing the diff with prefix so that the output of
35+
# `git diff` can be parsed by diff_cover.
36+
git config diff.noprefix false
37+
38+
diff-quality \
39+
--violations=pylint \
40+
--fail-under=100 \
41+
--compare-branch=origin/trunk build/twistedchecker-branch.report
42+
43+
diff_exit_code=$?
44+
exit $diff_exit_code

CONTRIBUTING

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@ Extensive contribution guidelines are available online at:
1313

1414
https://twistedmatrix.com/trac/wiki/ContributingToTwistedLabs
1515

16-
**Warning: pull requests are ignored!** File a ticket at:
16+
Twisted has a Code of Conduct, available at code_of_conduct.md.
17+
18+
**Warning: pull requests are ignored** unless they have an associated ticket in trac.
19+
20+
File a ticket at:
1721

1822
https://twistedmatrix.com/trac/newticket
1923

2024
Twisted uses Trac to keep track of bugs, feature requests, and associated
2125
patches because GitHub doesn't provide adequate tooling for its community.
26+
27+
For a PR to be accepted it needs to have:
28+
29+
* all Travis CI tests passing
30+
* patch coverage of 100% as reported by codecov.io
31+
32+
The Travis CI tests currently represent only a subset of the all the platforms Twisted supports, so the buildbot tests are still the actual gate for PR acceptance.

INSTALL

Lines changed: 0 additions & 32 deletions
This file was deleted.

INSTALL.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Installing Twisted
2+
==================
3+
4+
Installation Requirements
5+
-------------------------
6+
7+
To install Twisted, you need:
8+
9+
- Python 2.7 (full functionality) or 3.3/3.4/3.5 (subset of functionality).
10+
11+
- `setuptools <https://pypi.python.org/pypi/setuptools>`_
12+
(installed automatically if you use pip).
13+
14+
- `Zope Interface <https://pypi.python.org/pypi/zope.interface>`_ 3.6.0 or newer.
15+
Zope Interface 4.0 or newer is required for Python 3.
16+
Installing via pip will automatically download a suitable Zope Interface.
17+
18+
- On Windows `pywin32 <https://pypi.python.org/pypi/pypiwin32>`_ is required.
19+
Build 219 or later is highly recommended for reliable operation (this is already included in ActivePython).
20+
21+
We also have `setuptools extras <http://twistedmatrix.com/documents/current/installation/howto/optional.html>`_ for automatically installing optional packages used by Twisted.
22+
23+
24+
Installing Twisted
25+
------------------
26+
27+
To install the latest version of Twisted using pip::
28+
29+
$ pip install twisted
30+
31+
You can install optional dependencies for specific functionality in Twisted (such as TLS or serial support) by using our setuptools extras (see above).
32+
33+
As an example, to install Twisted with the TLS dependencies, use::
34+
35+
$ pip install twisted[tls]
36+
37+
Additionally, there are packages available in the repositories of:
38+
39+
- Debian and Ubuntu as ``python-twisted`` for Python 2.
40+
- FreeBSD as ``py-twisted`` for Python 2.
41+
- Arch as ``python-twisted`` for Python 2.
42+
- Fedora and RHEL as ``python-twisted`` for Python 2.

LICENSE

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
Copyright (c) 2001-2014
1+
Copyright (c) 2001-2016
22
Allen Short
3-
Andy Gayton
3+
Amber Hawkie Brown
44
Andrew Bennetts
5+
Andy Gayton
56
Antoine Pitrou
67
Apple Computer, Inc.
78
Ashwini Oruganti
@@ -10,6 +11,7 @@ Bob Ippolito
1011
Canonical Limited
1112
Christopher Armstrong
1213
David Reid
14+
Divmod Inc.
1315
Donovan Preston
1416
Eric Mangold
1517
Eyal Lotem
@@ -21,29 +23,33 @@ James Knight
2123
Jason A. Mobarak
2224
Jean-Paul Calderone
2325
Jessica McKellar
26+
Jonathan D. Simms
2427
Jonathan Jacobs
2528
Jonathan Lange
26-
Jonathan D. Simms
27-
Jürgen Hermann
2829
Julian Berman
30+
Jürgen Hermann
2931
Kevin Horn
3032
Kevin Turner
3133
Laurens Van Houtven
3234
Mary Gardiner
33-
Matthew Lefkowitz
3435
Massachusetts Institute of Technology
36+
Matthew Lefkowitz
3537
Moshe Zadka
3638
Paul Swartz
3739
Pavel Pergamenshchik
40+
Rackspace, US Inc.
3841
Ralph Meijer
3942
Richard Wall
4043
Sean Riley
4144
Software Freedom Conservancy
42-
Travis B. Hartwell
45+
Tavendo GmbH
4346
Thijs Triemstra
4447
Thomas Herve
4548
Timothy Allen
4649
Tom Prince
50+
Travis B. Hartwell
51+
52+
and others that have contributed code to the public domain.
4753

4854
Permission is hereby granted, free of charge, to any person obtaining
4955
a copy of this software and associated documentation files (the

0 commit comments

Comments
 (0)