Last active
March 17, 2018 02:45
-
-
Save thejohnfreeman/155208b4c5b888f791d90fa0642550d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Conda recipe is used to build a package for distribution. It builds a temporary environment with the dependencies in `recipe/meta.yaml`, then runs `python setup.py install` to install the package into that environment. setuptools will install any additional dependencies in `install_requires`, but Conda will be unaware of them (or include them in the distribution?). | |
setuptools dependencies refer to PyPI package names, and Conda dependencies refer to Conda package names, which are the same when developers consistently put the same name in their `setup.py` and `recipe/meta.yaml`. In theory, when they don't, then using the same dependency lists for both tools can make your build fail, but in practice, they seemingly always do. | |
If a developer has published their Python package to PyPI but not Conda, you might be able to [find it an alternative channel](https://stackoverflow.com/a/38065334/618906). | |
The `setup.py` is used to install a package into a development environment (with `python setup.py develop`) or into a Conda build environment for packaging. If the development environment and build environment both provide the same dependencies, then none need to be specified in `setup.py`. We can build the development environment with Conda using an `environment.yml`, but the build environment is built with the dependencies in `recipe/meta.yaml`. We need a way to keep them in sync. | |
We can use `setup.py` to install dependencies into an empty environment built by Conda with no `environment.yml`, but it cannot manage the Python version. This is strictly less capable than `conda update --file environment.yml`. | |
We want our development environment to include both the build *and* run dependencies in `recipe/meta.yaml`, so we can build and test in the same environment (unlike conda-build). | |
Using a sufficiently recent version of Conda, it can track the installation of packages with pip. Does this mean that it can track the installation of dependencies during conda-build, such that they are implicitly added to the dependencies of the recipe and not bundled in the distribution? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment