Skip to content

Commit ba4c3f2

Browse files
committed
Stop using deprecated __conda_version__.txt file.
Add dummy setup.py file and use the jinja template function to get the version string.
1 parent 4d25599 commit ba4c3f2

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

Diff for: conda-recipe/build.sh

-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ scons test
2121

2222
# Install the library.
2323
scons install prefix=$PREFIX
24-
25-
grep '^#define DIFFPY_VERSION_STR' < "${PREFIX}/include/diffpy/version.hpp" |
26-
cut -d '"' -f 2 > __conda_version__.txt

Diff for: conda-recipe/meta.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
{% set setupdata = load_setup_py_data(from_recipe_dir=True) %}
2+
13
package:
24
name: libdiffpy
3-
## Use __conda_version__.txt.
4-
# version: 1.3
5+
version: {{ setupdata['version'] }}
56

67
source:
78
# git_url: https://github.com/diffpy/libdiffpy.git

Diff for: conda-recipe/setup.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
3+
"""\
4+
Dummy distutils setup script that provides version data for meta.yaml.
5+
"""
6+
7+
import os
8+
import sys
9+
from distutils.core import setup
10+
11+
MYDIR = os.path.dirname(os.path.abspath(__file__))
12+
SITESCONSDIR = os.path.abspath(os.path.join(MYDIR, '../site_scons'))
13+
sys.path.insert(0, SITESCONSDIR)
14+
15+
from libdiffpybuildutils import gitinfo
16+
17+
ginfo = gitinfo()
18+
19+
setup(
20+
name='libdiffpy',
21+
version=ginfo['version'],
22+
)

0 commit comments

Comments
 (0)