Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cases/chameleon/ChameleonUsing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# nuitka-project: --standalone
from chameleon import PageTemplate


BIGTABLE_ZPT = """\
<table xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal">
<tr tal:repeat="row python: options['table']">
<td tal:repeat="c python: row.values()">
<span tal:define="d python: c + 1"
tal:attributes="class python: 'column-' + str(d)"
tal:content="python: d" />
</td>
</tr>
</table>"""


if __name__ == "__main__":
tmpl = PageTemplate(BIGTABLE_ZPT)
table = [
dict(a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9, j=10) for x in range(500)
]
options = {"table": table}

tmpl(options=options)
26 changes: 26 additions & 0 deletions cases/chameleon/case.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# yamllint disable rule:line-length
# yamllint disable rule:indentation
# yamllint disable rule:comments-indentation
# too many spelling things, spell-checker: disable
---
- case: chameleon-latest
# Integer version, increased when results become invalidated by cases changes.
version: 1
filename: "ChameleonUsing.py"
# Requirements to do
requirements:
# First one is item under test.
- chameleon
os:
- Win32
- Win32-Anaconda
- Linux
- macOS
# Does commercial compilation change things.
commercial: "no"
# Does this package create a GUI program.
gui: "no"
# Does this package have icons
icons: "no"
# Can this program be run automatically.
interactive: "no"
21 changes: 21 additions & 0 deletions cases/dulwichlog/DulwichUsing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# nuitka-project: --standalone
# nuitka-project: --include-data-dir={MAIN_DIRECTORY}/data=data
import os
import dulwich.repo


def iter_all_commits(repo):
# iterate on all changes on the Git repository
for entry in repo.get_walker(head):
pass


if __name__ == "__main__":
repo_path = os.path.join(os.path.dirname(__file__), "data", "asyncio.git")

repo = dulwich.repo.Repo(repo_path)
head = repo.head()
repo.close()

iter_all_commits(repo)
repo.close()
26 changes: 26 additions & 0 deletions cases/dulwichlog/case.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# yamllint disable rule:line-length
# yamllint disable rule:indentation
# yamllint disable rule:comments-indentation
# too many spelling things, spell-checker: disable
---
- case: dulwichlog-latest
# Integer version, increased when results become invalidated by cases changes.
version: 1
filename: "DulwichUsing.py"
# Requirements to do
requirements:
# First one is item under test.
- dulwich
os:
- Win32
- Win32-Anaconda
- Linux
- macOS
# Does commercial compilation change things.
commercial: "no"
# Does this package create a GUI program.
gui: "no"
# Does this package have icons
icons: "no"
# Can this program be run automatically.
interactive: "no"
34 changes: 34 additions & 0 deletions cases/dulwichlog/data/asyncio.git/COMMIT_EDITMSG
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
fix ResourceWarning related to subprocesses

Python issue #26741: BaseSubprocessTransport._process_exited() now
copies the return code from the child watched to the returncode
attribute of the Popen object. On Python 3.6, it is required to avoid
a ResourceWarning.

# Veuillez saisir le message de validation pour vos modifications. Les lignes
# commençant par '#' seront ignorées, et un message vide abandonne la validation.
# Sur la branche master
# Votre branche est à jour avec 'origin/master'.
#
# Modifications qui seront validées :
# modifié : asyncio/base_subprocess.py
#
# Fichiers non suivis non affichés
# ------------------------ >8 ------------------------
# Ne touchez pas à la ligne ci-dessus
# Tout se qui suit sera éliminé.
diff --git a/asyncio/base_subprocess.py b/asyncio/base_subprocess.py
index 08080bd..8fc253c 100644
--- a/asyncio/base_subprocess.py
+++ b/asyncio/base_subprocess.py
@@ -210,6 +210,10 @@ def _process_exited(self, returncode):
logger.info('%r exited with return code %r',
self, returncode)
self._returncode = returncode
+ if self._proc.returncode is None:
+ # asyncio uses a child watcher: copy the status into the Popen
+ # object. On Python 3.6, it is required to avoid a ResourceWarning.
+ self._proc.returncode = returncode
self._call(self._protocol.process_exited)
self._try_finish()

1 change: 1 addition & 0 deletions cases/dulwichlog/data/asyncio.git/FETCH_HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bea3a4247a450be7fb82dec111429bb2752aac4d branch 'master' of github.com:python/asyncio
1 change: 1 addition & 0 deletions cases/dulwichlog/data/asyncio.git/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/master
1 change: 1 addition & 0 deletions cases/dulwichlog/data/asyncio.git/ORIG_HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
38fdb004db674f32b7a38ee294db5546bae0a432
11 changes: 11 additions & 0 deletions cases/dulwichlog/data/asyncio.git/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:python/asyncio.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
1 change: 1 addition & 0 deletions cases/dulwichlog/data/asyncio.git/description
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
15 changes: 15 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/applypatch-msg.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".

. git-sh-setup
test -x "$GIT_DIR/hooks/commit-msg" &&
exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
:
24 changes: 24 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/commit-msg.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
8 changes: 8 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/post-update.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".

exec git update-server-info
14 changes: 14 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/pre-applypatch.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".

. git-sh-setup
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
:
49 changes: 49 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/pre-commit.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".

if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --bool hooks.allownonascii)

# Redirect output to stderr.
exec 1>&2

# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.

This can cause problems if you want to work with people on other platforms.

To be portable it is advisable to rename the file.

If you know what you are doing you can disable this check using:

git config hooks.allownonascii true
EOF
exit 1
fi

# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
53 changes: 53 additions & 0 deletions cases/dulwichlog/data/asyncio.git/hooks/pre-push.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
# <local ref> <local sha1> <remote ref> <remote sha1>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).

remote="$1"
url="$2"

z40=0000000000000000000000000000000000000000

while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
then
# Handle delete
:
else
if [ "$remote_sha" = $z40 ]
then
# New branch, examine all commits
range="$local_sha"
else
# Update to existing branch, examine new commits
range="$remote_sha..$local_sha"
fi

# Check for WIP commit
commit=`git rev-list -n 1 --grep '^WIP' "$range"`
if [ -n "$commit" ]
then
echo >&2 "Found WIP commit in $local_ref, not pushing"
exit 1
fi
fi
done

exit 0
Loading
Loading