Skip to content

Commit

Permalink
Merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Dec 29, 2011
2 parents 87cc76a + 5ae57eb commit 33be245
Show file tree
Hide file tree
Showing 251 changed files with 7,992 additions and 6,869 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
*_name_S*

# Output directories
obj/
bin/
/bin/
Solutions/*.suo
/Stage
/Packages

# Temporary VS files
*.suo
*.csproj.user
*.wixproj.user

# Generated files
BuildInfo.Generated.cs
CurrentVersion.Generated.cs

TestResult.xml
Solutions/TestResults/
Runtime/Samples/Hosting/Scenarios/bin/
Expand Down
46 changes: 46 additions & 0 deletions Build.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!--<Import Project="CustomBuild.proj" Condition="Exist('CustomBuild.proj')" />-->

<PropertyGroup>
<BaseConfiguration Condition=" '$(BaseConfiguration)' == '' ">Debug</BaseConfiguration>
</PropertyGroup>

<ItemGroup>
<BuildProject Include="Solutions\Build.IronPython.proj"/>
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="Build" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="Rebuild">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="Rebuild" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="Clean">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="Clean" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="DistClean" DependsOnTargets="Clean">
<RemoveDir Directories="bin;Stage;Packages" />
</Target>

<Target Name="Stage">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="Stage" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="NuGetPackage">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="NuGetPackage" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="ZipPackage">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="ZipPackage" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="Installer">
<MSBuild Projects="@(BuildProject)" BuildInParallel="true" Targets="Installer" Properties="BaseConfiguration=$(BaseConfiguration)" />
</Target>

<Target Name="Package" DependsOnTargets="NuGetPackage;ZipPackage;Installer" />
</Project>
12 changes: 12 additions & 0 deletions CurrentVersion.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MajorVersion>3</MajorVersion>
<MinorVersion>0</MinorVersion>
<MicroVersion>0</MicroVersion>
<ReleaseLevel>alpha</ReleaseLevel>
<ReleaseSerial>0</ReleaseSerial>

<AssemblyRevision>0</AssemblyRevision>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).

import sys, os, time
import sys, os, time, re
sys.path.append(os.path.abspath('tools/sphinxext'))

# General configuration
Expand All @@ -28,7 +28,8 @@
# The full version, including alpha/beta/rc tags.
# release = '2.6a0'

version, release = '2.7', '2.7a1'
release = os.environ.get('PYDOC_VERSION', '2.7')
version = re.split('([^0-9.])', release)[0]

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ Directory structure:
IronPythonDocs - IronPython documentation rst (same as Python docs + IronPython specific modifications)
HtmlHelp.exe - HTML Help Workshop installer

ipymake.bat - batch file for generating HTML help and compiled html help
generates output in:
Output\ - the directory where all output is generated to
Output\Html - the pure HTML version of help
Output\CHtml - the compiled HTML version of help



Generating documentation:
Pre-reqs: You'll need to install Html Help Workshop before you can generate the CHM help. This can be installed
with the HtmlHelp.exe which is available in this directory.

Then just run ipymake.bat and the output will be written to the Output directory.
Then, from the root of the checkout, run `msbuild Solutions\Build.IronPython.proj /t:BuildChm`.

Updating Python Documentation:
When updating the standard CPython documentation a new copy of the Doc folder should be pulled from CPython's
Expand Down
33 changes: 0 additions & 33 deletions External.LCA_RESTRICTED/Languages/IronPython/27/Doc/ipymake.bat

This file was deleted.

Binary file not shown.
4 changes: 4 additions & 0 deletions External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ def setcopyright():
__builtin__.credits = _Printer(
"credits",
"Jython is maintained by the Jython developers (www.jython.org).")
elif sys.platform == 'cli':
__builtin__.credits = _Printer(
"credits",
"IronPython is maintained by the IronPython developers (www.ironpython.net).")
else:
__builtin__.credits = _Printer("credits", """\
Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def get_config_vars(*args):

if os.name in ('nt', 'os2') or sys.platform == 'cli':
_init_non_posix(_CONFIG_VARS)
if os.name == 'posix':
elif os.name == 'posix':
_init_posix(_CONFIG_VARS)

# Setting 'userbase' is done below the call to the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Unit tests for collections.defaultdict."""

import sys
import os
import copy
import tempfile
Expand Down Expand Up @@ -47,7 +48,7 @@ def test_basic(self):
self.assertEqual(err.args, (15,))
else:
self.fail("d2[15] didn't raise KeyError")
if not test_support.is_cli:
if sys.platform != 'cli':
self.assertRaises(TypeError, defaultdict, 1)

def test_missing(self):
Expand Down Expand Up @@ -149,17 +150,17 @@ def test_keyerror_without_factory(self):
else:
self.fail("expected KeyError")

if not test_support.is_cli:
def test_recursive_repr(self):
# Issue2045: stack overflow when default_factory is a bound method
class sub(defaultdict):
def __init__(self):
self.default_factory = self._factory
def _factory(self):
return []
d = sub()
self.assertTrue(repr(d).startswith(
"defaultdict(<bound method sub._factory of defaultdict(..."))
@unittest.skipIf(sys.platform == 'cli', 'Broken on ipy')
def test_recursive_repr(self):
# Issue2045: stack overflow when default_factory is a bound method
class sub(defaultdict):
def __init__(self):
self.default_factory = self._factory
def _factory(self):
return []
d = sub()
self.assertTrue(repr(d).startswith(
"defaultdict(<bound method sub._factory of defaultdict(..."))

# NOTE: printing a subclass of a builtin type does not call its
# tp_print slot. So this part is essentially the same test as above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ def test_empty_presized_dict_in_freelist(self):
'f': None, 'g': None, 'h': None}
d = {}

@test_support.cpython_only
def test_container_iterator(self):
if test_support.due_to_ironpython_bug("http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=25419"):
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_with_bound_and_unbound_methods(self):
join = self.thetype(''.join)
self.assertEqual(join(data), '0123456789')

@unittest.skipIf(test_support.is_cli, "CLR stack overflow: http://ironpython.codeplex.com/workitem/28171")
@unittest.skipIf(sys.platform == 'cli', 'IronPython pickle is wonky')
def test_pickle(self):
f = self.thetype(signature, 'asdf', bar=True)
f.add_something_to__dict__ = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def test_case_sha512_3(self):
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")

@unittest.skipIf(sys.platform == 'cli', 'Deadlock on IronPython')
@unittest.skipUnless(threading, 'Threading required for this test.')
@unittest.skipIf(test_support.is_cli, "hangs on CLR: http://ironpython.codeplex.com/workitem/28171")
@test_support.reap_threads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ def test_invalid_args(self):
self.assertRaises(ValueError, bufio.seek, 0, -1)
self.assertRaises(ValueError, bufio.seek, 0, 3)

@unittest.skipIf(sys.platform == 'cli', 'Bad behaviour on ipy')
def test_override_destructor(self):
tp = self.tp
record = []
Expand Down Expand Up @@ -1853,6 +1854,7 @@ def close(self):
support.gc_collect()
self.assertEquals([b"abc"], l)

@unittest.skipIf(sys.platform == 'cli', 'Bad behaviour in ironpython')
def test_override_destructor(self):
record = []
class MyTextIO(self.TextIOWrapper):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def combinations3(iterable, r):
self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version

# Test implementation detail: tuple re-use
if sys.platform == 'win32':
if sys.platform != 'cli':
self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1)
self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1)

Expand Down Expand Up @@ -209,7 +209,7 @@ def numcombs(n, r):
self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version

# Test implementation detail: tuple re-use
if not test_support.due_to_ironpython_incompatibility("tuple reuse"):
if sys.platform != 'cli':
self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1)
self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1)

Expand Down Expand Up @@ -274,7 +274,7 @@ def permutations2(iterable, r=None):
self.assertEqual(result, list(permutations(values))) # test default r

# Test implementation detail: tuple re-use
if sys.platform == 'win32':
if sys.platform != 'cli':
self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1)
self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1)

Expand Down Expand Up @@ -530,12 +530,12 @@ def test_izip(self):
self.assertRaises(TypeError, izip, 3)
self.assertRaises(TypeError, izip, range(3), 3)
# Check tuple re-use (implementation detail)
self.assertEqual([tuple(list(pair)) for pair in izip('abc', 'def')],
zip('abc', 'def'))
self.assertEqual([pair for pair in izip('abc', 'def')],
zip('abc', 'def'))
ids = map(id, izip('abc', 'def'))
if sys.platform == 'win32':
if sys.platform != 'cli':
self.assertEqual([tuple(list(pair)) for pair in izip('abc', 'def')],
zip('abc', 'def'))
self.assertEqual([pair for pair in izip('abc', 'def')],
zip('abc', 'def'))
ids = map(id, izip('abc', 'def'))
self.assertEqual(min(ids), max(ids))
ids = map(id, list(izip('abc', 'def')))
self.assertEqual(len(dict.fromkeys(ids)), len(ids))
Expand Down Expand Up @@ -580,11 +580,11 @@ def test_iziplongest(self):
self.fail('Did not raise Type in: ' + stmt)

# Check tuple re-use (implementation detail)
self.assertEqual([tuple(list(pair)) for pair in izip_longest('abc', 'def')],
zip('abc', 'def'))
self.assertEqual([pair for pair in izip_longest('abc', 'def')],
zip('abc', 'def'))
if sys.platform == 'win32':
if sys.platform != 'cli':
self.assertEqual([tuple(list(pair)) for pair in izip_longest('abc', 'def')],
zip('abc', 'def'))
self.assertEqual([pair for pair in izip_longest('abc', 'def')],
zip('abc', 'def'))
ids = map(id, izip_longest('abc', 'def'))
self.assertEqual(min(ids), max(ids))
ids = map(id, list(izip_longest('abc', 'def')))
Expand Down Expand Up @@ -689,7 +689,7 @@ def product2(*args, **kwds):
self.assertEqual(len(list(product(*args))), expected_len)

# Test implementation detail: tuple re-use
if sys.platform == 'win32':
if sys.platform != 'cli':
self.assertEqual(len(set(map(id, product('abc', 'def')))), 1)
self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1)

Expand Down Expand Up @@ -900,7 +900,7 @@ def f():
return p
p = f()
test_support.force_gc_collect()
self.assertRaises(ReferenceError, getattr, p, '__class__')
# self.assertRaises(ReferenceError, getattr, p, '__class__')

def test_StopIteration(self):
self.assertRaises(StopIteration, izip().next)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ def test_access(self):
f = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
os.close(f)
self.assertTrue(os.access(test_support.TESTFN, os.W_OK))
<<<<<<< HEAD

@unittest.skipIf(test_support.is_cli, "http://ironpython.codeplex.com/workitem/7267")
=======

@unittest.skipIf(sys.platform == 'cli', 'IronPython has no os.dup')
>>>>>>> add5aa5... A bunch of work to get the test suite running smoothly.
def test_closerange(self):
first = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
# We must allocate two consecutive file descriptors, otherwise
Expand Down Expand Up @@ -80,7 +85,8 @@ def check_tempfile(self, name):
self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
# make sure we can create the file
open(name, "w")
with open(name, "w"):
pass
self.files.append(name)

def test_tempnam(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from test.test_support import verbose, run_unittest, import_module, is_cli, due_to_ironpython_bug
import re
if not due_to_ironpython_bug("http://ironpython.codeplex.com/workitem/23666"):
from re import Scanner
import sys, traceback, unittest
import sys
import string
import traceback
from weakref import proxy

# Misc tests from Tim Peters' re.doc
Expand Down Expand Up @@ -541,13 +541,14 @@ def test_stack_overflow(self):
self.assertEqual(re.match('(x)*y', 50000*'x'+'y').group(1), 'x')
self.assertEqual(re.match('(x)*?y', 50000*'x'+'y').group(1), 'x')

@unittest.skipIf(is_cli, "http://ironpython.codeplex.com/workitem/23666")
@unittest.skipIf(sys.platform == 'cli', 'CPython impl detail')
def test_scanner(self):
def s_ident(scanner, token): return token
def s_operator(scanner, token): return "op%s" % token
def s_float(scanner, token): return float(token)
def s_int(scanner, token): return int(token)

from re import Scanner
scanner = Scanner([
(r"[a-zA-Z_]\w*", s_ident),
(r"\d+\.\d*", s_float),
Expand Down
Loading

0 comments on commit 33be245

Please sign in to comment.