setup.py (875ba99e5cebe0d6dbeeae0b865322165e817b17) setup.py (3594a89dd4e17cdeb3c4d4dd4e0166b2e32eea57)
1#!/usr/bin/env python
2# Author: Lisandro Dalcin
3# Contact: dalcinl@gmail.com
4
5"""
6PETSc for Python
7"""
8

--- 31 unchanged lines hidden (view full) ---

40
41def description():
42 with open(os.path.join(topdir, 'DESCRIPTION.rst')) as f:
43 return f.read()
44
45name = name()
46version = version()
47
1#!/usr/bin/env python
2# Author: Lisandro Dalcin
3# Contact: dalcinl@gmail.com
4
5"""
6PETSc for Python
7"""
8

--- 31 unchanged lines hidden (view full) ---

40
41def description():
42 with open(os.path.join(topdir, 'DESCRIPTION.rst')) as f:
43 return f.read()
44
45name = name()
46version = version()
47
48url = 'https://gitlab.com/petsc/petsc'
48url = 'https://gitlab.com/petsc/petsc4py'
49pypiroot = 'https://pypi.io/packages/source/%s/%s/' % (name[0], name)
50download = pypiroot + '%(name)s-%(version)s.tar.gz' % vars()
51
52devstat = ['Development Status :: 5 - Production/Stable']
53keywords = ['PETSc', 'MPI']
54
55metadata['name'] = name
56metadata['version'] = version

--- 52 unchanged lines hidden (view full) ---

109 x, y = int(vstr[0]), int(vstr[1])
110 PETSC = ">=%s.%s,<%s.%s" % (x, y, x, y+1)
111 setup_args['install_requires'] += ['petsc'+PETSC]
112 if setuptools:
113 src = os.path.join('src', 'petsc4py.PETSc.c')
114 has_src = os.path.exists(os.path.join(topdir, src))
115 has_git = os.path.isdir(os.path.join(topdir, '.git'))
116 has_hg = os.path.isdir(os.path.join(topdir, '.hg'))
49pypiroot = 'https://pypi.io/packages/source/%s/%s/' % (name[0], name)
50download = pypiroot + '%(name)s-%(version)s.tar.gz' % vars()
51
52devstat = ['Development Status :: 5 - Production/Stable']
53keywords = ['PETSc', 'MPI']
54
55metadata['name'] = name
56metadata['version'] = version

--- 52 unchanged lines hidden (view full) ---

109 x, y = int(vstr[0]), int(vstr[1])
110 PETSC = ">=%s.%s,<%s.%s" % (x, y, x, y+1)
111 setup_args['install_requires'] += ['petsc'+PETSC]
112 if setuptools:
113 src = os.path.join('src', 'petsc4py.PETSc.c')
114 has_src = os.path.exists(os.path.join(topdir, src))
115 has_git = os.path.isdir(os.path.join(topdir, '.git'))
116 has_hg = os.path.isdir(os.path.join(topdir, '.hg'))
117 if not has_src or has_git or has_hg:
117 suffix = os.path.join('src', 'binding', 'petsc4py')
118 in_petsc = topdir.endswith(os.path.sep + suffix)
119 if not has_src or has_git or has_hg or in_petsc:
118 setup_args['setup_requires'] = ['Cython>='+CYTHON]
119 #
120 setup(packages = ['petsc4py',
121 'petsc4py.lib',],
122 package_dir = {'petsc4py' : 'src',
123 'petsc4py.lib' : 'src/lib'},
124 package_data = {'petsc4py' : ['include/petsc4py/*.h',
125 'include/petsc4py/*.i',

--- 86 unchanged lines hidden (view full) ---

212 destdir_h=destdir_h,
213 wdir=wdir)
214 if err:
215 raise DistutilsError(
216 "Cython failure: '%s' -> '%s'" % (source, target))
217
218def build_sources(cmd):
219 from os.path import exists, isdir, join
120 setup_args['setup_requires'] = ['Cython>='+CYTHON]
121 #
122 setup(packages = ['petsc4py',
123 'petsc4py.lib',],
124 package_dir = {'petsc4py' : 'src',
125 'petsc4py.lib' : 'src/lib'},
126 package_data = {'petsc4py' : ['include/petsc4py/*.h',
127 'include/petsc4py/*.i',

--- 86 unchanged lines hidden (view full) ---

214 destdir_h=destdir_h,
215 wdir=wdir)
216 if err:
217 raise DistutilsError(
218 "Cython failure: '%s' -> '%s'" % (source, target))
219
220def build_sources(cmd):
221 from os.path import exists, isdir, join
220
221 pdepends = []
222 if 'PETSC_DIR' in os.environ:
223 pd = os.environ['PETSC_DIR']
224 pdepends = [pd+'/include/*.h',pd+'/include/petsc/private/*.h']
225 if 'PETSC_ARCH' in os.environ:
226 pda = os.environ['PETSC_ARCH']
227 pdepends.append(pd+'/'+pda+'/include/petscconf.h')
228
222 if (exists(join('src', 'petsc4py.PETSc.c')) and
223 not (isdir('.hg') or isdir('.git')) and
224 not cmd.force): return
229 # petsc4py.PETSc
230 source = 'petsc4py.PETSc.pyx'
225 # petsc4py.PETSc
226 source = 'petsc4py.PETSc.pyx'
231 depends = ['include/*/*.pxd',
227 depends = ('include/*/*.pxd',
232 'PETSc/*.pyx',
228 'PETSc/*.pyx',
233 'PETSc/*.pxi']
234 depends.extend(pdepends)
229 'PETSc/*.pxi',)
235 includes = ['include']
236 destdir_h = os.path.join('include', 'petsc4py')
237 run_cython(source, depends, includes,
238 destdir_c=None, destdir_h=destdir_h, wdir='src',
239 force=cmd.force, VERSION=CYTHON)
240 # libpetsc4py
241 source = os.path.join('libpetsc4py', 'libpetsc4py.pyx')
242 depends = ['include/petsc4py/*.pxd',
243 'libpetsc4py/*.pyx',
244 'libpetsc4py/*.pxi']
230 includes = ['include']
231 destdir_h = os.path.join('include', 'petsc4py')
232 run_cython(source, depends, includes,
233 destdir_c=None, destdir_h=destdir_h, wdir='src',
234 force=cmd.force, VERSION=CYTHON)
235 # libpetsc4py
236 source = os.path.join('libpetsc4py', 'libpetsc4py.pyx')
237 depends = ['include/petsc4py/*.pxd',
238 'libpetsc4py/*.pyx',
239 'libpetsc4py/*.pxi']
245 depends.extend(pdepends)
246 includes = ['include']
247 run_cython(source, depends, includes,
248 destdir_c=None, destdir_h=None, wdir='src',
249 force=cmd.force, VERSION=CYTHON)
250
251build_src.run = build_sources
252
253def run_testsuite(cmd):

--- 28 unchanged lines hidden ---
240 includes = ['include']
241 run_cython(source, depends, includes,
242 destdir_c=None, destdir_h=None, wdir='src',
243 force=cmd.force, VERSION=CYTHON)
244
245build_src.run = build_sources
246
247def run_testsuite(cmd):

--- 28 unchanged lines hidden ---