Skip to content

Commit

Permalink
Python: add script for generating, uploading sdist
Browse files Browse the repository at this point in the history
The "v" is stripped from the version number generated by `genversion.sh` as
PyPi does not accept version numbers containing letters.

The version is generated as a part of the script and written to a file
which is read by setup.py.
  • Loading branch information
otron committed Jul 30, 2015
1 parent e5b7572 commit b02410e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bindings/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ build
.project
.pydevproject
.cproject
*.py[co]
*.py[co]
MANIFEST
VERSION_INFO
1 change: 0 additions & 1 deletion bindings/python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include README.rst
include VERSION_INFO
include genversion.sh
recursive-include tests *
recursive-include examples *.py
recursive-include docs *
Expand Down
6 changes: 2 additions & 4 deletions bindings/python/setup_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
xrdincdir = getenv( 'XRD_INCDIR' ) or '/usr/include/xrootd'

# Get package version
topdir = path.dirname(path.dirname(getcwd()))
p = subprocess.Popen(['./genversion.sh', '--print-only'], stdout=subprocess.PIPE, cwd=topdir)
version, err = p.communicate()
version = version.strip()
with open ('VERSION_INFO') as verfile:
version = verfile.read().strip()

print 'XRootD library dir: ', xrdlibdir
print 'XRootD include dir: ', xrdincdir
Expand Down
10 changes: 10 additions & 0 deletions dopy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Writes the xrootd version to bindings/python/VERSION_INFO,
# generates and uploads a source distribution for the python bindings.
./genversion.sh --print-only | sed "s/v//" > bindings/python/VERSION_INFO
cd bindings/python
cp setup_pypi.py setup.py
python setup.py sdist
twine upload dist/*
rm setup.py dist/*

0 comments on commit b02410e

Please sign in to comment.