Skip to content

Commit 9ee1ccb

Browse files
authored
Merge pull request #118 from t20100/fix-debian-packaging
Fixed debian/ubuntu packaging
2 parents a0aecd7 + 546bee5 commit 9ee1ccb

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This version of `hdf5plugin` requires Python3 and supports arm64 architecture.
1111
- Fixed `FciDecomp` error message when built without c++11 (PR #113)
1212
- Updated blosc compile flags (`-std-c99`) to build for manylinux1 (PR #109)
1313
- Updated c-blosc to v1.20.1 (PR #101)
14-
- Updated: continuous integration (PR #104, #111), project structure (PR #114), changelog (PR #117)
14+
- Updated: continuous integration (PR #104, #111), project structure (PR #114, #118), changelog (PR #117)
1515

1616
2.3.2
1717
-----

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ recursive-include doc *
1212
recursive-include src *
1313
recursive-include test *.py *.h5
1414
recursive-include package *
15+
global-exclude *__pycache__/*

build-deb.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
project=hdf5plugin
3131
source_project=hdf5plugin
32-
version=$(python3 -c"import version; print(version.version)")
33-
strictversion=$(python3 -c"import version; print(version.strictversion)")
34-
debianversion=$(python3 -c"import version; print(version.debianversion)")
3532

3633
deb_name=$(echo "$source_project" | tr '[:upper:]' '[:lower:]')
3734

@@ -66,6 +63,13 @@ project_directory="`( cd \"$project_directory\" && pwd )`" # absolutized
6663
dist_directory=${project_directory}/dist/${target_system}
6764
build_directory=${project_directory}/build/${target_system}
6865

66+
# Get version info
67+
cd ${project_directory}/src/${project}
68+
version=$(python3 -B -c"import _version; print(_version.version)")
69+
strictversion=$(python3 -B -c"import _version; print(_version.strictversion)")
70+
debianversion=$(python3 -B -c"import _version; print(_version.debianversion)")
71+
cd ${project_directory}
72+
6973
if [ -d /usr/lib/ccache ];
7074
then
7175
export PATH=/usr/lib/ccache:$PATH

setup.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -612,20 +612,17 @@ def prefix(directory, files):
612612

613613
# setup
614614

615-
# ########## #
616-
# version.py #
617-
# ########## #
618-
619-
def get_version():
620-
"""Returns current version number from version.py file"""
615+
def get_version(debian=False):
616+
"""Returns current version number from _version.py file"""
621617
dirname = os.path.join(
622-
os.path.dirname(os.path.abspath(__file__)),
623-
'src',
624-
'hdf5plugin')
618+
os.path.dirname(os.path.abspath(__file__)), "src", PROJECT)
625619
sys.path.insert(0, dirname)
620+
dont_write_bytecode = sys.dont_write_bytecode
621+
sys.dont_write_bytecode = True # Avoid creating __pycache__/_version.pyc
626622
import _version
627623
sys.path = sys.path[1:]
628-
return _version.strictversion
624+
sys.dont_write_bytecode = dont_write_bytecode
625+
return _version.debianversion if debian else _version.strictversion
629626

630627

631628
################################################################################
@@ -646,8 +643,7 @@ class sdist_debian(sdist):
646643

647644
@staticmethod
648645
def get_debian_name():
649-
import version
650-
name = "%s_%s" % (PROJECT, version.debianversion)
646+
name = "%s_%s" % (PROJECT, get_version(debian=True))
651647
return name
652648

653649
def prune_file_list(self):
@@ -693,6 +689,7 @@ def make_distribution(self):
693689

694690
PROJECT = 'hdf5plugin'
695691
author = "ESRF - Data Analysis Unit"
692+
author_email = "silx@esrf.fr"
696693
description = "HDF5 Plugins for windows,MacOS and linux"
697694
url='https://github.com/silx-kit/hdf5plugin'
698695
f = open("README.rst")
@@ -730,6 +727,7 @@ def make_distribution(self):
730727
setup(name=PROJECT,
731728
version=get_version(),
732729
author=author,
730+
author_email=author_email,
733731
url=url,
734732
classifiers=classifiers,
735733
description=description,

0 commit comments

Comments
 (0)