Skip to content

Commit a4927ae

Browse files
authored
Fix more issues installing from a tarball (#1167)
* Ensure conda packages are from conda-forge * Look for the VERSION file in the right location * Update simplex pyproject.toml to fix tarball build * Get version from VERSION if needed in lib pkg-config files * Fix pkg-config file formatting
1 parent bef47e2 commit a4927ae

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

src/amuse_simplex/packages/amuse-simplex/pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ distance = "{next_version}.dev{distance}+{vcs}{rev}"
2121
dirty = "{base_version}+d{build_date:%Y%m%d}"
2222
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
2323

24+
[tool.versioningit.vcs]
25+
method = { module = "version_helper", value = "get_amuse_version", module-dir = "amuse_simplex/support/shared" }
26+
2427
[tool.hatch.build]
2528
skip-excluded-dirs = true
2629

@@ -39,3 +42,5 @@ pythonpath = ["amuse_simplex/tests/"]
3942

4043
testpaths = ["amuse_simplex/tests"]
4144

45+
addopts = "--import-mode=append" # test the installed package
46+

support/setup/dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ DEPS_dnf="${DEPS_dnf} libqhull-devel blas-devel lapack-devel"
7474

7575
# Help messages for the user, used by help.sh
7676

77-
CONDA_CMDS="${BOLD}conda install -c conda-forge ${DEPS_conda}${END_BOLD}\n"
77+
CONDA_CMDS="${BOLD}conda install -c conda-forge --override-channels ${DEPS_conda}${END_BOLD}\n"
7878
MACPORTS_CMDS="${BOLD}sudo port install ${DEPS_macports}\n${DEPS_POST_macports}${END_BOLD}\n"
7979
HOMEBREW_CMDS="${BOLD}brew install ${DEPS_homebrew}${END_BOLD}\n"
8080
APT_CMDS="${BOLD}sudo apt install ${DEPS_apt}${END_BOLD}\n"

support/setup/help.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ To do that, use
152152
if [ "a${HAVE_PYPI_PIP}" != "a" ] ; then
153153
printf ' %s\n' 'python3 -m pip uninstall pip'
154154
fi
155-
printf ' %s\n' 'conda install -c conda-forge pip wheel'
155+
printf ' %s\n' 'conda install -c conda-forge --override-channels pip wheel'
156156
fi
157157

158158
printf '\n%b\n' "and then run

support/shared/lib-targets.mk

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ $(DYNAMIC_LIB): $(OBJS)
9090
%.mod: %.f90
9191
$(FC) $(FCFLAGS) -c -o $*.o $<
9292

93+
export PKG_CONFIG_CONTENTS
94+
9395
$(PKG_CONFIG_FILE):
94-
# the file function is not available on old macOS make, so we make do with this
95-
printf '' >$@
96-
$(foreach line,$(PKG_CONFIG_CONTENTS),printf '%s\n' '$(line)' >>$@;)
96+
@# the file function is not available on old macOS make, so we make do with this
97+
printf '%b' "$${PKG_CONFIG_CONTENTS}" >$@
98+
9799

98100

99101
ifdef DYNAMIC_LIB_MPI
@@ -107,10 +109,11 @@ endif
107109
%.mo: %.f90
108110
$(MPIFC) $(FCFLAGS) $(CFLAGS_MPI) -c -o $*.mo $<
109111

112+
export PKG_CONFIG_CONTENTS_MPI
113+
110114
$(PKG_CONFIG_FILE_MPI):
111-
# the file function is not available on old macOS make, so we make do with this
112-
printf '' >$@
113-
$(foreach line,$(PKG_CONFIG_CONTENTS_MPI),printf '%s\n' '$(line)' >>$@;)
115+
@# the file function is not available on old macOS make, so we make do with this
116+
printf '%b' "$${PKG_CONFIG_CONTENTS_MPI}" >$@
114117

115118

116119
# Clean up

support/shared/version.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
AMUSE_VERSION := $(patsubst v%,%,$(shell git describe --tags))
22

3+
ifeq (,$(AMUSE_VERSION))
4+
AMUSE_VERSION := $(shell grep -v '^#' ../../VERSION)
5+
endif
6+
37
export AMUSE_VERSION
48

support/shared/version_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def get_amuse_version(project_dir, params):
3636
except (NotVCSError, NotSdistError):
3737
proj_dir = Path(project_dir)
3838

39-
version = load_version(proj_dir.parents[1] / 'VERSION')
39+
version = load_version(proj_dir.parents[0] / 'VERSION')
4040

4141
if version is None:
42-
version = load_version(proj_dir.parents[4] / 'VERSION')
42+
version = load_version(proj_dir.parents[3] / 'VERSION')
4343

4444
return VCSDescription(version, 'exact', None, {})

0 commit comments

Comments
 (0)