Skip to content

Commit

Permalink
Merge branch 'trunk' into 7530-altendky-do_not_require_trailing_newli…
Browse files Browse the repository at this point in the history
…ne_for_cert
  • Loading branch information
wsanchez authored Aug 4, 2017
2 parents ddfa34c + 760d56e commit 6a8b32d
Show file tree
Hide file tree
Showing 24 changed files with 453 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ matrix:
# For now all non-trial tests are in a single job to reduce the time spent
# on starting separate jobs.
- python: 2.7
env: TOXENV=narrativedocs,apidocs,pyflakes,topfile,manifest-checker
env: TOXENV=narrativedocs,apidocs,pyflakes,newsfragment,manifest-checker
- python: 3.5
env: TOXENV=pyflakes3
# Twistedchecker is running as a separate job so that we can ignore if it
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - All of the test files, so that the tests can be run on an installed copy.
# We do not want to include:
# - Release management files (e.g. topfiles)
# - Things only useful when running from a source checkout (_preamble.py)
# - Things only useful when running from a source checkout

# Do not include the old topfiles, or news fragments
recursive-exclude src/twisted *.misc *.bugfix *.doc *.feature *.removal
Expand Down
19 changes: 0 additions & 19 deletions bin/_preamble.py

This file was deleted.

10 changes: 1 addition & 9 deletions bin/admin/build-apidocs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
# This script is not meant to be distributed to users of Twisted.
# It is only for use in making upstream Twisted releases.

import sys, os
extra = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), "src")
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
pass
sys.path.remove(extra)

import sys
from twisted.python._release import BuildAPIDocsScript

BuildAPIDocsScript().main(sys.argv[1:])
10 changes: 1 addition & 9 deletions bin/admin/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
# This script is not meant to be distributed to users of Twisted.
# It is only for use in making upstream Twisted releases.

import sys, os
extra = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), "src")
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
pass
sys.path.remove(extra)

import sys
from twisted.python._release import SphinxBuilder

SphinxBuilder().main(sys.argv[1:])
14 changes: 14 additions & 0 deletions bin/admin/check-newsfragment
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
Check that the current commits since branching have a topfile.
"""

from __future__ import absolute_import, division, print_function

import sys
from twisted.python._release import CheckNewsfragmentScript

CheckNewsfragmentScript(print).main(sys.argv[1:])
22 changes: 0 additions & 22 deletions bin/admin/check-topfile

This file was deleted.

32 changes: 10 additions & 22 deletions docs/core/development/policy/coding-standard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -371,30 +371,15 @@ This makes the script more portable but note that it is not a foolproof method.
Always make sure that ``/usr/bin/env`` exists or use a softlink/symbolic link to point it to the correct path.
Python's distutils will rewrite the shebang line upon installation so this policy only covers the source files in version control.

#. For core scripts, add this Twisted running-from-Git header:
#. For core scripts, add an entry to ``_CONSOLE_SCRIPTS`` in ``src/twisted/python/_setup.py``:

.. code-block:: python
import sys
try:
import _preamble
except ImportError:
sys.clear_exc()
Or for sub-project scripts, add a modified version which also adjusts ``sys.path``:

.. code-block:: python
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.clear_exc()
sys.path.remove(extra)
_CONSOLE_SCRIPTS = [
...
"twistd = twisted.scripts.twistd:run",
"yourmodule" = "twisted.scripts.yourmodule:run",
]
#. And end with:

Expand All @@ -407,7 +392,10 @@ Python's distutils will rewrite the shebang line upon installation so this polic
#. Write a manpage and add it to the ``man`` folder of a subproject's ``doc`` folder.
On Debian systems you can find a skeleton example of a manpage in ``/usr/share/doc/man-db/examples/manpage.example``.

This will ensure your program will work correctly for users of Git, Windows releases and Debian packages.

This will ensure that your program will have a proper ``console_scripts`` entry point, which
``setup.py`` will use to generate a console script which will work correctly for users of
Git, Windows releases and Debian packages.


Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/core/development/policy/release-process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ How to do a release candidate
4. Run ``python -m incremental.update Twisted --rc``
5. Commit the changes made by Incremental.
6. Run ``towncrier``.
7. Commit the changes made by towncrier - this automatically removes the NEWS topfiles.
7. Commit the changes made by towncrier - this automatically removes the NEWS newsfragments.
8. Bump copyright dates in ``LICENSE``, ``twisted/copyright.py``, and ``README.rst`` if required
9. Push the changes up to GitHub.
10. Run ``python setup.py sdist --formats=bztar -d /tmp/twisted-release`` to build the tarballs.
Expand Down
Empty file.
Empty file.
Empty file.
20 changes: 10 additions & 10 deletions src/twisted/python/_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from twisted.python.filepath import FilePath
from twisted.python.monkey import MonkeyPatcher

# Types of topfiles.
TOPFILE_TYPES = ["doc", "bugfix", "misc", "feature", "removal"]
# Types of newsfragments.
NEWSFRAGMENT_TYPES = ["doc", "bugfix", "misc", "feature", "removal"]
intersphinxURLs = [
u"https://docs.python.org/2/objects.inv",
u"https://docs.python.org/3/objects.inv",
Expand Down Expand Up @@ -201,7 +201,7 @@ class Project(object):
@ivar directory: A L{twisted.python.filepath.FilePath} pointing to the base
directory of a Twisted-style Python package. The package should contain
a C{_version.py} file and a C{topfiles} directory that contains a
a C{_version.py} file and a C{newsfragments} directory that contains a
C{README} file.
"""

Expand Down Expand Up @@ -241,7 +241,7 @@ def findTwistedProjects(baseDirectory):
"""
projects = []
for filePath in baseDirectory.walk():
if filePath.basename() == 'topfiles':
if filePath.basename() == 'newsfragments':
projectDirectory = filePath.parent()
projects.append(Project(projectDirectory))
return projects
Expand Down Expand Up @@ -497,7 +497,7 @@ def main(self, args):



class CheckTopfileScript(object):
class CheckNewsfragmentScript(object):
"""
A thing for checking whether a checkout has a newsfragment.
"""
Expand Down Expand Up @@ -541,22 +541,22 @@ def main(self, args):
self._print("Quotes change only; no newsfragment needed.")
sys.exit(0)

topfiles = []
newsfragments = []

for change in files:
if os.sep + "newsfragments" + os.sep in change:
if "." in change and change.rsplit(".", 1)[1] in TOPFILE_TYPES:
topfiles.append(change)
if "." in change and change.rsplit(".", 1)[1] in NEWSFRAGMENT_TYPES:
newsfragments.append(change)

if branch.startswith("release-"):
if topfiles:
if newsfragments:
self._print("No newsfragments should be on the release branch.")
sys.exit(1)
else:
self._print("Release branch with no newsfragments, all good.")
sys.exit(0)

for change in topfiles:
for change in newsfragments:
self._print("Found " + change)
sys.exit(0)

Expand Down
6 changes: 0 additions & 6 deletions src/twisted/python/_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,6 @@ def _checkCPython(sys=sys, platform=platform):
"twisted.test.test_hook",
"twisted.test.test_rebuild",
"twisted.test.test_shortcut",
"twisted.web.domhelpers",
"twisted.web.microdom",
"twisted.web.rewrite",
"twisted.web.soap",
"twisted.web.sux",
"twisted.web.test.test_domhelpers",
"twisted.web.test.test_soap",
"twisted.web.test.test_xml",
]
Loading

0 comments on commit 6a8b32d

Please sign in to comment.