aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-08-20 10:45:09 -0400
committerGitHub <noreply@github.com>2024-08-20 10:45:09 -0400
commit0eda05963f3c70c3969ddd2aa72926b871ef4b07 (patch)
treef38b6fd60a36b82e1247ff60ef28e694cd9517ff /include
parenta7568dc03c1c6851ff6c690e8e35ade9a3199c4a (diff)
downloadstasis-0eda05963f3c70c3969ddd2aa72926b871ef4b07.tar.gz
Pypi existence check (#30)
* Add python_package_exists() function * Poll pypi.org or compatible index to see if a package exists * Returns non-zero on success * Implements python_package_exists() in delivery_defer_packages() * Implements python_package_exists() in delivery_defer_packages() * Bugfix: Avoid incorrect package selection * With large package lists that contain multiple packages starting with the same strstr() would pick the first match * This adds a temporary name variable that strcmp() can check against. * Message correction: * Change "release" to "testing" in testing environment failure message * Amend message to fit the flow of the output * Disable outdated conda notifications * The latest version isn't always the greatest. Don't give the end-user any ideas. Just use whatever the installer provides... quietly * Rename python_package_exists to pip_index_provides * Document the function prototype * Add missing comments in micromamba structure * Ensure the temporary output file does not linger
Diffstat (limited to 'include')
-rw-r--r--include/conda.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/conda.h b/include/conda.h
index d439371..c546672 100644
--- a/include/conda.h
+++ b/include/conda.h
@@ -7,10 +7,11 @@
#include "core.h"
#define CONDA_INSTALL_PREFIX "conda"
+#define PYPI_INDEX_DEFAULT "https://pypi.org/simple"
struct MicromambaInfo {
- char *micromamba_prefix;
- char *conda_prefix;
+ char *micromamba_prefix; //!< Path to write micromamba binary
+ char *conda_prefix; //!< Path to install conda base tree
};
/**
@@ -181,4 +182,14 @@ int conda_env_export(char *name, char *output_dir, char *output_filename);
* @return exit code from "conda"
*/
int conda_index(const char *path);
+
+/**
+ * Determine whether a simple index contains a package
+ * @param index_url a file system path or url pointing to a simple index
+ * @param name package name (required)
+ * @param version package version (may be NULL)
+ * @return not found = 0, found = 1, error = -1
+ */
+int pip_index_provides(const char *index_url, const char *name, const char *version);
+
#endif //STASIS_CONDA_H