Skip to content

Retool the setup.py infrastructure #1454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6aa7b29
First pass at making setup more sane.
mdboom Oct 8, 2012
4ae2fd2
Removing dateutils, pytz and six (external Python dependencies)
mdboom Oct 9, 2012
04a73b4
Fix a few bugs in the build.
mdboom Oct 9, 2012
bae0859
More fixes
mdboom Oct 9, 2012
9b408cd
setupegg.py is now redundant.
mdboom Nov 6, 2012
6f64971
Fix type in dates docs
mdboom Nov 6, 2012
088a267
Update INSTALL document to reflect new reality
mdboom Nov 6, 2012
7018842
Handle dateutil and pyparsing in the same manner as everything else.
mdboom Nov 6, 2012
49bd70a
Raise exception early if pyparsing and/or dateutil are not installed.
mdboom Nov 6, 2012
4d8c846
Fix pyparsing on python 3 check
mdboom Nov 6, 2012
7db8fe2
Fix build on Python 2.6
mdboom Nov 16, 2012
b81c917
Update Travis dependencies
mdboom Nov 16, 2012
4301543
Implement a better way to handle overflow in the Agg backend.
mdboom Nov 19, 2012
d93226e
Fix agg overflow test
mdboom Nov 19, 2012
5f41835
Make using an external PyCXX possible on != Python 2.7
mdboom Nov 19, 2012
ce1da9b
Fix infinite process recursion on Windows
mdboom Nov 20, 2012
e0735bf
Update to PyCXX 6.2.4
mdboom Nov 26, 2012
ee2f3f4
Update the CXX detection code to use the system PyCXX in more cases
mdboom Nov 26, 2012
8f95f1c
Fix compiler warnings about compare_handler
mdboom Nov 26, 2012
da76037
Attempting to fix Travis tests
mdboom Dec 7, 2012
b5443e2
Windows fixes from cgohlke
mdboom Dec 19, 2012
009b1a0
Fixups after rebase
mdboom Jan 16, 2013
0ed7228
multiprocessing doesn't work with Travis, so just skip the things tha…
mdboom Feb 25, 2013
5934e0e
Properly install the pylab module
mdboom Feb 25, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ python:
- 3.2

install:
- pip install --use-mirrors nose
- pip install --use-mirrors nose python-dateutil pyparsing
# This is a workaround to install numpy with the version of
# virtualenv in Travis. If that is updated in the future, this can
# be simplified to 'pip install numpy'
- 'if [ $TRAVIS_PYTHON_VERSION == "3.2" ]; then pip install https://github.com/y-p/numpy/archive/1.6.2_with_travis_fix.tar.gz; fi'
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install numpy; fi' # should be nop if pre-installed
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi
- python setup.py install
- python setup.py install --old-and-unmanageable

script:
- mkdir ../foo
Expand Down
520 changes: 517 additions & 3 deletions CXX/IndirectPythonInterface.cxx

Large diffs are not rendered by default.

17 changes: 3 additions & 14 deletions CXX/Python2/ExtensionModule.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ namespace Py
const std::string m_module_name;
const std::string m_full_module_name;
MethodTable m_method_table;
#if PY3
PyModuleDef m_module_def;
#endif
PyObject *m_module;

private:
Expand Down Expand Up @@ -136,19 +133,11 @@ namespace Py
{
MethodDefExt<T> *method_def = (*i).second;

#if PY_VERSION_HEX < 0x02070000
static PyObject *self = PyCObject_FromVoidPtr( this, do_not_dealloc );
#else
static PyObject *self = PyCapsule_New( this, NULL, NULL );
#endif
static PyObject *self = PyCObject_FromVoidPtr( this, do_not_dealloc );

Tuple args( 2 );
args[0] = Object( self );
#if PY_VERSION_HEX < 0x02070000
args[1] = Object( PyCObject_FromVoidPtr( method_def, do_not_dealloc ) );
#else
args[1] = Object( PyCapsule_New( method_def, NULL, NULL ) );
#endif
args[0] = Object( self, true );
args[1] = Object( PyCObject_FromVoidPtr( method_def, do_not_dealloc ), true );

PyObject *func = PyCFunction_New
(
Expand Down
31 changes: 8 additions & 23 deletions CXX/Python2/ExtensionOldType.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,8 @@ namespace Py
Tuple self( 2 );

self[0] = Object( this );
#if PY_VERSION_HEX < 0x02070000
self[1] = Object( PyCObject_FromVoidPtr( method_def, do_not_dealloc ), true );
#else
self[1] = Object( PyCapsule_New( method_def, NULL, NULL ), true );
#endif
self[1] = Object( PyCObject_FromVoidPtr( method_def, do_not_dealloc ), true );

PyObject *func = PyCFunction_New( &method_def->ext_meth_def, self.ptr() );

return Object(func, true);
Expand Down Expand Up @@ -238,12 +235,8 @@ namespace Py

PyObject *self_in_cobject = self_and_name_tuple[0].ptr();
T *self = static_cast<T *>( self_in_cobject );
#if PY_VERSION_HEX < 0x02070000
void *capsule = PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() );
#else
void *capsule = PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL );
#endif
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>( capsule );
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() ) );
Object result;

// Adding try & catch in case of STL debug-mode exceptions.
Expand Down Expand Up @@ -278,12 +271,8 @@ namespace Py
PyObject *self_in_cobject = self_and_name_tuple[0].ptr();
T *self = static_cast<T *>( self_in_cobject );

#if PY_VERSION_HEX < 0x02070000
void *capsule = PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() );
#else
void *capsule = PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL );
#endif
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>( capsule );
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() ) );
Tuple args( _args );

Object result;
Expand Down Expand Up @@ -319,12 +308,8 @@ namespace Py
PyObject *self_in_cobject = self_and_name_tuple[0].ptr();
T *self = static_cast<T *>( self_in_cobject );

#if PY_VERSION_HEX < 0x02070000
void *capsule = PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() );
#else
void *capsule = PyCapsule_GetPointer( self_and_name_tuple[1].ptr(), NULL );
#endif
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>( capsule );
MethodDefExt<T> *meth_def = reinterpret_cast<MethodDefExt<T> *>(
PyCObject_AsVoidPtr( self_and_name_tuple[1].ptr() ) );

Tuple args( _args );

Expand Down
2 changes: 0 additions & 2 deletions CXX/Python2/ExtensionTypeBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ namespace Py
virtual void reinit( Tuple &args, Dict &kwds );

// object basics
#if defined( PYCXX_PYTHON_2TO3 ) || !defined( PY3 )
virtual int print( FILE *, int );
#endif
virtual Object getattr( const char * );
virtual int setattr( const char *, const Object & );
virtual Object getattro( const String & );
Expand Down
Loading