Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Improve setup.py #15

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 12 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
from os import getenv, walk, path

from distutils.core import setup, Extension
from distutils import sysconfig
from os import getenv, walk, path
import subprocess

# Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++.
Expand All @@ -17,15 +19,19 @@
sources = list()
depends = list()

for dirname, dirnames, filenames in walk('src'):
here = os.path.abspath(os.path.dirname(__file__))


for dirname, dirnames, filenames in walk(os.path.join(here, 'src')):
for filename in filenames:
if filename.endswith('.cc'):
sources.append(path.join(dirname, filename))
elif filename.endswith('.hh'):
depends.append(path.join(dirname, filename))

p = subprocess.Popen(["./genversion.sh"], stdout=subprocess.PIPE)
p = subprocess.Popen([os.path.join(here, 'genversion.sh'), here], stdout=subprocess.PIPE)
version, err = p.communicate()
version = version.strip()
print version

setup( name = 'pyxrootd',
Expand All @@ -37,9 +43,9 @@
description = "XRootD Python bindings",
long_description = "XRootD Python bindings",
packages = ['pyxrootd', 'XRootD', 'XRootD.client'],
package_dir = {'pyxrootd' : 'src',
'XRootD' : 'libs',
'XRootD.client': 'libs/client'},
package_dir = {'pyxrootd' : os.path.join(here, 'src'),
'XRootD' : os.path.join(here, 'libs'),
'XRootD.client': os.path.join(here, 'libs/client')},
ext_modules = [
Extension(
'pyxrootd.client',
Expand Down