Skip to content

Commit b154917

Browse files
vstinnerlarryhastings
authored andcommitted
[3.4] Backport CI config from master (#2475)
* Issues #23808, #25911: Trying to fix walk tests on Windows. On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag. (cherry picked from commit 388b90f) * bpo-30231: Remove skipped test_imaplib tests (#1419) (#2193) The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept TLS connection using our self-signed x509 certificate. Remove the two tests which are already skipped. (cherry picked from commit 7895a05) * Backport CI config from master * Add .travis.yml for Travis CI * Add .github/ for AppVeyor and CodeCov. * Travis CI: remove "make regen-all" check The regen-all Makefile rule doesn't exist in Python 3.4, only since Python 3.5 and newer (and 2.7). * appveyor: replace --slowest with --slow * Travis CI: remove the GCC coverage job * Travis CI: remove tzdata resource from regrtest tzdata resource doesn't exist in Python 3.4. * Travis CI: remove the doc job Fixing Sphinx warnings requires to backport huge intrusive changes like: - commit d97b7dc - commit 5c67933 * appveyor: set version to 3.4.6+ * bpo-30730: Fix test_os tests. Fix test_invalid_cmd() and test_invalid_env(), TypeError is raised on Python 3.4. (cherry picked from commit 5e22721)
1 parent 3b3a5a5 commit b154917

File tree

6 files changed

+152
-15
lines changed

6 files changed

+152
-15
lines changed

.github/CONTRIBUTING.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Contributing to Python
2+
======================
3+
4+
Build Status
5+
------------
6+
7+
- master
8+
9+
+ `Stable buildbots <http://buildbot.python.org/3.x.stable/>`_
10+
11+
- 3.6
12+
13+
+ `Stable buildbots <http://buildbot.python.org/3.6.stable/>`_
14+
15+
- 3.5
16+
17+
+ `Stable buildbots <http://buildbot.python.org/3.5.stable/>`_
18+
19+
- 2.7
20+
21+
+ `Stable buildbots <http://buildbot.python.org/2.7.stable/>`_
22+
23+
24+
Contribution Guidelines
25+
-----------------------
26+
Please read the `devguide <https://cpython-devguide.readthedocs.io/>`_ for
27+
guidance on how to contribute to this project. The documentation covers
28+
everything from how to build the code to submitting a pull request. There are
29+
also suggestions on how you can most effectively help the project.
30+
31+
Please be aware that our workflow does deviate slightly from the typical GitHub
32+
project. Details on how to properly submit a pull request are covered in
33+
`Lifecycle of a Pull Request <https://cpython-devguide.readthedocs.io/pullrequest.html>`_.
34+
One key point is to keep comments on GitHub to only those related to the reviewing
35+
the code in the pull request. All other discussions -- e.g. about the issue being
36+
fixed -- should happen on bugs.python.org.
37+
38+
If you are making a code contribution or large documentation contribution,
39+
please feel free to add yourself to the ``Misc/ACKS`` file alphabetically.
40+
41+
42+
Code of Conduct
43+
---------------
44+
All interactions for this project are covered by the
45+
`PSF Code of Conduct <https://www.python.org/psf/codeofconduct/>`_. Everyone is
46+
expected to be open, considerate, and respectful of others no matter their
47+
position within the project.

.github/appveyor.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 3.4.6+.{build}
2+
clone_depth: 5
3+
branches:
4+
only:
5+
- master
6+
- /\d\.\d/
7+
- buildbot-custom
8+
build_script:
9+
- cmd: PCbuild\build.bat -e
10+
test_script:
11+
- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slow --timeout=1200 -j0
12+
13+
# Only trigger AppVeyor if actual code or its configuration changes
14+
only_commits:
15+
files:
16+
- .github/appveyor.yml
17+
- .gitattributes
18+
- Grammar/
19+
- Include/
20+
- Lib/
21+
- Modules/
22+
- Objects/
23+
- PC/
24+
- PCBuild/
25+
- Parser/
26+
- Programs/
27+
- Python/
28+
- Tools/

.travis.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
language: c
2+
dist: trusty
3+
sudo: false
4+
group: beta
5+
6+
# To cache doc-building dependencies.
7+
cache: pip
8+
9+
branches:
10+
only:
11+
- master
12+
- /^\d\.\d$/
13+
14+
matrix:
15+
fast_finish: true
16+
allow_failures:
17+
- env: OPTIONAL=true
18+
include:
19+
- os: linux
20+
language: c
21+
compiler: clang
22+
# gcc also works, but to keep the # of concurrent builds down, we use one C
23+
# compiler here and the other to run the coverage build. Clang is preferred
24+
# in this instance for its better error messages.
25+
env: TESTING=cpython
26+
- os: osx
27+
language: c
28+
compiler: clang
29+
# Testing under macOS is optional until testing stability has been demonstrated.
30+
env: OPTIONAL=true
31+
before_install:
32+
- brew install openssl xz
33+
- export CPPFLAGS="-I$(brew --prefix openssl)/include"
34+
- export LDFLAGS="-L$(brew --prefix openssl)/lib"
35+
36+
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
37+
before_script:
38+
- |
39+
set -e
40+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
41+
then
42+
echo "Only docs were updated, stopping build process."
43+
exit
44+
fi
45+
./configure --with-pydebug
46+
make -j4
47+
48+
script:
49+
# Using the built Python as patchcheck.py is built around the idea of using
50+
# a checkout-build of CPython to know things like what base branch the changes
51+
# should be compared against.
52+
# Only run on Linux as the check only needs to be run once.
53+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
54+
# `-r -w` implicitly provided through `make buildbottest`.
55+
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
56+
57+
notifications:
58+
email: false
59+
irc:
60+
channels:
61+
# This is set to a secure variable to prevent forks from notifying the
62+
# IRC channel whenever they fail a build. This can be removed when travis
63+
# implements https://github.com/travis-ci/travis-ci/issues/1094.
64+
# The actual value here is: irc.freenode.net#python-dev
65+
- secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
66+
on_success: change
67+
on_failure: always
68+
skip_join: true

Lib/test/test_imaplib.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,6 @@ def test_logincapa(self):
468468
_server = self.imap_class(self.host, self.port)
469469
self.check_logincapa(_server)
470470

471-
def test_logincapa_with_client_certfile(self):
472-
with transient_internet(self.host):
473-
_server = self.imap_class(self.host, self.port, certfile=CERTFILE)
474-
self.check_logincapa(_server)
475-
476-
def test_logincapa_with_client_ssl_context(self):
477-
with transient_internet(self.host):
478-
_server = self.imap_class(self.host, self.port, ssl_context=self.create_ssl_context())
479-
self.check_logincapa(_server)
480-
481471
def test_logout(self):
482472
with transient_internet(self.host):
483473
_server = self.imap_class(self.host, self.port)

Lib/test/test_os.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,11 @@ def setUp(self):
770770
if support.can_symlink():
771771
os.symlink(os.path.abspath(t2_path), self.link_path)
772772
os.symlink('broken', broken_link_path, True)
773-
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
773+
if os.path.isdir(broken_link_path):
774+
# On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
775+
self.sub2_tree = (sub2_path, ["broken_link", "link"], ["tmp3"])
776+
else:
777+
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"])
774778
else:
775779
self.sub2_tree = (sub2_path, [], ["tmp3"])
776780

Lib/test/test_subprocess.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,24 +609,24 @@ def test_empty_env(self):
609609
def test_invalid_cmd(self):
610610
# null character in the command name
611611
cmd = sys.executable + '\0'
612-
with self.assertRaises(ValueError):
612+
with self.assertRaises((ValueError, TypeError)):
613613
subprocess.Popen([cmd, "-c", "pass"])
614614

615615
# null character in the command argument
616-
with self.assertRaises(ValueError):
616+
with self.assertRaises((ValueError, TypeError)):
617617
subprocess.Popen([sys.executable, "-c", "pass#\0"])
618618

619619
def test_invalid_env(self):
620620
# null character in the enviroment variable name
621621
newenv = os.environ.copy()
622622
newenv["FRUIT\0VEGETABLE"] = "cabbage"
623-
with self.assertRaises(ValueError):
623+
with self.assertRaises((ValueError, TypeError)):
624624
subprocess.Popen([sys.executable, "-c", "pass"], env=newenv)
625625

626626
# null character in the enviroment variable value
627627
newenv = os.environ.copy()
628628
newenv["FRUIT"] = "orange\0VEGETABLE=cabbage"
629-
with self.assertRaises(ValueError):
629+
with self.assertRaises((ValueError, TypeError)):
630630
subprocess.Popen([sys.executable, "-c", "pass"], env=newenv)
631631

632632
# equal character in the enviroment variable name

0 commit comments

Comments
 (0)